Class LightImageCombo

    • Constructor Detail

      • LightImageCombo

        public LightImageCombo()
        Instantiates a new light image combo.
    • Method Detail

      • getText

        public String getText()
        Returns image combo text.
        Returns:
        image combo text, cannot be null.
      • setText

        public void setText​(String text)
        Sets this image combo text.
        Parameters:
        text - the text to set.
      • isGrayed

        public boolean isGrayed()
        This image combo grayed state.
        Returns:
        true if grayed, false if not.
      • setGrayed

        public void setGrayed​(boolean grayed)
        Sets the grayed state of this image combo.
        Parameters:
        grayed - true if grayed, false if not.
      • getBorderColor

        public org.eclipse.swt.graphics.Color getBorderColor()
        Returns image combo border color.
        Returns:
        image combo border color, can be null.
      • getBackgroundColor

        public org.eclipse.swt.graphics.Color getBackgroundColor()
        Returns image combo background color.
        Returns:
        image combo background color, can be null.
      • setBorderColor

        public void setBorderColor​(org.eclipse.swt.graphics.Color borderColor)
        Sets the border color.
        Parameters:
        borderColor - the new border color.
      • setBackgroundColor

        public void setBackgroundColor​(org.eclipse.swt.graphics.Color backgroundColor)
        Sets the background color.
        Parameters:
        backgroundColor - the new background color.
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize​(org.eclipse.swt.graphics.GC gc,
                                                          int width,
                                                          int height,
                                                          boolean flushCache)
        Description copied from interface: ILightControl
        Computes the size of this control.
        Specified by:
        computeSize in interface ILightControl
        Overrides:
        computeSize in class AbstractLightControl
        Parameters:
        gc - the GC to do measurements with.
        width - the width hint, SWT.DEFAULT to compute the preferred width.
        height - the height hint, SWT.DEFAULT to compute the preferred height.
        flushCache - the flush cache flag, instructs the associated layout to reset all its caches, if any.
        Returns:
        the computed size.
      • paint

        public void paint​(org.eclipse.swt.graphics.GC gc,
                          org.eclipse.swt.graphics.Rectangle rectangle)
        Description copied from interface: ILightControl
        Paints the given rectangle of this control.
        Specified by:
        paint in interface ILightControl
        Parameters:
        gc - the GC to paint on.
        rectangle - the rectangle to paint.
      • setEditable

        public void setEditable​(boolean isEditable)
        Description copied from interface: IEditable
        Sets control editable state.
        Specified by:
        setEditable in interface IEditable
        Parameters:
        isEditable - - true if control can be edited.
      • isEditable

        public boolean isEditable()
        Description copied from interface: IEditable
        Returns control editable state.
        Specified by:
        isEditable in interface IEditable
        Returns:
        true if control can be edited.
      • addItem

        public void addItem​(LightImageCombo.Item item,
                            int index)
        Adds the item to this combo.
        Parameters:
        item - the item to add, cannot be null
        index - the item index.
      • addItem

        public void addItem​(LightImageCombo.Item item)
        Appends the item to this combo.
        Parameters:
        item - the item to append, cannot be null
      • setItem

        public void setItem​(int index,
                            LightImageCombo.Item item)
        Sets the item at the specified index.
        Parameters:
        index - the index of the item.
        item - the new item, cannot be null
      • getSelectionIndex

        public int getSelectionIndex()
        Gets the selection index.
        Returns:
        the selection index or -1 if nothing selected.
      • getItemCount

        public int getItemCount()
        Gets the item count.
        Returns:
        the item count.
      • setItems

        public void setItems​(LightImageCombo.Item[] items)
        Sets all the items.
        Parameters:
        items - the new items.
      • removeAllItems

        public void removeAllItems()
        Removes all items from this combo.
      • removeItem

        public void removeItem​(int index)
        Removes the item at the specified index.
        Parameters:
        index - the index.
      • selectItem

        public void selectItem​(int index)
        Selects the item at the given index.
        Parameters:
        index - the index of item to select.
      • deselectAll

        public void deselectAll()
        Clears the item selection.
      • addSelectionIndexListener

        public void addSelectionIndexListener​(IChangedListener<LightImageCombo,​Integer> listener)
        Adds the selection index listener.
        Parameters:
        listener - the listener to add, cannot be null
      • removeSelectionIndexListener

        public void removeSelectionIndexListener​(IChangedListener<LightImageCombo,​Integer> listener)
        Removes the selection index listener.
        Parameters:
        listener - the listener to remove, cannot be null
      • toggleDropdown

        public void toggleDropdown​(boolean visible)
        Displays or hides the drop-down list.
        Parameters:
        visible - true to show / refresh the drop-down, false to hide it.