Class BaseCombo
- 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.swt.widgets.Canvas
-
- org.eclipse.nebula.cwt.base.BaseCombo
-
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
- Direct Known Subclasses:
CDateTime
public abstract class BaseCombo extends org.eclipse.swt.widgets.CanvasThe 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 classBaseCombo.DropComboLayoutSpecial layout implementation to position the combo's drop-down Button within its Text.
-
Field Summary
Fields Modifier and Type Field Description protected VButtonbuttonThe Button widget of a DROP_DOWN style combo.protected static intBUTTON_ALWAYSA constant indicating that the drop down button is always visible.protected static intBUTTON_AUTOA constant indicating that the drop down button is visible when the text box has the focus, and is hidden otherwise.protected static intBUTTON_NEVERA constant indicating that the drop down button is never visible.protected static intBUTTON_ONLYA style constant indicating that this combo will only have a drop down button, rather than a button and a text box.(package private) booleanbuttonActiveboolean to disable button on open state.private intbuttonVisibilityprivate org.eclipse.swt.widgets.ListenerbuttonVisibilityListenerprotected static booleancarbontrue if the platform is carbon, false otherwiseprivate org.eclipse.swt.widgets.ListenercomboListenerprotected org.eclipse.swt.widgets.ControlcontentThe widget contents of the popup Shell in a DROP_DOWN combo or the full contents of a SIMPLE combo.protected org.eclipse.swt.widgets.ShellcontentShellThe popup Shell widget of a DROP_DOWN style combo.protected booleandefaultButtonImageTrue if a default image should be used for the button; false otherwise - as is the case when an image is set usingsetButtonImage(Image)private org.eclipse.swt.widgets.ListenerdisposeListenerprivate booleandropDownprotected static booleangtktrue if the platform is gtk, false otherwiseprivate booleanholdOpenprotected booleanleftAlignFlag to indicate that this combo's BUTTON should be displayed on the left side of its Text.private booleanopenprotected VPanelpanelThe VPanel that is the base of this widget.private VControlpositionControlprivate org.eclipse.swt.widgets.ListenershellListenerprotected booleansimpleFlag to indicate that this is a SIMPLE style combo.private VControlstretchControlprotected intstyleThe style bits requested.protected VNative<org.eclipse.swt.widgets.Text>textThe Text widget of a DROP_DOWN style combo.private org.eclipse.swt.widgets.ListenertextListenerprotected static inttextMarginHeightA 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 booleanwin32true if the platform is win32, false otherwise
-
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 voidaddKeyListener(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 theKeyListenerinterface.voidaddModifyListener(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 theModifyListenerinterface.
Note that this is NOT the correct way to listen for changes in the underlying model for the combo.private voidaddTextListener()voidaddTraverseListener(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 theTraverseListenerinterface.protected booleancheckButton()protected booleancheckContent()protected booleancheckContentShell()private static intcheckStyle(int style)protected booleancheckText()protected static booleancontainsControl(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 voidcreateButton(int style)private voidcreateContentShell()private voidcreateText(int style)protected voiddoSetButtonImage(org.eclipse.swt.graphics.Image image)protected org.eclipse.swt.widgets.ControlgetContent()protected org.eclipse.swt.widgets.ShellgetContentShell()booleangetEditable()Returns the editable state.booleangetEnabled()Fixes bug 181442: [CDateTime] Incorrect getEnabled()protected booleangetHoldOpen()org.eclipse.swt.widgets.MenugetMenu()returns the menu for this comboprotected VControlgetStretchControl()intgetStyle()java.lang.StringgetText()Returns the text of this comboprivate voidinit(int style)protected booleanisDropDown()booleanisOpen()protected booleanisRTL()protected booleanisSimple()protected voidpostClose(org.eclipse.swt.widgets.Shell popup)called just after the content shell is set not-visible and has "closed"protected voidpostOpen(org.eclipse.swt.widgets.Shell popup)called after the content shell is set visible and has "opened"protected voidpreClose(org.eclipse.swt.widgets.Shell popup)called just before the content shell is set not-visible and "closes"protected voidpreOpen(org.eclipse.swt.widgets.Shell popup)called just before the content shell is set visible and "opens"voidremoveKeyListener(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.voidremoveModifyListener(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 voidremoveTextListener()voidremoveTraverseListener(org.eclipse.swt.events.TraverseListener listener)Removes the listener from the collection of listeners who will be notified when traversal events occur.voidsetBackground(org.eclipse.swt.graphics.Color color)protected voidsetButtonAlignment(int alignment)Set the alignment of the button in relation to the text box.protected voidsetButtonImage(org.eclipse.swt.graphics.Image image)Set the custom image for the drop down button.protected voidsetButtonText(java.lang.String text)Set the text for the drop down button.protected voidsetButtonVisibility(int visibility)Set the visibility style of the drop button.protected voidsetButtonVisible(boolean visible)Set the visible state of the buttonprotected voidsetContent(org.eclipse.swt.widgets.Control content)set the content of the popup shellprotected abstract booleansetContentFocus()Called when the popup shell has been open, this method provides a location for subclasses to set the focus to the content.voidsetEditable(boolean editable)Sets the editable state.voidsetEnabled(boolean enabled)booleansetFocus()voidsetFont(org.eclipse.swt.graphics.Font font)voidsetForeground(org.eclipse.swt.graphics.Color color)protected voidsetHoldOpen(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 falsevoidsetMenu(org.eclipse.swt.widgets.Menu menu)Sets the menu for the Text widget of this DropComboprotected voidsetModifyEventProperties(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 voidsetOpen(boolean open)Convenience method for BaseCombo:setOpen(boolean, Runnable), omitting optional runnable.protected voidsetOpen(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)
Ifcontent == nullorisOpen() == openthis method simply returns.
IfcontentShell == nullthencontentShellwill be created.protected voidsetPositionControl(VControl positionControl)sets the control to which the popup will align itselfprotected voidsetStretch(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))voidsetToolTipText(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
-
-
-
-
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_ALWAYS
protected static final int BUTTON_ALWAYS
A constant indicating that the drop down button is always visible. Valid only when style is DROP_DOWN.- See Also:
BUTTON_AUTO,BUTTON_NEVER, Constant Field Values
-
BUTTON_NEVER
protected static final int BUTTON_NEVER
A constant indicating that the drop down button is never visible. Valid only when style is DROP_DOWN.This setting may be useful if the subclass of this BaseCombo allows programmatic opening and closing of the drop down shell via
setOpen(boolean), or a similar method.
-
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 usingsetButtonImage(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 bygetStyle()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 widgetstyle- 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 theKeyListenerinterface.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:
addKeyListenerin classorg.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 theModifyListenerinterface.
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 aSelectionListener.- 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 theTraverseListenerinterface.- Overrides:
addTraverseListenerin classorg.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
buttonfield is in a fit state to be used
-
checkContent
protected boolean checkContent()
- Returns:
- true if the
contentfield is in a fit state to be used
-
checkContentShell
protected boolean checkContentShell()
- Returns:
- true if the
contentShellfield is in a fit state to be used
-
checkText
protected boolean checkText()
- Returns:
- true if the
textfield 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:
getEnabledin classorg.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:
getMenuin classorg.eclipse.swt.widgets.Control
-
getStretchControl
protected VControl getStretchControl()
- Returns:
- the stretch control
-
getStyle
public int getStyle()
- Overrides:
getStylein classorg.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:
removeKeyListenerin classorg.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:
removeTraverseListenerin classorg.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 buttonNote: 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 shellCan 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:
setEnabledin classorg.eclipse.swt.widgets.Control
-
setFocus
public boolean setFocus()
- Overrides:
setFocusin classorg.eclipse.swt.widgets.Composite
-
setFont
public void setFont(org.eclipse.swt.graphics.Font font)
- Overrides:
setFontin classorg.eclipse.swt.widgets.Canvas- See Also:
Canvas.setFont(org.eclipse.swt.graphics.Font)
-
setBackground
public void setBackground(org.eclipse.swt.graphics.Color color)
- Overrides:
setBackgroundin classorg.eclipse.swt.widgets.Control- See Also:
Control.setBackground(org.eclipse.swt.graphics.Color)
-
setForeground
public void setForeground(org.eclipse.swt.graphics.Color color)
- Overrides:
setForegroundin classorg.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 falsemerely 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 DropComboNote 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:
setMenuin classorg.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)
Ifcontent == nullorisOpen() == openthis method simply returns.
IfcontentShell == nullthencontentShellwill 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 itselfthe 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:
setToolTipTextin classorg.eclipse.swt.widgets.Control- Parameters:
tooltip- the new tooltip text
-
-