Class BaseCombo

  • All Implemented Interfaces:
    org.eclipse.swt.graphics.Drawable
    Direct Known Subclasses:
    CDateTime

    public abstract class BaseCombo
    extends org.eclipse.swt.widgets.Canvas
    The AbstractCombo is an abstract class which provides the basic functionality for a button with a DROP_DOWN, or "popup", shell component. When the user selects the button the shell is set visible and the SWT Components which have been placed on the "content" Composite will be shown.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  BaseCombo.DropComboLayout
      Special layout implementation to position the combo's drop-down Button within its Text.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected VButton button
      The Button widget of a DROP_DOWN style combo.
      protected static int BUTTON_ALWAYS
      A constant indicating that the drop down button is always visible.
      protected static int BUTTON_AUTO
      A constant indicating that the drop down button is visible when the text box has the focus, and is hidden otherwise.
      protected static int BUTTON_NEVER
      A constant indicating that the drop down button is never visible.
      protected static int BUTTON_ONLY
      A style constant indicating that this combo will only have a drop down button, rather than a button and a text box.
      (package private) boolean buttonActive
      boolean to disable button on open state.
      private int buttonVisibility  
      private org.eclipse.swt.widgets.Listener buttonVisibilityListener  
      protected static boolean carbon
      true if the platform is carbon, false otherwise
      private org.eclipse.swt.widgets.Listener comboListener  
      protected org.eclipse.swt.widgets.Control content
      The widget contents of the popup Shell in a DROP_DOWN combo or the full contents of a SIMPLE combo.
      protected org.eclipse.swt.widgets.Shell contentShell
      The popup Shell widget of a DROP_DOWN style combo.
      protected boolean defaultButtonImage
      True if a default image should be used for the button; false otherwise - as is the case when an image is set using setButtonImage(Image)
      private org.eclipse.swt.widgets.Listener disposeListener  
      private boolean dropDown  
      protected static boolean gtk
      true if the platform is gtk, false otherwise
      private boolean holdOpen  
      protected boolean leftAlign
      Flag to indicate that this combo's BUTTON should be displayed on the left side of its Text.
      private boolean open  
      protected VPanel panel
      The VPanel that is the base of this widget.
      private VControl positionControl  
      private org.eclipse.swt.widgets.Listener shellListener  
      protected boolean simple
      Flag to indicate that this is a SIMPLE style combo.
      private VControl stretchControl  
      protected int style
      The style bits requested.
      protected VNative<org.eclipse.swt.widgets.Text> text
      The Text widget of a DROP_DOWN style combo.
      private org.eclipse.swt.widgets.Listener textListener  
      protected static int textMarginHeight
      A constant value used to pad the computed height for this widget, so that the combo's Button will fit without clipping its top and bottom borders.
      protected static boolean win32
      true if the platform is win32, false otherwise
      • Fields inherited from class org.eclipse.swt.widgets.Composite

        embeddedHandle
      • Fields inherited from class org.eclipse.swt.widgets.Widget

        handle
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseCombo​(org.eclipse.swt.widgets.Composite parent, int style)
      Main constructor -- must be called by all subclasses in their own constructors.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addKeyListener​(org.eclipse.swt.events.KeyListener listener)
      Adds the listener to the collection of listeners who will be notified when keys are pressed and released on the system keyboard, by sending it one of the messages defined in the KeyListener interface.
      void addModifyListener​(org.eclipse.swt.events.ModifyListener listener)
      Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by sending it one of the messages defined in the ModifyListener interface.
      Note that this is NOT the correct way to listen for changes in the underlying model for the combo.
      private void addTextListener()  
      void addTraverseListener​(org.eclipse.swt.events.TraverseListener listener)
      Adds the listener to the collection of listeners who will be notified when traversal events occur, by sending it one of the messages defined in the TraverseListener interface.
      protected boolean checkButton()  
      protected boolean checkContent()  
      protected boolean checkContentShell()  
      private static int checkStyle​(int style)  
      protected boolean checkText()  
      protected static boolean containsControl​(org.eclipse.swt.widgets.Control control, org.eclipse.swt.widgets.Composite composite)
      A recursive method to find out if a composite is an ancestor of a control.
      private void createButton​(int style)  
      private void createContentShell()  
      private void createText​(int style)  
      protected void doSetButtonImage​(org.eclipse.swt.graphics.Image image)  
      protected org.eclipse.swt.widgets.Control getContent()  
      protected org.eclipse.swt.widgets.Shell getContentShell()  
      boolean getEditable()
      Returns the editable state.
      boolean getEnabled()
      Fixes bug 181442: [CDateTime] Incorrect getEnabled()
      protected boolean getHoldOpen()  
      org.eclipse.swt.widgets.Menu getMenu()
      returns the menu for this combo
      protected VControl getStretchControl()  
      int getStyle()  
      java.lang.String getText()
      Returns the text of this combo
      private void init​(int style)  
      protected boolean isDropDown()  
      boolean isOpen()  
      protected boolean isRTL()  
      protected boolean isSimple()  
      protected void postClose​(org.eclipse.swt.widgets.Shell popup)
      called just after the content shell is set not-visible and has "closed"
      protected void postOpen​(org.eclipse.swt.widgets.Shell popup)
      called after the content shell is set visible and has "opened"
      protected void preClose​(org.eclipse.swt.widgets.Shell popup)
      called just before the content shell is set not-visible and "closes"
      protected void preOpen​(org.eclipse.swt.widgets.Shell popup)
      called just before the content shell is set visible and "opens"
      void removeKeyListener​(org.eclipse.swt.events.KeyListener listener)
      Removes the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.
      void removeModifyListener​(org.eclipse.swt.events.ModifyListener listener)
      Removes the listener from the collection of listeners who will be notified when the receiver's text is modified.
      private void removeTextListener()  
      void removeTraverseListener​(org.eclipse.swt.events.TraverseListener listener)
      Removes the listener from the collection of listeners who will be notified when traversal events occur.
      void setBackground​(org.eclipse.swt.graphics.Color color)  
      protected void setButtonAlignment​(int alignment)
      Set the alignment of the button in relation to the text box.
      protected void setButtonImage​(org.eclipse.swt.graphics.Image image)
      Set the custom image for the drop down button.
      protected void setButtonText​(java.lang.String text)
      Set the text for the drop down button.
      protected void setButtonVisibility​(int visibility)
      Set the visibility style of the drop button.
      protected void setButtonVisible​(boolean visible)
      Set the visible state of the button
      protected void setContent​(org.eclipse.swt.widgets.Control content)
      set the content of the popup shell
      protected abstract boolean setContentFocus()
      Called when the popup shell has been open, this method provides a location for subclasses to set the focus to the content.
      void setEditable​(boolean editable)
      Sets the editable state.
      void setEnabled​(boolean enabled)  
      boolean setFocus()  
      void setFont​(org.eclipse.swt.graphics.Font font)  
      void setForeground​(org.eclipse.swt.graphics.Color color)  
      protected void setHoldOpen​(boolean holdOpen)
      if holdOpen is true, the popup shell will not close regardless of events and/or calls to popUp(false) until holdOpen is first set false
      void setMenu​(org.eclipse.swt.widgets.Menu menu)
      Sets the menu for the Text widget of this DropCombo
      protected void setModifyEventProperties​(org.eclipse.swt.widgets.Event e)
      Provides a chance for subclasses to set the properties of the modify event called when the text is modified.
      protected void setOpen​(boolean open)
      Convenience method for BaseCombo:setOpen(boolean, Runnable), omitting optional runnable.
      protected void setOpen​(boolean open, java.lang.Runnable callback)
      If 'open' is true, then open the popup shell (time/date picker) (set to visible)
      If 'open' is false, close the popup shell (set to not visible)
      If content == null or isOpen() == open this method simply returns.
      If contentShell == null then contentShell will be created.
      protected void setPositionControl​(VControl positionControl)
      sets the control to which the popup will align itself
      protected void setStretch​(boolean stretch)
      If stretch is false, then the width of the popup will be set to its preferred width (via computeSize(SWT.DEFAULT, SWT.DEFAULT))
      void setToolTipText​(java.lang.String tooltip)
      Sets the tooltip on the text and button parts of this Composite widget.
      • 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, 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, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getFont, getForeground, getLayoutData, getLocation, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setLayoutData, setLocation, setLocation, 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, dispose, getData, getData, getDisplay, getListeners, 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
    • Field Detail

      • carbon

        protected static final boolean carbon
        true if the platform is carbon, false otherwise
      • gtk

        protected static final boolean gtk
        true if the platform is gtk, false otherwise
      • win32

        protected static final boolean win32
        true if the platform is win32, false otherwise
      • textMarginHeight

        protected static final int textMarginHeight
        A constant value used to pad the computed height for this widget, so that the combo's Button will fit without clipping its top and bottom borders.
      • BUTTON_ONLY

        protected static final int BUTTON_ONLY
        A style constant indicating that this combo will only have a drop down button, rather than a button and a text box.
        See Also:
        Constant Field Values
      • BUTTON_AUTO

        protected static final int BUTTON_AUTO
        A constant indicating that the drop down button is visible when the text box has the focus, and is hidden otherwise. Valid only when style is DROP_DOWN.
        See Also:
        BUTTON_ALWAYS, BUTTON_NEVER, Constant Field Values
      • buttonActive

        boolean buttonActive
        boolean to disable button on open state.
      • panel

        protected VPanel panel
        The VPanel that is the base of this widget. If the style is SIMPLE, this panel will be the base of the content area, otherwise, it is the base of the text/button area.
      • button

        protected VButton button
        The Button widget of a DROP_DOWN style combo. This value may be null -- protect all references to this field with the checkButton() method.
      • defaultButtonImage

        protected boolean defaultButtonImage
        True if a default image should be used for the button; false otherwise - as is the case when an image is set using setButtonImage(Image)
        See Also:
        setButtonImage(Image)
      • text

        protected VNative<org.eclipse.swt.widgets.Text> text
        The Text widget of a DROP_DOWN style combo. This value may be null -- protect all references to this field with the checkText() method.
      • contentShell

        protected org.eclipse.swt.widgets.Shell contentShell
        The popup Shell widget of a DROP_DOWN style combo. This value may be null -- protect all references to this field with the checkContentShell() method.
      • content

        protected org.eclipse.swt.widgets.Control content
        The widget contents of the popup Shell in a DROP_DOWN combo or the full contents of a SIMPLE combo. This value may be null -- protect all references to this field with the checkContent() method.
      • style

        protected int style
        The style bits requested. NOTE: this may not match the value returned by getStyle() if invalid bits were requested.
      • simple

        protected boolean simple
        Flag to indicate that this is a SIMPLE style combo.
      • leftAlign

        protected boolean leftAlign
        Flag to indicate that this combo's BUTTON should be displayed on the left side of its Text.
      • buttonVisibility

        private int buttonVisibility
      • buttonVisibilityListener

        private org.eclipse.swt.widgets.Listener buttonVisibilityListener
      • dropDown

        private boolean dropDown
      • open

        private boolean open
      • holdOpen

        private boolean holdOpen
      • positionControl

        private VControl positionControl
      • stretchControl

        private VControl stretchControl
      • textListener

        private org.eclipse.swt.widgets.Listener textListener
      • shellListener

        private org.eclipse.swt.widgets.Listener shellListener
      • comboListener

        private org.eclipse.swt.widgets.Listener comboListener
      • disposeListener

        private org.eclipse.swt.widgets.Listener disposeListener
    • Constructor Detail

      • BaseCombo

        public BaseCombo​(org.eclipse.swt.widgets.Composite parent,
                         int style)
        Main constructor -- must be called by all subclasses in their own constructors.

        SWT.TOGGLE, SWT.PUSH, SWT.ARROW, SWT.FLAT, SWT.TRAIL, SWT.LEAD, SWT.BORDER, SWT.SIMPLE, SWT.DROP_DOWN

        Parameters:
        parent - the visual parent of this widget
        style - the requested SWT style bitmask for this widget
    • Method Detail

      • checkStyle

        private static int checkStyle​(int style)
      • containsControl

        protected static boolean containsControl​(org.eclipse.swt.widgets.Control control,
                                                 org.eclipse.swt.widgets.Composite composite)
        A recursive method to find out if a composite is an ancestor of a control.
        Parameters:
        control -
        composite -
        Returns:
        true if the composite is an ancestor, false otherwise.
      • addKeyListener

        public void addKeyListener​(org.eclipse.swt.events.KeyListener listener)
        Adds the listener to the collection of listeners who will be notified when keys are pressed and released on the system keyboard, by sending it one of the messages defined in the KeyListener interface.

        When a key listener is added to a control, the control will take part in widget traversal. By default, all traversal keys (such as the tab key and so on) are delivered to the control. In order for a control to take part in traversal, it should listen for traversal events. Otherwise, the user can traverse into a control but not out. Note that native controls such as table and tree implement key traversal in the operating system. It is not necessary to add traversal listeners for these controls, unless you want to override the default traversal.

        Overrides:
        addKeyListener in class org.eclipse.swt.widgets.Control
        Parameters:
        listener - the listener which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the listener is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
        See Also:
        KeyListener, removeKeyListener(org.eclipse.swt.events.KeyListener)
      • addModifyListener

        public void addModifyListener​(org.eclipse.swt.events.ModifyListener listener)
        Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by sending it one of the messages defined in the ModifyListener interface.
        Note that this is NOT the correct way to listen for changes in the underlying model for the combo. This should be provided by some other mechanism, such as a SelectionListener.
        Parameters:
        listener - the listener which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the listener is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
        See Also:
        ModifyListener, removeModifyListener(org.eclipse.swt.events.ModifyListener)
      • addTextListener

        private void addTextListener()
      • addTraverseListener

        public void addTraverseListener​(org.eclipse.swt.events.TraverseListener listener)
        Adds the listener to the collection of listeners who will be notified when traversal events occur, by sending it one of the messages defined in the TraverseListener interface.
        Overrides:
        addTraverseListener in class org.eclipse.swt.widgets.Control
        Parameters:
        listener - the listener which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the listener is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
        See Also:
        TraverseListener, removeTraverseListener(org.eclipse.swt.events.TraverseListener)
      • checkButton

        protected boolean checkButton()
        Returns:
        true if the button field is in a fit state to be used
      • checkContent

        protected boolean checkContent()
        Returns:
        true if the content field is in a fit state to be used
      • checkContentShell

        protected boolean checkContentShell()
        Returns:
        true if the contentShell field is in a fit state to be used
      • checkText

        protected boolean checkText()
        Returns:
        true if the text field is in a fit state to be used
      • createButton

        private void createButton​(int style)
      • createContentShell

        private void createContentShell()
      • createText

        private void createText​(int style)
      • doSetButtonImage

        protected final void doSetButtonImage​(org.eclipse.swt.graphics.Image image)
        Parameters:
        image -
      • getContent

        protected org.eclipse.swt.widgets.Control getContent()
        Returns:
        the Control that was set as this popup shell's content with setContent(Control)
      • getContentShell

        protected org.eclipse.swt.widgets.Shell getContentShell()
        Returns:
        the content shell
      • getEditable

        public boolean getEditable()
        Returns the editable state.
        Returns:
        whether or not the receiver is editable
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getEnabled

        public boolean getEnabled()
        Fixes bug 181442: [CDateTime] Incorrect getEnabled()
        Overrides:
        getEnabled in class org.eclipse.swt.widgets.Control
      • getHoldOpen

        protected boolean getHoldOpen()
        Returns:
        the state of the holdOpen flag
      • getMenu

        public org.eclipse.swt.widgets.Menu getMenu()
        returns the menu for this combo
        Overrides:
        getMenu in class org.eclipse.swt.widgets.Control
      • getStretchControl

        protected VControl getStretchControl()
        Returns:
        the stretch control
      • getStyle

        public int getStyle()
        Overrides:
        getStyle in class org.eclipse.swt.widgets.Widget
      • getText

        public java.lang.String getText()
        Returns the text of this combo
        Returns:
        the combo's text
      • init

        private void init​(int style)
      • isDropDown

        protected boolean isDropDown()
        Returns:
        true if style is CDT.DROP_DOWN
      • isOpen

        public boolean isOpen()
        Returns:
        the state of the popup shell's visibility
      • isRTL

        protected boolean isRTL()
        Returns:
        if Shell style is SWT.RIGHT_TO_LEFT
      • isSimple

        protected boolean isSimple()
        Returns:
        if style is CDT.SIMPLE
      • postClose

        protected void postClose​(org.eclipse.swt.widgets.Shell popup)
        called just after the content shell is set not-visible and has "closed"

        override if you want to do something with the shell just after becoming not visible

        Parameters:
        popup -
        See Also:
        preClose(Shell)
      • postOpen

        protected void postOpen​(org.eclipse.swt.widgets.Shell popup)
        called after the content shell is set visible and has "opened"

        override if you want to do something with the shell just after becoming visible

        Parameters:
        popup -
        See Also:
        preOpen(Shell)
      • preClose

        protected void preClose​(org.eclipse.swt.widgets.Shell popup)
        called just before the content shell is set not-visible and "closes"

        override if you want to do something with the shell prior to it becoming not visible

        Parameters:
        popup -
        See Also:
        postClose(Shell)
      • preOpen

        protected void preOpen​(org.eclipse.swt.widgets.Shell popup)
        called just before the content shell is set visible and "opens"

        override if you want to do something with the shell prior to it becoming visible

        Parameters:
        popup -
        See Also:
        postOpen(Shell)
      • removeKeyListener

        public void removeKeyListener​(org.eclipse.swt.events.KeyListener listener)
        Removes the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.
        Overrides:
        removeKeyListener in class org.eclipse.swt.widgets.Control
        Parameters:
        listener - the listener which should no longer be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the listener is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
        See Also:
        KeyListener, addKeyListener(org.eclipse.swt.events.KeyListener)
      • removeModifyListener

        public void removeModifyListener​(org.eclipse.swt.events.ModifyListener listener)
        Removes the listener from the collection of listeners who will be notified when the receiver's text is modified.
        Parameters:
        listener - the listener which should no longer be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the listener is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
        See Also:
        ModifyListener, addModifyListener(org.eclipse.swt.events.ModifyListener)
      • removeTextListener

        private void removeTextListener()
      • removeTraverseListener

        public void removeTraverseListener​(org.eclipse.swt.events.TraverseListener listener)
        Removes the listener from the collection of listeners who will be notified when traversal events occur.
        Overrides:
        removeTraverseListener in class org.eclipse.swt.widgets.Control
        Parameters:
        listener - the listener which should no longer be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the listener is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
        See Also:
        TraverseListener, addTraverseListener(org.eclipse.swt.events.TraverseListener)
      • setButtonAlignment

        protected void setButtonAlignment​(int alignment)
        Set the alignment of the button in relation to the text box. Only valid if style is DROP_DOWN.
        Parameters:
        alignment - can be either SWT.LEFT or SWT.RIGHT. Other values have no effect.
      • setButtonImage

        protected void setButtonImage​(org.eclipse.swt.graphics.Image image)
        Set the custom image for the drop down button. Only valid if style is DROP_DOWN. Passing null in will set the image to its default value.
        Parameters:
        image -
      • setButtonText

        protected void setButtonText​(java.lang.String text)
        Set the text for the drop down button. Only valid if style is DROP_DOWN. Passing null will clear the text.
        Parameters:
        text -
      • setButtonVisibility

        protected void setButtonVisibility​(int visibility)
        Set the visibility style of the drop button.

        The style will be forced to NEVER if the contents are null

        Styles:
        BUTTON_ALWAYS, BUTTON_AUTO, BUTTON_MANUAL, BUTTON_NEVER
        Style BUTTON_ALWAYS:
        Button will always be shown - standard SWT.DROP_DOWN behaviour. The method setButtonVisible(boolean) has no affect with this style set
        Style BUTTON_AUTO:
        Button visibility will be handled automatically through focus events, popup events, as well as programmatically
        Style BUTTON_MANUAL:
        Button visibility will only be handled programmatically
        Style BUTTON_NEVER:
        Button will never be shown - standard SWT.SIMPLE behaviour. The method setButtonVisible(boolean) has no affect with this style set
        Parameters:
        visibility - the visibility style constant
        See Also:
        setButtonVisible(boolean)
      • setButtonVisible

        protected void setButtonVisible​(boolean visible)
        Set the visible state of the button

        Note: This method is only useful when the button's visibility style is either AUTO or MANUAL.

        Parameters:
        visible -
        See Also:
        setButtonVisibility(int)
      • setContent

        protected void setContent​(org.eclipse.swt.widgets.Control content)
        set the content of the popup shell

        Can be a single control, or a Composite consisting of many controls

        Parameters:
        content -
      • setContentFocus

        protected abstract boolean setContentFocus()
        Called when the popup shell has been open, this method provides a location for subclasses to set the focus to the content.
        Returns:
        true if the focus was set, false otherwise
      • setEditable

        public void setEditable​(boolean editable)
        Sets the editable state.
        Parameters:
        editable - the new editable state
      • setEnabled

        public void setEnabled​(boolean enabled)
        Overrides:
        setEnabled in class org.eclipse.swt.widgets.Control
      • setFocus

        public boolean setFocus()
        Overrides:
        setFocus in class org.eclipse.swt.widgets.Composite
      • setFont

        public void setFont​(org.eclipse.swt.graphics.Font font)
        Overrides:
        setFont in class org.eclipse.swt.widgets.Canvas
        See Also:
        Canvas.setFont(org.eclipse.swt.graphics.Font)
      • setBackground

        public void setBackground​(org.eclipse.swt.graphics.Color color)
        Overrides:
        setBackground in class org.eclipse.swt.widgets.Control
        See Also:
        Control.setBackground(org.eclipse.swt.graphics.Color)
      • setForeground

        public void setForeground​(org.eclipse.swt.graphics.Color color)
        Overrides:
        setForeground in class org.eclipse.swt.widgets.Control
        See Also:
        Control.setForeground(org.eclipse.swt.graphics.Color)
      • setHoldOpen

        protected void setHoldOpen​(boolean holdOpen)
        if holdOpen is true, the popup shell will not close regardless of events and/or calls to popUp(false) until holdOpen is first set false

        merely sets the holdOpen flag, does not change popup visibility state

        Parameters:
        holdOpen -
      • setMenu

        public void setMenu​(org.eclipse.swt.widgets.Menu menu)
        Sets the menu for the Text widget of this DropCombo

        Note that setting the menu to null causes the native menu to be used

        If the intent is to disable the menu, then set it to a blank menu

        Overrides:
        setMenu in class org.eclipse.swt.widgets.Control
      • setModifyEventProperties

        protected void setModifyEventProperties​(org.eclipse.swt.widgets.Event e)
        Provides a chance for subclasses to set the properties of the modify event called when the text is modified. Not valid if style is SIMPLE.

        For example, CDateTime overrides this method to set the data field to the current time:
        e.data = calendar.getTime();

        Parameters:
        e -
      • setOpen

        protected void setOpen​(boolean open)
        Convenience method for BaseCombo:setOpen(boolean, Runnable), omitting optional runnable.
        Parameters:
        open - true to open the popup (date/time picker) shell, false to close it.

        See Also:
        setOpen(boolean, Runnable)
      • setOpen

        protected void setOpen​(boolean open,
                               java.lang.Runnable callback)
        If 'open' is true, then open the popup shell (time/date picker) (set to visible)
        If 'open' is false, close the popup shell (set to not visible)
        If content == null or isOpen() == open this method simply returns.
        If contentShell == null then contentShell will be created.
        Parameters:
        open - true to open the popup (date/time picker) shell, false to close it.
        callback - an optional runnable to be run when the operation completes.

        See Also:
        setOpen(boolean)
      • setPositionControl

        protected void setPositionControl​(VControl positionControl)
        sets the control to which the popup will align itself

        the control does not necessarily need to be "this" or the button, but will default to "this" if positionControl == null

        Parameters:
        positionControl -
      • setStretch

        protected void setStretch​(boolean stretch)
        If stretch is false, then the width of the popup will be set to its preferred width (via computeSize(SWT.DEFAULT, SWT.DEFAULT))

        However, if stretchControl is true, the width of the popup will be stretched to equal the width of this control (if, however, popup's preferred width is greater than this control's width popup will not be shrunk down)

        Parameters:
        stretch -
      • setToolTipText

        public void setToolTipText​(java.lang.String tooltip)
        Sets the tooltip on the text and button parts of this Composite widget.
        Overrides:
        setToolTipText in class org.eclipse.swt.widgets.Control
        Parameters:
        tooltip - the new tooltip text