Class ColorPicker

  • All Implemented Interfaces:
    org.eclipse.swt.graphics.Drawable

    public class ColorPicker
    extends org.eclipse.swt.custom.CLabel
    A button that displays a solid block of color and allows the user to pick a color. The user can double click on the button in order to change the selected color which also changes the background color of the button.
    • Field Summary

      • Fields inherited from class org.eclipse.swt.widgets.Control

        handle
    • Constructor Summary

      Constructors 
      Constructor Description
      ColorPicker​(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.graphics.Color originalColor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()  
      org.eclipse.swt.graphics.Color getSelectedColor()  
      void setSelectedColor​(org.eclipse.swt.graphics.Color backgroundColor)
      Set the current selected color that will be displayed by the picker.
      • Methods inherited from class org.eclipse.swt.custom.CLabel

        computeSize, getAlignment, getBottomMargin, getImage, getLeftMargin, getRightMargin, getStyle, getText, getToolTipText, getTopMargin, setAlignment, setBackground, setBackground, setBackground, setBackground, setBottomMargin, setFont, setImage, setLeftMargin, setMargins, setRightMargin, setText, setToolTipText, setTopMargin, shortenText
      • Methods inherited from class org.eclipse.swt.widgets.Canvas

        drawBackground, getCaret, getIME, scroll, setCaret, setIME
      • Methods inherited from class org.eclipse.swt.widgets.Composite

        changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
      • Methods inherited from class org.eclipse.swt.widgets.Scrollable

        computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
      • Methods inherited from class org.eclipse.swt.widgets.Control

        addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
      • Methods inherited from class org.eclipse.swt.widgets.Widget

        addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
      • Methods inherited from interface org.eclipse.swt.graphics.Drawable

        isAutoScalable
    • Constructor Detail

      • ColorPicker

        public ColorPicker​(org.eclipse.swt.widgets.Composite parent,
                           org.eclipse.swt.graphics.Color originalColor)
    • Method Detail

      • getSelectedColor

        public org.eclipse.swt.graphics.Color getSelectedColor()
        Returns:
        the Color most recently selected by the user. Note that it is the responsibility of the client to dispose this resource
      • setSelectedColor

        public void setSelectedColor​(org.eclipse.swt.graphics.Color backgroundColor)
        Set the current selected color that will be displayed by the picker. Note that this class is not responsible for destroying the given Color object. It does not take ownership. Instead it will create its own internal copy of the given Color resource.
        Parameters:
        backgroundColor -
      • dispose

        public void dispose()
        Overrides:
        dispose in class org.eclipse.swt.widgets.Widget