java.lang.Object | +--org.eclipse.swt.widgets.Widget | +--org.eclipse.swt.widgets.Control | +--org.eclipse.swt.widgets.Button
Safe:
ACCENTS, accessible, background, drawCount, foreground, handle, hCursor, layoutData, menu, parent, toolTipText
CANVAS, COMCTL32_MAJOR, COMCTL32_MINOR, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, DISPOSED, eventTable, HIDDEN, keys, MAJOR, MINOR, Mnemonic, state, style, values
Button(Composite parent,
int style)
void
addSelectionListener(SelectionListener listener)
SelectionListener
interface.
int
getAlignment()
String
getText()
void
removeSelectionListener(SelectionListener listener)
void
setAlignment(int alignment)
void
setImage(Image image)
void
setSelection(boolean selected)
CHECK,
RADIO, or TOGGLE.
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, checkOrientation, computeSize, computeTabGroup, computeTabList, computeTabRoot, createHandle, createWidget, defaultFont, deregister, destroyWidget, drawBackground, drawBackground, findBrush, findCursor, findMnemonic, fixFocus, forceFocus, forceResize, getAccessible, getBackground, getBackgroundPixel, getBorderWidth, getBounds, getCodePage, getDisplay, getEnabled, getFont, getForeground, getForegroundPixel, getLayoutData, getLocation, getMenu, getParent, getPath, getShell, getSize, getToolTipText, getVisible, hasCursor, hasFocus, internal_dispose_GC, internal_new_GC, isActive, isDisposed, isEnabled, isFocusAncestor, isFocusControl, isReparentable, isShowing, isTabGroup, isVisible, menuShell, moveAbove, moveBelow, new_Accessible, pack, pack, redraw, redraw, register, releaseHandle, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, setBackground, setBackgroundPixel, setBounds, setBounds, setBounds, setCapture, setCursor, setDefaultFont, setEnabled, setFont, setForeground, setForegroundPixel, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setTabGroupFocus, setTabItemFocus, setToolTipText, setVisible, sort, subclass, toControl, toControl, toDisplay, toDisplay, transferActive, transferFocus, translateAccelerator, translateMnemonic, translateMnemonic, translateTraversal, traverse, traverse, traverseEscape, traverseGroup, traverseItem, traverseMnemonic, traversePage, traverseReturn, unsubclass, update, update, updateFont, widgetExtStyle, windowProc, WM_ACTIVATE, WM_CHAR, WM_CLEAR, WM_CLOSE, WM_COMMAND, WM_CONTEXTMENU, WM_CTLCOLOR, WM_CUT, WM_DESTROY, WM_DRAWITEM, WM_ENDSESSION, WM_ERASEBKGND, WM_GETFONT, WM_GETOBJECT, WM_HELP, WM_HOTKEY, WM_HSCROLL, WM_IME_CHAR, WM_IME_COMPOSITION, WM_INITMENUPOPUP, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDBLCLK, WM_LBUTTONDOWN, WM_LBUTTONUP, WM_MBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MEASUREITEM, WM_MENUCHAR, WM_MENUSELECT, WM_MOUSEACTIVATE, WM_MOUSEHOVER, WM_MOUSELEAVE, WM_MOUSEMOVE, WM_MOUSEWHEEL, WM_MOVE, WM_NCACTIVATE, WM_NCCALCSIZE, WM_NCHITTEST, WM_NOTIFY, WM_PAINT, WM_PALETTECHANGED, WM_PASTE, WM_PRINTCLIENT, WM_QUERYENDSESSION, WM_QUERYNEWPALETTE, WM_QUERYOPEN, WM_RBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SETCURSOR, WM_SETFONT, WM_SETREDRAW, WM_SETTINGCHANGE, WM_SHOWWINDOW, WM_SIZE, WM_SYSCHAR, WM_SYSCOLORCHANGE, WM_SYSCOMMAND, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_TIMER, WM_UNDO, WM_VSCROLL, WM_WINDOWPOSCHANGING, wmColorChild, wmMeasureChild, wmNotifyChild, wmScrollChild
addDisposeListener, addListener, checkBits, checkParent, checkSubclass, checkWidget, dispose, error, filters, getData, getData, getName, getStyle, hooks, isListening, isValidSubclass, isValidThread, mbcsToWcs, mbcsToWcs, notifyListeners, postEvent, postEvent, releaseChild, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, toString, wcsToMbcs, wcsToMbcs
Image image
static final int ButtonProc
static final org.eclipse.swt.internal.win32.TCHAR ButtonClass
static final int CheckWidth
static final int CheckHeight
public Button(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 constructSWT.ARROW,
SWT.CHECK,
SWT.PUSH,
SWT.RADIO,
SWT.TOGGLE,
SWT.FLAT,
SWT.LEFT,
SWT.RIGHT,
SWT.CENTER,
Widget.checkSubclass(),
Widget.getStyle()public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
widgetSelected is called when the control is selected.
widgetDefaultSelected is not called.
listener - the listener which should be notifiedSelectionListener,
removeSelectionListener(org.eclipse.swt.events.SelectionListener),
SelectionEventint callWindowProc(int msg, int wParam, int lParam)
callWindowProc in class Controlstatic int checkStyle(int style)
void click()
public Point computeSize(int wHint, int hHint, boolean changed)
computeSize in class ControlwHint - 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 otherwise
Layout,
Control.getBorderWidth(),
Control.getBounds(),
Control.getSize(),
Control.pack(),
"computeTrim, getClientArea for controls that implement them"int defaultBackground()
defaultBackground in class Controlint defaultForeground()
defaultForeground in class Controlpublic int getAlignment()
LEFT, RIGHT or CENTER
unless the receiver is an ARROW button, in
which case, the alignment will indicate the direction of
the arrow (one of LEFT, RIGHT,
UP or DOWN).
boolean getDefault()
public Image getImage()
String getNameText()
getNameText in class Widgetpublic boolean getSelection()
true if the receiver is selected,
and false otherwise.
When the receiver is of type CHECK or RADIO,
it is selected when it is checked. When it is of type TOGGLE,
it is selected when it is pushed in. If the receiver is of any other type,
this method returns false.
public String getText()
boolean isTabItem()
boolean mnemonicHit(char ch)
mnemonicHit in class Controlboolean mnemonicMatch(char key)
mnemonicMatch in class Controlvoid releaseWidget()
releaseWidget in class Controlpublic void removeSelectionListener(SelectionListener listener)
listener - the listener which should be notifiedSelectionListener,
addSelectionListener(org.eclipse.swt.events.SelectionListener)void selectRadio()
public void setAlignment(int alignment)
LEFT, RIGHT or CENTER
unless the receiver is an ARROW button, in
which case, the argument indicates the direction of
the arrow (one of LEFT, RIGHT,
UP or DOWN).
alignment - the new alignmentvoid setDefault(boolean value)
public boolean setFocus()
true if the control got focus, and false if it was unable to.Control.forceFocus()public void setImage(Image image)
image - the image to display on the receiver (may be null)boolean setRadioFocus()
setRadioFocus in class Controlboolean setRadioSelection(boolean value)
setRadioSelection in class Controlboolean setSavedFocus()
setSavedFocus in class Controlpublic void setSelection(boolean selected)
CHECK,
RADIO, or TOGGLE.
When the receiver is of type CHECK or RADIO,
it is selected when it is checked. When it is of type TOGGLE,
it is selected when it is pushed in.
selected - the new selection statepublic void setText(String string)
This method sets the button label. The label may include the mnemonic character but must not contain line delimiters.
Mnemonics are indicated by an '&' that causes the next character to be the mnemonic. When the user presses a key sequence that matches the mnemonic, a selection event occurs. On most platforms, the mnemonic appears underlined but may be emphasised in a platform specific manner. The mnemonic indicator character '&' can be escaped by doubling it in the string, causing a single '&' to be displayed.
string - the new textint widgetStyle()
widgetStyle in class Controlorg.eclipse.swt.internal.win32.TCHAR windowClass()
windowClass in class Controlint windowProc()
windowProc in class Controlorg.eclipse.swt.internal.win32.LRESULT WM_GETDLGCODE(int wParam, int lParam)
WM_GETDLGCODE in class Controlorg.eclipse.swt.internal.win32.LRESULT WM_KILLFOCUS(int wParam, int lParam)
WM_KILLFOCUS in class Controlorg.eclipse.swt.internal.win32.LRESULT WM_SETFOCUS(int wParam, int lParam)
WM_SETFOCUS in class Controlorg.eclipse.swt.internal.win32.LRESULT wmCommandChild(int wParam, int lParam)
wmCommandChild in class Controlorg.eclipse.swt.internal.win32.LRESULT wmDrawChild(int wParam, int lParam)
wmDrawChild in class Control