public class Combo extends Composite
Combos are used in the same place
where a single selection List widget could
be used but space is limited. A Combo takes
less space than a List widget and shows
similar information.
Note: Since Combos can contain both a list
and an editable text field, it is possible to confuse methods
which access one versus the other (compare for example,
clearSelection() and deselectAll()).
The API documentation is careful to indicate either "the
receiver's list" or the "the receiver's text field" to
distinguish between the two cases.
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.
Note: Only one of the styles DROP_DOWN and SIMPLE may be specified.
IMPORTANT: This class is not intended to be subclassed.
| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
CBID_EDIT |
(package private) static int |
CBID_LIST |
(package private) int |
cbtHook |
(package private) static TCHAR |
ComboClass |
(package private) static int |
ComboProc |
(package private) static int |
EditProc |
(package private) boolean |
ignoreCharacter |
(package private) boolean |
ignoreDefaultSelection |
(package private) boolean |
ignoreModify |
(package private) boolean |
ignoreResize |
static int |
LIMIT
the operating system limit for the number of characters
that the text field in an instance of this class can hold
|
(package private) static int |
ListProc |
(package private) boolean |
lockText |
(package private) boolean |
noSelection |
(package private) int |
scrollWidth |
(package private) static int |
VISIBLE_COUNT |
(package private) int |
visibleCount |
backgroundMode, layout, layoutCount, lpwp, tabListhorizontalBar, verticalBaraccessible, background, backgroundImage, cursor, drawCount, font, foreground, handle, layoutData, menu, parent, region, toolTipTextCANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE| Constructor and Description |
|---|
Combo(Composite parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.String string)
Adds the argument to the end of the receiver's list.
|
void |
add(java.lang.String string,
int index)
Adds the argument to the receiver's list at the given
zero-relative index.
|
void |
addModifyListener(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(SelectionListener listener)
Adds the listener to the collection of listeners who will
be notified when the user changes the receiver's selection, by sending
it one of the messages defined in the
SelectionListener
interface. |
void |
addVerifyListener(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. |
(package private) int |
callWindowProc(int hwnd,
int msg,
int wParam,
int lParam) |
(package private) int |
CBTProc(int nCode,
int wParam,
int lParam) |
(package private) boolean |
checkHandle(int hwnd) |
(package private) static int |
checkStyle(int style) |
protected void |
checkSubclass()
Checks that this class can be subclassed.
|
void |
clearSelection()
Sets the selection in the receiver's text field to an empty
selection starting just before the first character.
|
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Returns the preferred size of the receiver.
|
void |
copy()
Copies the selected text.
|
(package private) void |
createHandle() |
(package private) void |
createWidget() |
void |
cut()
Cuts the selected text.
|
(package private) int |
defaultBackground() |
(package private) void |
deregister() |
void |
deselect(int index)
Deselects the item at the given zero-relative index in the receiver's
list.
|
void |
deselectAll()
Deselects all selected items in the receiver's list.
|
(package private) boolean |
dragDetect(int hwnd,
int x,
int y,
boolean filter,
boolean[] detect,
boolean[] consume) |
Point |
getCaretLocation()
Returns a point describing the location of the caret relative
to the receiver.
|
int |
getCaretPosition()
Returns the character position of the caret.
|
java.lang.String |
getItem(int index)
Returns the item at the given, zero-relative index in the
receiver's list.
|
int |
getItemCount()
Returns the number of items contained in the receiver's list.
|
int |
getItemHeight()
Returns the height of the area which would be used to
display one of the items in the receiver's list.
|
java.lang.String[] |
getItems()
Returns a (possibly empty) array of
Strings which are
the items in the receiver's list. |
boolean |
getListVisible()
Returns
true if the receiver's list is visible,
and false otherwise. |
(package private) java.lang.String |
getNameText() |
int |
getOrientation()
Returns the orientation of the receiver.
|
Point |
getSelection()
Returns a
Point whose x coordinate is the
character position representing the start of the selection
in the receiver's text field, and whose y coordinate is the
character position representing the end of the selection. |
int |
getSelectionIndex()
Returns the zero-relative index of the item which is currently
selected in the receiver's list, or -1 if no item is selected.
|
java.lang.String |
getText()
Returns a string containing a copy of the contents of the
receiver's text field, or an empty string if there are no
contents.
|
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.
|
int |
getVisibleItemCount()
Gets the number of items that are visible in the drop
down portion of the receiver's list.
|
(package private) boolean |
hasFocus() |
int |
indexOf(java.lang.String string)
Searches the receiver's list starting at the first item
(index 0) until an item is found that is equal to the
argument, and returns the index of that item.
|
int |
indexOf(java.lang.String string,
int start)
Searches the receiver's list starting at the given,
zero-relative index until an item is found that is equal
to the argument, and returns the index of that item.
|
(package private) int |
mbcsToWcsPos(int mbcsPos) |
void |
paste()
Pastes text from clipboard.
|
(package private) void |
register() |
void |
remove(int index)
Removes the item from the receiver's list at the given
zero-relative index.
|
(package private) void |
remove(int index,
boolean notify) |
void |
remove(int start,
int end)
Removes the items from the receiver's list which are
between the given zero-relative start and end
indices (inclusive).
|
void |
remove(java.lang.String string)
Searches the receiver's list starting at the first item
until an item is found that is equal to the argument,
and removes that item from the list.
|
void |
removeAll()
Removes all of the items from the receiver's list and clear the
contents of receiver's text field.
|
void |
removeModifyListener(ModifyListener listener)
Removes the listener from the collection of listeners who will
be notified when the receiver's text is modified.
|
void |
removeSelectionListener(SelectionListener listener)
Removes the listener from the collection of listeners who will
be notified when the user changes the receiver's selection.
|
void |
removeVerifyListener(VerifyListener listener)
Removes the listener from the collection of listeners who will
be notified when the control is verified.
|
void |
select(int index)
Selects the item at the given zero-relative index in the receiver's
list.
|
(package private) boolean |
sendKeyEvent(int type,
int msg,
int wParam,
int lParam,
Event event) |
(package private) void |
setBackgroundImage(int hBitmap) |
(package private) void |
setBackgroundPixel(int pixel) |
(package private) void |
setBounds(int x,
int y,
int width,
int height,
int flags) |
void |
setFont(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.
|
(package private) void |
setForegroundPixel(int pixel) |
void |
setItem(int index,
java.lang.String string)
Sets the text of the item in the receiver's list at the given
zero-relative index to the string argument.
|
void |
setItems(java.lang.String[] items)
Sets the receiver's list to be the given array of items.
|
void |
setListVisible(boolean visible)
Marks the receiver's list as visible if the argument is
true,
and marks it invisible otherwise. |
void |
setOrientation(int orientation)
Sets the orientation of the receiver, which must be one
of the constants
SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT. |
(package private) void |
setScrollWidth() |
(package private) void |
setScrollWidth(int scrollWidth) |
(package private) void |
setScrollWidth(int newWidth,
boolean grow) |
(package private) void |
setScrollWidth(TCHAR buffer,
boolean grow) |
void |
setSelection(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 |
setText(java.lang.String string)
Sets the contents of the receiver's text field to the
given string.
|
void |
setTextLimit(int limit)
Sets the maximum number of characters that the receiver's
text field is capable of holding to be the argument.
|
(package private) void |
setToolTipText(Shell shell,
java.lang.String string) |
void |
setVisibleItemCount(int count)
Sets the number of items that are visible in the drop
down portion of the receiver's list.
|
(package private) void |
subclass() |
(package private) boolean |
translateTraversal(MSG msg) |
(package private) boolean |
traverseEscape() |
(package private) boolean |
traverseReturn() |
(package private) void |
unsubclass() |
(package private) void |
updateDropDownHeight() |
(package private) void |
updateOrientation() |
(package private) java.lang.String |
verifyText(java.lang.String string,
int start,
int end,
Event keyEvent) |
(package private) int |
wcsToMbcsPos(int wcsPos) |
(package private) int |
widgetExtStyle() |
(package private) int |
widgetStyle() |
(package private) TCHAR |
windowClass() |
(package private) int |
windowProc() |
(package private) int |
windowProc(int hwnd,
int msg,
int wParam,
int lParam) |
(package private) LRESULT |
WM_CTLCOLOR(int wParam,
int lParam) |
(package private) LRESULT |
WM_GETDLGCODE(int wParam,
int lParam) |
(package private) LRESULT |
WM_KILLFOCUS(int wParam,
int lParam) |
(package private) LRESULT |
WM_LBUTTONDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETFOCUS(int wParam,
int lParam) |
(package private) LRESULT |
WM_SIZE(int wParam,
int lParam) |
(package private) LRESULT |
WM_UPDATEUISTATE(int wParam,
int lParam) |
(package private) LRESULT |
WM_WINDOWPOSCHANGING(int wParam,
int lParam) |
(package private) LRESULT |
wmChar(int hwnd,
int wParam,
int lParam) |
(package private) LRESULT |
wmClipboard(int hwndText,
int msg,
int wParam,
int lParam) |
(package private) LRESULT |
wmCommandChild(int wParam,
int lParam) |
(package private) LRESULT |
wmIMEChar(int hwnd,
int wParam,
int lParam) |
(package private) LRESULT |
wmKeyDown(int hwnd,
int wParam,
int lParam) |
(package private) LRESULT |
wmSysKeyDown(int hwnd,
int wParam,
int lParam) |
_getChildren, _getTabList, changed, checkBuffered, checkComposited, computeTabList, copyArea, drawBackground, findDeferredControl, findMenus, fixChildren, fixTabList, getBackgroundMode, getChildren, getChildrenCount, getLayout, getLayoutDeferred, getTabList, hooksKeys, isLayoutDeferred, layout, layout, layout, layout, layout, markLayout, minimumSize, redrawChildren, releaseChildren, releaseParent, releaseWidget, removeControl, resizeChildren, resizeChildren, resizeEmbeddedHandle, reskinChildren, sendResize, setBackgroundMode, setBounds, setFocus, setLayout, setLayoutDeferred, setResizeChildren, setTabGroupFocus, setTabList, toolTipText, translateMnemonic, updateBackgroundColor, updateBackgroundImage, updateBackgroundMode, updateFont, updateLayout, updateLayout, updateUIState, WM_ERASEBKGND, WM_GETFONT, WM_NCHITTEST, WM_PAINT, WM_PARENTNOTIFY, WM_PRINTCLIENT, WM_SETFONT, WM_SYSCOLORCHANGE, WM_SYSCOMMAND, wmNCPaint, wmNotifycomputeTrim, createScrollBar, destroyScrollBar, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, scrolledHandle, WM_HSCROLL, WM_MOUSEWHEEL, WM_VSCROLL, wmScroll, wmScrollWheeladdControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, binarySearch, borderHandle, checkBackground, checkBorder, checkGesture, checkMirrored, computeSize, computeTabGroup, computeTabRoot, defaultFont, defaultForeground, destroyWidget, dragDetect, dragDetect, dragDetect, drawBackground, drawBackground, drawBackground, drawImageBackground, drawThemeBackground, enableDrag, enableWidget, fillBackground, fillImageBackground, fillThemeBackground, findBackgroundControl, findBrush, findCursor, findImageControl, findMnemonic, findThemeControl, fixFocus, forceFocus, forceResize, getAccessible, getBackground, getBackgroundImage, getBackgroundPixel, getBorderWidth, getBounds, getClipboardText, getCodePage, getCursor, getDragDetect, getDrawing, getEnabled, getFont, getForeground, getForegroundPixel, getLayoutData, getLocation, getMenu, getMonitor, getParent, getPath, getRegion, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, hasCursor, internal_dispose_GC, internal_new_GC, isActive, isEnabled, isFocusAncestor, isFocusControl, isReparentable, isShowing, isTabGroup, isTabItem, isVisible, mapEvent, menuShell, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, new_Accessible, new_GC, pack, pack, print, printWidget, redraw, redraw, redraw, releaseHandle, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, sendFocusEvent, sendGestureEvent, sendMove, sendTouchEvent, setBackground, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setCursor, setDefaultFont, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRadioFocus, setRadioSelection, setRedraw, setRegion, setSavedFocus, setSize, setSize, setTabItemFocus, setToolTipText, setTouchEnabled, setVisible, showWidget, sort, toControl, toControl, toDisplay, toDisplay, topHandle, translateAccelerator, translateMnemonic, traverse, traverse, traverse, traverse, traverse, traverseGroup, traverseItem, traverseMnemonic, traversePage, update, update, updateImages, widgetCreateStruct, widgetParent, WM_ACTIVATE, WM_CAPTURECHANGED, WM_CHANGEUISTATE, WM_CHAR, WM_CLEAR, WM_CLOSE, WM_COMMAND, WM_CONTEXTMENU, WM_CUT, WM_DESTROY, WM_DRAWITEM, WM_ENDSESSION, WM_ENTERIDLE, WM_GESTURE, WM_GETMINMAXINFO, WM_GETOBJECT, WM_HELP, WM_HOTKEY, WM_IME_CHAR, WM_IME_COMPOSITION_START, WM_IME_COMPOSITION, WM_IME_ENDCOMPOSITION, WM_INITMENUPOPUP, WM_INPUTLANGCHANGE, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP, WM_MBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MEASUREITEM, WM_MENUCHAR, WM_MENUSELECT, WM_MOUSEACTIVATE, WM_MOUSEHOVER, WM_MOUSEHWHEEL, WM_MOUSELEAVE, WM_MOUSEMOVE, WM_MOVE, WM_NCACTIVATE, WM_NCCALCSIZE, WM_NCLBUTTONDOWN, WM_NCPAINT, WM_NOTIFY, WM_PALETTECHANGED, WM_PASTE, WM_PRINT, WM_QUERYENDSESSION, WM_QUERYNEWPALETTE, WM_QUERYOPEN, WM_RBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SETCURSOR, WM_SETREDRAW, WM_SETTINGCHANGE, WM_SHOWWINDOW, WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_TABLET_FLICK, WM_TIMER, WM_TOUCH, WM_UNDO, WM_UNINITMENUPOPUP, WM_WINDOWPOSCHANGED, WM_XBUTTONDBLCLK, WM_XBUTTONDOWN, WM_XBUTTONUP, wmColorChild, wmDrawChild, wmMeasureChild, wmNotifyChild, wmScrollChild_addListener, addDisposeListener, addListener, checkBits, checkOpened, checkOrientation, checkParent, checkWidget, DeferWindowPos, dispose, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getName, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, notifyListeners, postEvent, postEvent, release, removeDisposeListener, removeListener, removeListener, reskin, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, SetWindowPos, showMenu, showMenu, toString, updateMenuLocation, wmCaptureChanged, wmContextMenu, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUpboolean noSelection
boolean ignoreDefaultSelection
boolean ignoreCharacter
boolean ignoreModify
boolean ignoreResize
boolean lockText
int scrollWidth
int visibleCount
int cbtHook
static final int VISIBLE_COUNT
public static final int LIMIT
static final int CBID_LIST
static final int CBID_EDIT
static int EditProc
static int ListProc
static final int ComboProc
static final TCHAR ComboClass
public Combo(Composite parent, int style)
The style value is either one of the style constants defined in
class SWT which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int "|" operator) two or more
of those SWT style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent - a composite control which will be the parent of the new instance (cannot be null)style - the style of control to constructjava.lang.IllegalArgumentException - SWTException - SWT.DROP_DOWN,
SWT.READ_ONLY,
SWT.SIMPLE,
Widget.checkSubclass(),
Widget.getStyle()public void add(java.lang.String string)
string - the new itemjava.lang.IllegalArgumentException - SWTException - add(String,int)public void add(java.lang.String string,
int index)
Note: To add an item at the end of the list, use the
result of calling getItemCount() as the
index or use add(String).
string - the new itemindex - the index for the itemjava.lang.IllegalArgumentException - SWTException - add(String)public void addModifyListener(ModifyListener listener)
ModifyListener
interface.listener - the listener which should be notifiedjava.lang.IllegalArgumentException - SWTException - ModifyListener,
removeModifyListener(org.eclipse.swt.events.ModifyListener)public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
widgetSelected is called when the user changes the combo's list selection.
widgetDefaultSelected is typically called when ENTER is pressed the combo's text area.
listener - the listener which should be notifiedjava.lang.IllegalArgumentException - SWTException - SelectionListener,
removeSelectionListener(org.eclipse.swt.events.SelectionListener),
SelectionEventpublic void addVerifyListener(VerifyListener listener)
VerifyListener
interface.listener - the listener which should be notifiedjava.lang.IllegalArgumentException - SWTException - VerifyListener,
removeVerifyListener(org.eclipse.swt.events.VerifyListener)int callWindowProc(int hwnd,
int msg,
int wParam,
int lParam)
callWindowProc in class Scrollableint CBTProc(int nCode,
int wParam,
int lParam)
boolean checkHandle(int hwnd)
checkHandle in class Controlprotected void checkSubclass()
Widget
The SWT class library is intended to be subclassed
only at specific, controlled points (most notably,
Composite and Canvas when
implementing new widgets). This method enforces this
rule unless it is overridden.
IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
checkSubclass in class Compositestatic int checkStyle(int style)
public void clearSelection()
Note: To clear the selected items in the receiver's list,
use deselectAll().
SWTException - deselectAll()public Point computeSize(int wHint, int hHint, boolean changed)
Control
The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT is passed for the hint.
If the changed flag is true, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false, so layout
manager caches can be retained.
computeSize in class CompositewHint - the width hint (can be SWT.DEFAULT)hHint - the height hint (can be SWT.DEFAULT)changed - true if the control's contents have changed, and false otherwiseLayout,
Control.getBorderWidth(),
Control.getBounds(),
Control.getSize(),
Control.pack(boolean),
"computeTrim, getClientArea for controls that implement them"public void copy()
The current selection is copied to the clipboard.
SWTException - void createHandle()
createHandle in class Compositevoid createWidget()
createWidget in class Scrollablepublic void cut()
The current selection is first copied to the clipboard and then deleted from the widget.
SWTException - int defaultBackground()
defaultBackground in class Controlvoid deregister()
deregister in class Controlpublic void deselect(int index)
index - the index of the item to deselectSWTException - public void deselectAll()
Note: To clear the selection in the receiver's text field,
use clearSelection().
SWTException - clearSelection()boolean dragDetect(int hwnd,
int x,
int y,
boolean filter,
boolean[] detect,
boolean[] consume)
dragDetect in class Widgetpublic Point getCaretLocation()
SWTException - public int getCaretPosition()
Indexing is zero based.
SWTException - public java.lang.String getItem(int index)
index - the index of the item to returnjava.lang.IllegalArgumentException - SWTException - public int getItemCount()
SWTException - public int getItemHeight()
SWTException - public java.lang.String[] getItems()
Strings which are
the items in the receiver's list.
Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
SWTException - public boolean getListVisible()
true if the receiver's list 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.
SWTException - java.lang.String getNameText()
getNameText in class Widgetpublic void setListVisible(boolean visible)
true,
and marks it invisible otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
visible - the new visibility stateSWTException - public int getOrientation()
getOrientation in class ControlSWTException - public Point getSelection()
Point whose x coordinate is the
character position representing the start of the selection
in the receiver's text field, and whose y coordinate is the
character position representing the end of the selection.
An "empty" selection is indicated by the x and y coordinates
having the same value.
Indexing is zero based. The range of a selection is from 0..N where N is the number of characters in the widget.
SWTException - public int getSelectionIndex()
SWTException - public java.lang.String getText()
SWTException - public int getTextHeight()
SWTException - public int getTextLimit()
setTextLimit(), it will be the constant
Combo.LIMIT.SWTException - LIMITpublic int getVisibleItemCount()
Note: This operation is a hint and is not supported on platforms that do not have this concept.
SWTException - public int indexOf(java.lang.String string)
string - the search itemjava.lang.IllegalArgumentException - SWTException - public int indexOf(java.lang.String string,
int start)
string - the search itemstart - the zero-relative index at which to begin the searchjava.lang.IllegalArgumentException - SWTException - int mbcsToWcsPos(int mbcsPos)
public void paste()
The selected text is deleted from the widget and new text inserted from the clipboard.
SWTException - public void remove(int index)
index - the index for the itemjava.lang.IllegalArgumentException - SWTException - void remove(int index,
boolean notify)
public void remove(int start,
int end)
start - the start of the rangeend - the end of the rangejava.lang.IllegalArgumentException - SWTException - public void remove(java.lang.String string)
string - the item to removejava.lang.IllegalArgumentException - SWTException - public void removeAll()
SWTException - public void removeModifyListener(ModifyListener listener)
listener - the listener which should no longer be notifiedjava.lang.IllegalArgumentException - SWTException - ModifyListener,
addModifyListener(org.eclipse.swt.events.ModifyListener)public void removeSelectionListener(SelectionListener listener)
listener - the listener which should no longer be notifiedjava.lang.IllegalArgumentException - SWTException - SelectionListener,
addSelectionListener(org.eclipse.swt.events.SelectionListener)public void removeVerifyListener(VerifyListener listener)
listener - the listener which should no longer be notifiedjava.lang.IllegalArgumentException - SWTException - VerifyListener,
addVerifyListener(org.eclipse.swt.events.VerifyListener)boolean sendKeyEvent(int type,
int msg,
int wParam,
int lParam,
Event event)
sendKeyEvent in class Widgetpublic void select(int index)
index - the index of the item to selectSWTException - void setBackgroundImage(int hBitmap)
setBackgroundImage in class Controlvoid setBackgroundPixel(int pixel)
setBackgroundPixel in class Controlvoid setBounds(int x,
int y,
int width,
int height,
int flags)
public void setFont(Font font)
Controlvoid setForegroundPixel(int pixel)
setForegroundPixel in class Controlpublic void setItem(int index,
java.lang.String string)
index - the index for the itemstring - the new text for the itemjava.lang.IllegalArgumentException - SWTException - public void setItems(java.lang.String[] items)
items - the array of itemsjava.lang.IllegalArgumentException - SWTException - public void setOrientation(int orientation)
SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.
setOrientation in class Controlorientation - new orientation styleSWTException - void setScrollWidth()
void setScrollWidth(int scrollWidth)
void setScrollWidth(TCHAR buffer, boolean grow)
void setScrollWidth(int newWidth,
boolean grow)
public void setSelection(Point selection)
selection - a point representing the new selection start and endjava.lang.IllegalArgumentException - SWTException - public void setText(java.lang.String string)
This call is ignored when the receiver is read only and the given string is not in the receiver's list.
Note: The text field in a Combo is typically
only capable of displaying a single line of text. Thus,
setting the text to a string containing line breaks or
other special characters will probably cause it to
display incorrectly.
string - the new textjava.lang.IllegalArgumentException - SWTException - public void setTextLimit(int limit)
To reset this value to the default, use setTextLimit(Combo.LIMIT).
Specifying a limit value larger than Combo.LIMIT sets the
receiver's limit to Combo.LIMIT.
limit - new text limitjava.lang.IllegalArgumentException - SWTException - LIMITvoid setToolTipText(Shell shell, java.lang.String string)
setToolTipText in class Controlpublic void setVisibleItemCount(int count)
Note: This operation is a hint and is not supported on platforms that do not have this concept.
count - the new number of items to be visibleSWTException - boolean translateTraversal(MSG msg)
translateTraversal in class Compositeboolean traverseEscape()
traverseEscape in class Controlboolean traverseReturn()
traverseReturn in class Controlvoid unsubclass()
unsubclass in class Controlvoid updateDropDownHeight()
void updateOrientation()
updateOrientation in class Compositejava.lang.String verifyText(java.lang.String string,
int start,
int end,
Event keyEvent)
int wcsToMbcsPos(int wcsPos)
int widgetExtStyle()
widgetExtStyle in class Scrollableint widgetStyle()
widgetStyle in class CompositeTCHAR windowClass()
windowClass in class Scrollableint windowProc()
windowProc in class Scrollableint windowProc(int hwnd,
int msg,
int wParam,
int lParam)
windowProc in class ControlLRESULT WM_CTLCOLOR(int wParam, int lParam)
WM_CTLCOLOR in class ControlLRESULT WM_GETDLGCODE(int wParam, int lParam)
WM_GETDLGCODE in class CompositeLRESULT WM_KILLFOCUS(int wParam, int lParam)
WM_KILLFOCUS in class ControlLRESULT WM_LBUTTONDOWN(int wParam, int lParam)
WM_LBUTTONDOWN in class CompositeLRESULT WM_SETFOCUS(int wParam, int lParam)
WM_SETFOCUS in class ControlLRESULT WM_UPDATEUISTATE(int wParam, int lParam)
WM_UPDATEUISTATE in class CompositeLRESULT WM_WINDOWPOSCHANGING(int wParam, int lParam)
WM_WINDOWPOSCHANGING in class ControlLRESULT wmClipboard(int hwndText, int msg, int wParam, int lParam)
LRESULT wmCommandChild(int wParam, int lParam)
wmCommandChild in class ControlLRESULT wmSysKeyDown(int hwnd, int wParam, int lParam)
wmSysKeyDown in class Widget