Class AbstractConfigurationLabelProvider

  • All Implemented Interfaces:
    org.eclipse.jface.viewers.IBaseLabelProvider, org.eclipse.jface.viewers.IColorProvider, org.eclipse.jface.viewers.ITableLabelProvider, org.eclipse.jface.viewers.IToolTipProvider
    Direct Known Subclasses:
    ConfigurationLabelProvider

    abstract class AbstractConfigurationLabelProvider
    extends org.eclipse.jface.viewers.CellLabelProvider
    implements org.eclipse.jface.viewers.ITableLabelProvider, org.eclipse.jface.viewers.IColorProvider
    Super class for configuration label provider. This label provider is capable of determining correct:
    • Text (String)
    • Images
    for every cell of a configuration editor.
    Author:
    El-Sharkawy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.eclipse.swt.graphics.Image ADD  
      private static org.eclipse.swt.graphics.Image ASSIGNED  
      private static org.eclipse.swt.graphics.Image CHECKED  
      private GUIConfiguration config  
      private static org.eclipse.swt.graphics.Color ERROR_COLOR  
      private static org.eclipse.swt.graphics.Color NESTED_ELEMENT_COLOR  
      private static org.eclipse.swt.graphics.Image NULL  
      protected static org.eclipse.swt.graphics.Image REMOVE  
      private static org.eclipse.swt.graphics.Image UNCHECKED  
      private static org.eclipse.swt.graphics.Image UNFROZEN  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract ColumnType columType​(int columnIndex)
      Matching the given column index to the correct column type.
      org.eclipse.swt.graphics.Color getBackground​(java.lang.Object element)  
      org.eclipse.swt.graphics.Image getColumnImage​(java.lang.Object element, int columnIndex)  
      java.lang.String getColumnText​(java.lang.Object element, int columnIndex)  
      protected GUIConfiguration getConfiguration()
      Getter of the configuration edited by the related editor.
      org.eclipse.swt.graphics.Color getForeground​(java.lang.Object element)  
      protected abstract org.eclipse.swt.graphics.Image getSpecializedColumnImage​(GUIVariable var, int columnIndex)
      This method is for extending the getColumnImage(Object, int) method.
      protected abstract java.lang.String getSpecializedColumnText​(GUIVariable var, int columnIndex)
      This method is for extending the getColumnText(Object, int) method.
      int getToolTipDisplayDelayTime​(java.lang.Object object)  
      org.eclipse.swt.graphics.Point getToolTipShift​(java.lang.Object object)  
      java.lang.String getToolTipText​(java.lang.Object element)  
      int getToolTipTimeDisplayed​(java.lang.Object object)  
      void update​(org.eclipse.jface.viewers.ViewerCell cell)  
      • Methods inherited from class org.eclipse.jface.viewers.CellLabelProvider

        dispose, getToolTipBackgroundColor, getToolTipFont, getToolTipForegroundColor, getToolTipImage, getToolTipStyle, initialize, useNativeToolTip
      • Methods inherited from class org.eclipse.jface.viewers.BaseLabelProvider

        addListener, dispose, fireLabelProviderChanged, isLabelProperty, removeListener
      • Methods inherited from class org.eclipse.core.commands.common.EventManager

        addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.jface.viewers.IBaseLabelProvider

        addListener, dispose, isLabelProperty, removeListener
    • Field Detail

      • ADD

        protected static final org.eclipse.swt.graphics.Image ADD
      • REMOVE

        protected static final org.eclipse.swt.graphics.Image REMOVE
      • UNCHECKED

        private static final org.eclipse.swt.graphics.Image UNCHECKED
      • ASSIGNED

        private static final org.eclipse.swt.graphics.Image ASSIGNED
      • NULL

        private static final org.eclipse.swt.graphics.Image NULL
      • CHECKED

        private static final org.eclipse.swt.graphics.Image CHECKED
      • UNFROZEN

        private static final org.eclipse.swt.graphics.Image UNFROZEN
      • ERROR_COLOR

        private static final org.eclipse.swt.graphics.Color ERROR_COLOR
      • NESTED_ELEMENT_COLOR

        private static final org.eclipse.swt.graphics.Color NESTED_ELEMENT_COLOR
    • Constructor Detail

      • AbstractConfigurationLabelProvider

        protected AbstractConfigurationLabelProvider​(GUIConfiguration config)
        Sole constructor for this class.
        Parameters:
        config - The configuration, which should be edited in the related editor of this label provider.
    • Method Detail

      • getConfiguration

        protected final GUIConfiguration getConfiguration()
        Getter of the configuration edited by the related editor.
        Returns:
        The configuration edited by this editor.
      • update

        public void update​(org.eclipse.jface.viewers.ViewerCell cell)
        Specified by:
        update in class org.eclipse.jface.viewers.CellLabelProvider
      • getColumnText

        public java.lang.String getColumnText​(java.lang.Object element,
                                              int columnIndex)
        Specified by:
        getColumnText in interface org.eclipse.jface.viewers.ITableLabelProvider
      • getForeground

        public org.eclipse.swt.graphics.Color getForeground​(java.lang.Object element)
        Specified by:
        getForeground in interface org.eclipse.jface.viewers.IColorProvider
      • getBackground

        public org.eclipse.swt.graphics.Color getBackground​(java.lang.Object element)
        Specified by:
        getBackground in interface org.eclipse.jface.viewers.IColorProvider
      • getColumnImage

        public org.eclipse.swt.graphics.Image getColumnImage​(java.lang.Object element,
                                                             int columnIndex)
        Specified by:
        getColumnImage in interface org.eclipse.jface.viewers.ITableLabelProvider
      • columType

        protected abstract ColumnType columType​(int columnIndex)
        Matching the given column index to the correct column type.
        Parameters:
        columnIndex - The current column index of the current cell.
        Returns:
        The correct column type according to the given index.
      • getSpecializedColumnText

        protected abstract java.lang.String getSpecializedColumnText​(GUIVariable var,
                                                                     int columnIndex)
        This method is for extending the getColumnText(Object, int) method.
        Parameters:
        var - the GUIVariable represented by the entire row
        columnIndex - the zero-based index of the column in which the label appears
        Returns:
        String or or null if there is no text for the given object at columnIndex
      • getSpecializedColumnImage

        protected abstract org.eclipse.swt.graphics.Image getSpecializedColumnImage​(GUIVariable var,
                                                                                    int columnIndex)
        This method is for extending the getColumnImage(Object, int) method.
        Parameters:
        var - the GUIVariable represented by the entire row
        columnIndex - the zero-based index of the column in which the label appears
        Returns:
        An Image or or null if there is no Image for the given object at columnIndex
      • getToolTipText

        public java.lang.String getToolTipText​(java.lang.Object element)
        Specified by:
        getToolTipText in interface org.eclipse.jface.viewers.IToolTipProvider
        Overrides:
        getToolTipText in class org.eclipse.jface.viewers.CellLabelProvider
      • getToolTipShift

        public org.eclipse.swt.graphics.Point getToolTipShift​(java.lang.Object object)
        Overrides:
        getToolTipShift in class org.eclipse.jface.viewers.CellLabelProvider
      • getToolTipDisplayDelayTime

        public int getToolTipDisplayDelayTime​(java.lang.Object object)
        Overrides:
        getToolTipDisplayDelayTime in class org.eclipse.jface.viewers.CellLabelProvider
      • getToolTipTimeDisplayed

        public int getToolTipTimeDisplayed​(java.lang.Object object)
        Overrides:
        getToolTipTimeDisplayed in class org.eclipse.jface.viewers.CellLabelProvider