Class DefinedButton

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

    public class DefinedButton
    extends org.eclipse.swt.widgets.Composite
    The clear-button.
    Author:
    Christopher Mindus
    • Field Summary

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

        handle
    • Constructor Summary

      Constructors 
      ConstructorDescription
      DefinedButton​(MultiPropLabel multiLabel, PropertyEditor resizer, org.eclipse.swt.widgets.Composite parent, boolean hideDefineButton)
      Create the clear button.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      org.eclipse.swt.graphics.PointcomputeSize​(int wHint, int hHint, boolean changed)
      Size is always 18x16 for others.
      intgetErrorLevel()
      Gets the error level.
      PropLabelgetLabel()
      Gets the label attached, perhaps null.
      PropertyEditor.NodegetNode()
      Gets the node.
      booleanisDefined()
      Gets the defined state.
      booleanisExtended()
      Checks if extended.
      booleanisMainMultiPropExpanded()
      Checks if the main multi-prop item is expanded.
      voidonExpand​(boolean isExpanded)
      Called when main multi-prop item is expanded or collapsed.
      voidrefreshExtended()
      Refreshes the extended state.
      voidregisterPropLabel​(IPropertyEditorController controller, PropLabel label, PropertyEditor.Node node)
      Registers a property and label.
      voidsetDefined​(int errorLevel)
      Sets the state of the button: defined and error level.
      voidsetDefinedError()
      Sets the state of the button: defined and error.
      voidsetDefinedOK()
      Sets the state of the button: defined and no error.
      voidsetLabelBackground​(org.eclipse.swt.graphics.Color c)
      Sets the label background.
      voidsetListener​(IPropertyDefined l)
      Sets a listener, can only be done once.
      voidsetUndefined​(int errorLevel)
      Sets the state of the button: undefined with potential severity.
      • 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, getToolTipText, 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, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
      • Methods inherited from class org.eclipse.swt.widgets.Widget

        addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.swt.graphics.Drawable

        isAutoScalable
    • Constructor Detail

      • DefinedButton

        public DefinedButton​(MultiPropLabel multiLabel,
                             PropertyEditor resizer,
                             org.eclipse.swt.widgets.Composite parent,
                             boolean hideDefineButton)
        Create the clear button.
    • Method Detail

      • setLabelBackground

        public void setLabelBackground​(org.eclipse.swt.graphics.Color c)
        Sets the label background.
      • setListener

        public void setListener​(IPropertyDefined l)
        Sets a listener, can only be done once.
      • getLabel

        public PropLabel getLabel()
        Gets the label attached, perhaps null.
      • refreshExtended

        public void refreshExtended()
        Refreshes the extended state.
      • isExtended

        public boolean isExtended()
        Checks if extended.
      • setUndefined

        public void setUndefined​(int errorLevel)
        Sets the state of the button: undefined with potential severity.
        Parameters:
        errorLevel - The error level, -1 or 0 for OK, 1=warning, 2=error.
      • setDefinedOK

        public void setDefinedOK()
        Sets the state of the button: defined and no error.
      • setDefinedError

        public void setDefinedError()
        Sets the state of the button: defined and error.
      • setDefined

        public void setDefined​(int errorLevel)
        Sets the state of the button: defined and error level.
        Parameters:
        errorLevel - 0=OK, 1=warning, 2=error.
      • isDefined

        public boolean isDefined()
        Gets the defined state.
      • getErrorLevel

        public int getErrorLevel()
        Gets the error level.
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize​(int wHint,
                                                          int hHint,
                                                          boolean changed)
        Size is always 18x16 for others.
        Overrides:
        computeSize in class org.eclipse.swt.widgets.Control
      • isMainMultiPropExpanded

        public boolean isMainMultiPropExpanded()
        Checks if the main multi-prop item is expanded.
      • onExpand

        public void onExpand​(boolean isExpanded)
        Called when main multi-prop item is expanded or collapsed.