Class AbstractCombo

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.nebula.widgets.datechooser.AbstractCombo
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
DateChooserCombo

public abstract class AbstractCombo
extends org.eclipse.swt.widgets.Composite
Abstract class for combo widgets composed of a Text, a Button and a popup associated to the button.

The creation of text, button and popup content is delegated to abstract methods.

Note that although this class is a subclass of Composite, it does not make sense to add children to it, or set a layout on it.

Styles:
BORDER, READ_ONLY, FLAT
Events:
Selection
  • Field Summary

    Fields 
    Modifier and Type Field Description
    (package private) org.eclipse.swt.widgets.Shell _shell
    The parent Shell
    protected org.eclipse.swt.widgets.Button button
    Button opening the popup
    protected boolean createOnDrop
    Flag indicating that the popup content must be created each time the combo is dropped
    protected org.eclipse.swt.widgets.Listener filter
    Listener for external events
    static boolean GTK
    GTK platform constant
    protected boolean hasFocus
    Flag indicating if the widget has focus or not
    protected org.eclipse.swt.widgets.Listener listener
    Listener for all internal events
    protected org.eclipse.swt.widgets.Shell popup
    Popup shell for the selection
    protected org.eclipse.swt.widgets.Control popupContent
    Content of the popup
    protected boolean showButtonOnFocus
    Flag to show button only if combo has the focus
    protected org.eclipse.swt.widgets.Text text
    Text widget for the input
    static boolean WIN32
    WIN32 platform constant

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

    handle
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractCombo​(org.eclipse.swt.widgets.Composite parent, int style)
    Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
  • Method Summary

    Modifier and Type Method Description
    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.
    void addSelectionListener​(org.eclipse.swt.events.SelectionListener listener)
    Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the SelectionListener interface.
    void addVerifyListener​(org.eclipse.swt.events.VerifyListener listener)
    Adds the listener to the collection of listeners who will be notified when the receiver's text is verified, by sending it one of the messages defined in the VerifyListener interface.
    protected void beforeDrop()
    Called just before the popup is dropped.
    protected void buttonEvent​(org.eclipse.swt.widgets.Event event)
    Manages button events.
    (package private) static int checkStyle​(int style)  
    protected void comboEvent​(org.eclipse.swt.widgets.Event event)
    Manages global combo events.
    protected void contentEvent​(org.eclipse.swt.widgets.Event event)
    Manages popup content events.
    void copy()
    Copies the selected text.
    protected org.eclipse.swt.widgets.Button createButtonControl​(int style)
    Creates the arrow button widget.
    protected void createPopup()
    Creates the popup that will be displayed when the button is selected.
    protected abstract org.eclipse.swt.widgets.Control createPopupContent​(org.eclipse.swt.widgets.Composite parent)
    Creates the popup content.
    protected org.eclipse.swt.widgets.Text createTextControl​(int style)
    Creates the text widget.
    void cut()
    Cuts the selected text.
    protected abstract boolean doSelection()
    This method is called when a SWT.Selection is notify in the popup content, allowing to update the Text widget content.
    protected void dropDown​(boolean drop)
    Manages drop down of the popup.
    boolean getEditable()
    Gets the editable state.
    boolean getPopupVisible()
    Returns true if the receiver's popup is visible, and false otherwise.
    org.eclipse.swt.graphics.Point getSelection()
    Returns a Point whose x coordinate is the start of the selection in the receiver's text field, and whose y coordinate is the end of the selection.
    org.eclipse.swt.widgets.Shell getShell()  
    int getStyle()
    Returns the receiver's style information.
    java.lang.String getText()
    Returns a string containing a copy of the contents of the receiver's text field.
    int getTextHeight()
    Returns the height of the receivers's text field.
    int getTextLimit()
    Returns the maximum number of characters that the receiver's text field is capable of holding.
    protected void handleFocus​(int type)
    Manages the focus on the combo.
    protected boolean isDropped()
    Returns true if popup is dropped (visible), else false.
    boolean isFocusControl()
    Returns true if the receiver has the user-interface focus, and false otherwise.
    boolean isShowButtonOnFocus()
    Returns true if button is displayed only when the combo has has focus and false otherwise.
    void paste()
    Pastes text from clipboard.
    protected void popupEvent​(org.eclipse.swt.widgets.Event event)
    Manages popup shell events.
    void redraw()
    Causes the entire bounds of the receiver to be marked as needing to be redrawn.
    void redraw​(int x, int y, int width, int height, boolean all)
    Causes the rectangular area of the receiver specified by the arguments to be marked as needing to be redrawn.
    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.
    void removeSelectionListener​(org.eclipse.swt.events.SelectionListener listener)
    Removes the listener from the collection of listeners who will be notified when the receiver's selection changes.
    void removeVerifyListener​(org.eclipse.swt.events.VerifyListener listener)
    Removes the listener from the collection of listeners who will be notified when the control is verified.
    void selectAll()
    Selects all the text in the receiver.
    void setBackground​(org.eclipse.swt.graphics.Color color)
    Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.
    protected void setCreateOnDrop​(boolean createOnDrop)
    Sets the flag indicating if the popup content must be created each time the combo is dropped.
    void setEditable​(boolean editable)
    Sets the editable state.
    void setEnabled​(boolean enabled)
    Enables the receiver if the argument is true, and disables it otherwise.
    boolean setFocus()
    Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.
    void setFont​(org.eclipse.swt.graphics.Font font)
    Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.
    void setForeground​(org.eclipse.swt.graphics.Color color)
    Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.
    void setLayout​(org.eclipse.swt.widgets.Layout layout)
    Sets the layout which is associated with the receiver to be the argument which may be null.
    void setMenu​(org.eclipse.swt.widgets.Menu menu)
    Sets the receiver's pop up menu to the argument.
    protected void setPopupLocation()
    Calculates and returns the location of popup.
    Called just before than the popup is dropped.
    void setSelection​(org.eclipse.swt.graphics.Point selection)
    Sets the selection in the receiver's text field to the range specified by the argument whose x coordinate is the start of the selection and whose y coordinate is the end of the selection.
    void setShowButtonOnFocus​(boolean showButtonOnFocus)
    Sets the flag indicating if the button must be shown only if the combo has the focus (true).
    void setTextLimit​(int limit)
    Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument.
    void setToolTipText​(java.lang.String string)
    Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.
    void setVisible​(boolean visible)
    Marks the receiver as visible if the argument is true, and marks it invisible otherwise.
    protected void textEvent​(org.eclipse.swt.widgets.Event event)
    Manages text widget events.
    protected void updateButtonDisplay()
    Updates the visibility of the button in function of the flag and the focus.

    Methods inherited from class org.eclipse.swt.widgets.Composite

    changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList, toString

    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, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setLayoutData, setLocation, setLocation, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, 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

    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
  • Field Details

    • GTK

      public static final boolean GTK
      GTK platform constant
    • WIN32

      public static final boolean WIN32
      WIN32 platform constant
    • _shell

      org.eclipse.swt.widgets.Shell _shell
      The parent Shell
    • text

      protected org.eclipse.swt.widgets.Text text
      Text widget for the input
    • popup

      protected org.eclipse.swt.widgets.Shell popup
      Popup shell for the selection
    • button

      protected org.eclipse.swt.widgets.Button button
      Button opening the popup
    • popupContent

      protected org.eclipse.swt.widgets.Control popupContent
      Content of the popup
    • listener

      protected org.eclipse.swt.widgets.Listener listener
      Listener for all internal events
    • filter

      protected org.eclipse.swt.widgets.Listener filter
      Listener for external events
    • hasFocus

      protected boolean hasFocus
      Flag indicating if the widget has focus or not
    • showButtonOnFocus

      protected boolean showButtonOnFocus
      Flag to show button only if combo has the focus
    • createOnDrop

      protected boolean createOnDrop
      Flag indicating that the popup content must be created each time the combo is dropped
  • Constructor Details

    • AbstractCombo

      public AbstractCombo​(org.eclipse.swt.widgets.Composite parent, int style)
      Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

      Parameters:
      parent - a widget which will be the parent of the new instance (cannot be null)
      style - the style of widget to construct
  • Method Details

    • checkStyle

      static int checkStyle​(int style)
    • 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.
      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)
    • addSelectionListener

      public void addSelectionListener​(org.eclipse.swt.events.SelectionListener listener)
      Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the SelectionListener interface.

      widgetSelected is called when the combo's list selection changes. widgetDefaultSelected is typically called when ENTER is pressed the combo's text area.

      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:
      SelectionListener, removeSelectionListener(org.eclipse.swt.events.SelectionListener), SelectionEvent
    • addVerifyListener

      public void addVerifyListener​(org.eclipse.swt.events.VerifyListener listener)
      Adds the listener to the collection of listeners who will be notified when the receiver's text is verified, by sending it one of the messages defined in the VerifyListener interface.
      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:
      VerifyListener, removeVerifyListener(org.eclipse.swt.events.VerifyListener)
    • beforeDrop

      protected void beforeDrop()
      Called just before the popup is dropped. Override to execute actions before the apparition of the popup.

      By default, do nothing.

    • buttonEvent

      protected void buttonEvent​(org.eclipse.swt.widgets.Event event)
      Manages button events.
      Parameters:
      event - event
    • comboEvent

      protected void comboEvent​(org.eclipse.swt.widgets.Event event)
      Manages global combo events.
      Parameters:
      event - event
    • contentEvent

      protected void contentEvent​(org.eclipse.swt.widgets.Event event)
      Manages popup content events. SelectionEvent are notified to all registered SelectionListeners of the combo.
      Parameters:
      event - event
    • copy

      public void copy()
      Copies the selected text.

      The current selection is copied to the clipboard.

      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
    • createButtonControl

      protected org.eclipse.swt.widgets.Button createButtonControl​(int style)
      Creates the arrow button widget. Override to change appearance or behavior of the button.
      Parameters:
      style - button style
      Returns:
      The created button
    • createPopup

      protected void createPopup()
      Creates the popup that will be displayed when the button is selected. Popup is a new Shell containing a unique Control. The content is specific to each implementation of the Combo and is created overriding the createPopupContent method.
    • createPopupContent

      protected abstract org.eclipse.swt.widgets.Control createPopupContent​(org.eclipse.swt.widgets.Composite parent)
      Creates the popup content. The popup is dependent of each implementation. Content can be a List, a Table or every other control.
      The popupContent attribute must be set with the created control. The parent must be the shell attribute, that is initialized by default with a FillLayout.
      Parameters:
      parent - The parent Composite that will contain the control
      Returns:
      The created Control for the popup content
    • createTextControl

      protected org.eclipse.swt.widgets.Text createTextControl​(int style)
      Creates the text widget. Override to change appearance or behavior of the default text that is created here.
      Parameters:
      style - text style
      Returns:
      the created Text control
    • cut

      public void cut()
      Cuts the selected text.

      The current selection is first copied to the clipboard and then deleted from the widget.

      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
    • doSelection

      protected abstract boolean doSelection()
      This method is called when a SWT.Selection is notify in the popup content, allowing to update the Text widget content.
      Returns:
      true if the SWT.Selection event must be propagated, else false
    • dropDown

      protected void dropDown​(boolean drop)
      Manages drop down of the popup.
      Parameters:
      drop - true to drop the popup, false to close
    • getEditable

      public boolean getEditable()
      Gets 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
    • getPopupVisible

      public boolean getPopupVisible()
      Returns true if the receiver's popup is visible, and false otherwise.

      If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.

      Returns:
      the receiver's popup's visibility state
      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
    • getSelection

      public org.eclipse.swt.graphics.Point getSelection()
      Returns a Point whose x coordinate is the start of the selection in the receiver's text field, and whose y coordinate is the end of the selection. The returned values are zero-relative. An "empty" selection as indicated by the the x and y coordinates having the same value.
      Returns:
      a point representing the selection start and end
      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
    • getShell

      public org.eclipse.swt.widgets.Shell getShell()
      Overrides:
      getShell in class org.eclipse.swt.widgets.Control
    • getStyle

      public int getStyle()
      Returns the receiver's style information.
      Overrides:
      getStyle in class org.eclipse.swt.widgets.Widget
      See Also:
      Widget.getStyle()
    • getText

      public java.lang.String getText()
      Returns a string containing a copy of the contents of the receiver's text field.
      Returns:
      the receiver's text
    • getTextHeight

      public int getTextHeight()
      Returns the height of the receivers's text field.
      Returns:
      the text height
      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
    • getTextLimit

      public int getTextLimit()
      Returns the maximum number of characters that the receiver's text field is capable of holding. If this has not been changed by setTextLimit(), it will be the constant Combo.LIMIT.
      Returns:
      the text limit
      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
    • handleFocus

      protected void handleFocus​(int type)
      Manages the focus on the combo.
      Parameters:
      type - SWT.FocusIn or SWT.FocusOut
    • isDropped

      protected boolean isDropped()
      Returns true if popup is dropped (visible), else false.
      Returns:
      boolean indicating if popup is dropped
    • isFocusControl

      public boolean isFocusControl()
      Returns true if the receiver has the user-interface focus, and false otherwise.
      Overrides:
      isFocusControl in class org.eclipse.swt.widgets.Control
      See Also:
      Control.isFocusControl()
    • isShowButtonOnFocus

      public boolean isShowButtonOnFocus()
      Returns true if button is displayed only when the combo has has focus and false otherwise.
      Returns:
      boolean indicating if combo must show button only on focus
    • paste

      public void paste()
      Pastes text from clipboard.

      The selected text is deleted from the widget and new text inserted from the clipboard.

      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
    • popupEvent

      protected void popupEvent​(org.eclipse.swt.widgets.Event event)
      Manages popup shell events.
      Parameters:
      event - event
    • redraw

      public void redraw()
      Causes the entire bounds of the receiver to be marked as needing to be redrawn. The next time a paint request is processed, the control will be completely painted, including the background.
      Overrides:
      redraw in class org.eclipse.swt.widgets.Control
    • redraw

      public void redraw​(int x, int y, int width, int height, boolean all)
      Causes the rectangular area of the receiver specified by the arguments to be marked as needing to be redrawn. The next time a paint request is processed, that area of the receiver will be painted, including the background. If the all flag is true, any children of the receiver which intersect with the specified area will also paint their intersecting areas. If the all flag is false, the children will not be painted.
      Overrides:
      redraw in class org.eclipse.swt.widgets.Control
      Parameters:
      x -
      y -
      width -
      height -
      all -
    • 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)
    • removeSelectionListener

      public void removeSelectionListener​(org.eclipse.swt.events.SelectionListener listener)
      Removes the listener from the collection of listeners who will be notified when the receiver's selection changes.
      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:
      SelectionListener, addSelectionListener(org.eclipse.swt.events.SelectionListener)
    • removeVerifyListener

      public void removeVerifyListener​(org.eclipse.swt.events.VerifyListener listener)
      Removes the listener from the collection of listeners who will be notified when the control is verified.
      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:
      VerifyListener, addVerifyListener(org.eclipse.swt.events.VerifyListener)
    • selectAll

      public void selectAll()
      Selects all the text in the receiver.
      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
    • setBackground

      public void setBackground​(org.eclipse.swt.graphics.Color color)
      Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.
      Overrides:
      setBackground in class org.eclipse.swt.widgets.Control
      See Also:
      Control.setBackground(org.eclipse.swt.graphics.Color)
    • setCreateOnDrop

      protected void setCreateOnDrop​(boolean createOnDrop)
      Sets the flag indicating if the popup content must be created each time the combo is dropped. It can be necessary to set this flag to true when the popup content use to many controls, as the DateChooser.
      Parameters:
      createOnDrop - true if popup is recreated at each drop, else false
    • setEditable

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

      public void setEnabled​(boolean enabled)
      Enables the receiver if the argument is true, and disables it otherwise.
      Overrides:
      setEnabled in class org.eclipse.swt.widgets.Control
      See Also:
      Control.setEnabled(boolean)
    • setFocus

      public boolean setFocus()
      Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.
      Overrides:
      setFocus in class org.eclipse.swt.widgets.Composite
      See Also:
      Control.setFocus()
    • setFont

      public void setFont​(org.eclipse.swt.graphics.Font font)
      Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.
      Overrides:
      setFont in class org.eclipse.swt.widgets.Control
      See Also:
      Control.setFont(org.eclipse.swt.graphics.Font)
    • setForeground

      public void setForeground​(org.eclipse.swt.graphics.Color color)
      Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.
      Overrides:
      setForeground in class org.eclipse.swt.widgets.Control
      See Also:
      Control.setForeground(org.eclipse.swt.graphics.Color)
    • setLayout

      public void setLayout​(org.eclipse.swt.widgets.Layout layout)
      Sets the layout which is associated with the receiver to be the argument which may be null.

      Note : No Layout can be set on this Control because it already manages the size and position of its children.

      Overrides:
      setLayout in class org.eclipse.swt.widgets.Composite
      Parameters:
      layout - the receiver's new layout or null
    • setMenu

      public void setMenu​(org.eclipse.swt.widgets.Menu menu)
      Sets the receiver's pop up menu to the argument. All controls may optionally have a pop up menu that is displayed when the user requests one for the control. The sequence of key strokes, button presses and/or button releases that are used to request a pop up menu is platform specific. Note: Disposing of a control that has a pop up menu will dispose of the menu. To avoid this behavior, set the menu to null before the control is disposed.
      Overrides:
      setMenu in class org.eclipse.swt.widgets.Control
      Parameters:
      menu - the new pop up menu
    • setPopupLocation

      protected void setPopupLocation()
      Calculates and returns the location of popup.
      Called just before than the popup is dropped.
    • setSelection

      public void setSelection​(org.eclipse.swt.graphics.Point selection)
      Sets the selection in the receiver's text field to the range specified by the argument whose x coordinate is the start of the selection and whose y coordinate is the end of the selection.
      Parameters:
      selection - a point representing the new selection start and end
    • setShowButtonOnFocus

      public void setShowButtonOnFocus​(boolean showButtonOnFocus)
      Sets the flag indicating if the button must be shown only if the combo has the focus (true).
      Parameters:
      showButtonOnFocus - true if button must be shown on focus only
    • setTextLimit

      public void setTextLimit​(int limit)
      Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument.
      Parameters:
      limit - new text limit
      Throws:
      java.lang.IllegalArgumentException -
      • ERROR_CANNOT_BE_ZERO - if the limit is zero
      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
    • setToolTipText

      public void setToolTipText​(java.lang.String string)
      Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.
      Overrides:
      setToolTipText in class org.eclipse.swt.widgets.Control
      Parameters:
      string - the new tool tip text (or null)
    • setVisible

      public void setVisible​(boolean visible)
      Marks the receiver as visible if the argument is true, and marks it invisible otherwise.
      Overrides:
      setVisible in class org.eclipse.swt.widgets.Control
      See Also:
      Control.setVisible(boolean)
    • textEvent

      protected void textEvent​(org.eclipse.swt.widgets.Event event)
      Manages text widget events. ModifyEvent are notified to all registered ModifyListener of the combo.
      Parameters:
      event - event
    • updateButtonDisplay

      protected void updateButtonDisplay()
      Updates the visibility of the button in function of the flag and the focus.