Class AbstractCombo
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
- Direct Known Subclasses:
DateChooserCombo
public abstract class AbstractCombo
extends org.eclipse.swt.widgets.Composite
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_shellThe parent Shellprotected org.eclipse.swt.widgets.ButtonbuttonButton opening the popupprotected booleancreateOnDropFlag indicating that the popup content must be created each time the combo is droppedprotected org.eclipse.swt.widgets.ListenerfilterListener for external eventsstatic booleanGTKGTK platform constantprotected booleanhasFocusFlag indicating if the widget has focus or notprotected org.eclipse.swt.widgets.ListenerlistenerListener for all internal eventsprotected org.eclipse.swt.widgets.ShellpopupPopup shell for the selectionprotected org.eclipse.swt.widgets.ControlpopupContentContent of the popupprotected booleanshowButtonOnFocusFlag to show button only if combo has the focusprotected org.eclipse.swt.widgets.TexttextText widget for the inputstatic booleanWIN32WIN32 platform constant -
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 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.voidaddSelectionListener(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 theSelectionListenerinterface.voidaddVerifyListener(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 theVerifyListenerinterface.protected voidbeforeDrop()Called just before the popup is dropped.protected voidbuttonEvent(org.eclipse.swt.widgets.Event event)Manages button events.(package private) static intcheckStyle(int style)protected voidcomboEvent(org.eclipse.swt.widgets.Event event)Manages global combo events.protected voidcontentEvent(org.eclipse.swt.widgets.Event event)Manages popup content events.voidcopy()Copies the selected text.protected org.eclipse.swt.widgets.ButtoncreateButtonControl(int style)Creates the arrow button widget.protected voidcreatePopup()Creates the popup that will be displayed when the button is selected.protected abstract org.eclipse.swt.widgets.ControlcreatePopupContent(org.eclipse.swt.widgets.Composite parent)Creates the popup content.protected org.eclipse.swt.widgets.TextcreateTextControl(int style)Creates the text widget.voidcut()Cuts the selected text.protected abstract booleandoSelection()This method is called when a SWT.Selection is notify in the popup content, allowing to update the Text widget content.protected voiddropDown(boolean drop)Manages drop down of the popup.booleangetEditable()Gets the editable state.booleangetPopupVisible()Returnstrueif the receiver's popup is visible, andfalseotherwise.org.eclipse.swt.graphics.PointgetSelection()Returns aPointwhose 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.ShellgetShell()intgetStyle()Returns the receiver's style information.java.lang.StringgetText()Returns a string containing a copy of the contents of the receiver's text field.intgetTextHeight()Returns the height of the receivers's text field.intgetTextLimit()Returns the maximum number of characters that the receiver's text field is capable of holding.protected voidhandleFocus(int type)Manages the focus on the combo.protected booleanisDropped()Returnstrueif popup is dropped (visible), elsefalse.booleanisFocusControl()Returnstrueif the receiver has the user-interface focus, andfalseotherwise.booleanisShowButtonOnFocus()Returnstrueif button is displayed only when the combo has has focus andfalseotherwise.voidpaste()Pastes text from clipboard.protected voidpopupEvent(org.eclipse.swt.widgets.Event event)Manages popup shell events.voidredraw()Causes the entire bounds of the receiver to be marked as needing to be redrawn.voidredraw(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.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.voidremoveSelectionListener(org.eclipse.swt.events.SelectionListener listener)Removes the listener from the collection of listeners who will be notified when the receiver's selection changes.voidremoveVerifyListener(org.eclipse.swt.events.VerifyListener listener)Removes the listener from the collection of listeners who will be notified when the control is verified.voidselectAll()Selects all the text in the receiver.voidsetBackground(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 voidsetCreateOnDrop(boolean createOnDrop)Sets the flag indicating if the popup content must be created each time the combo is dropped.voidsetEditable(boolean editable)Sets the editable state.voidsetEnabled(boolean enabled)Enables the receiver if the argument istrue, and disables it otherwise.booleansetFocus()Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.voidsetFont(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.voidsetForeground(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.voidsetLayout(org.eclipse.swt.widgets.Layout layout)Sets the layout which is associated with the receiver to be the argument which may be null.voidsetMenu(org.eclipse.swt.widgets.Menu menu)Sets the receiver's pop up menu to the argument.protected voidsetPopupLocation()Calculates and returns the location of popup.
Called just before than the popup is dropped.voidsetSelection(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.voidsetShowButtonOnFocus(boolean showButtonOnFocus)Sets the flag indicating if the button must be shown only if the combo has the focus (true).voidsetTextLimit(int limit)Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument.voidsetToolTipText(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.voidsetVisible(boolean visible)Marks the receiver as visible if the argument istrue, and marks it invisible otherwise.protected voidtextEvent(org.eclipse.swt.widgets.Event event)Manages text widget events.protected voidupdateButtonDisplay()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, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBarMethods 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, updateMethods 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
-
Field Details
-
GTK
public static final boolean GTKGTK platform constant -
WIN32
public static final boolean WIN32WIN32 platform constant -
_shell
org.eclipse.swt.widgets.Shell _shellThe parent Shell -
text
protected org.eclipse.swt.widgets.Text textText widget for the input -
popup
protected org.eclipse.swt.widgets.Shell popupPopup shell for the selection -
button
protected org.eclipse.swt.widgets.Button buttonButton opening the popup -
popupContent
protected org.eclipse.swt.widgets.Control popupContentContent of the popup -
listener
protected org.eclipse.swt.widgets.Listener listenerListener for all internal events -
filter
protected org.eclipse.swt.widgets.Listener filterListener for external events -
hasFocus
protected boolean hasFocusFlag indicating if the widget has focus or not -
showButtonOnFocus
protected boolean showButtonOnFocusFlag to show button only if combo has the focus -
createOnDrop
protected boolean createOnDropFlag 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 theModifyListenerinterface.- 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 theSelectionListenerinterface.widgetSelectedis called when the combo's list selection changes.widgetDefaultSelectedis 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 theVerifyListenerinterface.- 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 aList, aTableor every other control.
ThepopupContentattribute must be set with the created control. The parent must be theshellattribute, that is initialized by default with aFillLayout.- 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-trueto drop the popup,falseto 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()Returnstrueif the receiver's popup is visible, andfalseotherwise.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 aPointwhose 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:
getShellin classorg.eclipse.swt.widgets.Control
-
getStyle
public int getStyle()Returns the receiver's style information.- Overrides:
getStylein classorg.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 bysetTextLimit(), it will be the constantCombo.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()Returnstrueif popup is dropped (visible), elsefalse.- Returns:
- boolean indicating if popup is dropped
-
isFocusControl
public boolean isFocusControl()Returnstrueif the receiver has the user-interface focus, andfalseotherwise.- Overrides:
isFocusControlin classorg.eclipse.swt.widgets.Control- See Also:
Control.isFocusControl()
-
isShowButtonOnFocus
public boolean isShowButtonOnFocus()Returnstrueif button is displayed only when the combo has has focus andfalseotherwise.- 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:
redrawin classorg.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:
redrawin classorg.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:
setBackgroundin classorg.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 istrue, and disables it otherwise.- Overrides:
setEnabledin classorg.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:
setFocusin classorg.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:
setFontin classorg.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:
setForegroundin classorg.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:
setLayoutin classorg.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:
setMenuin classorg.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-trueif 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:
setToolTipTextin classorg.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 istrue, and marks it invisible otherwise.- Overrides:
setVisiblein classorg.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.
-