/** * Sets the receiver's text. The string may include the mnemonic character. * * <p>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. * * @param string the new text * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the text is null * </ul> * * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver * </ul> */ public void setText(String string) { checkWidget(); if (string == null) error(SWT.ERROR_NULL_ARGUMENT); if ((style & SWT.SEPARATOR) != 0) return; super.setText(string); parent.relayout(); redraw(); }
void releaseWidget() { super.releaseWidget(); display.releaseToolTipHandle(handle); if (parent.lastFocus == this) parent.lastFocus = null; control = null; toolTipText = null; image = disabledImage = hotImage = null; }
public void setImage(Image image) { checkWidget(); if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); if ((style & SWT.SEPARATOR) != 0) return; super.setImage(image); parent.relayout(); redraw(); }
void createWidget(int index) { super.createWidget(index); int topHandle = topHandle(); if (OS.XtIsRealized(topHandle)) { /* * Make sure that the widget has been properly realized * because the widget was created after the parent * has been realized. */ realizeChildren(); } }
void hookEvents() { super.hookEvents(); if ((style & SWT.SEPARATOR) != 0) return; int windowProc = display.windowProc; OS.XtAddEventHandler(handle, OS.KeyPressMask, false, windowProc, KEY_PRESS); OS.XtAddEventHandler(handle, OS.KeyReleaseMask, false, windowProc, KEY_RELEASE); OS.XtAddEventHandler(handle, OS.ButtonPressMask, false, windowProc, BUTTON_PRESS); OS.XtAddEventHandler(handle, OS.ButtonReleaseMask, false, windowProc, BUTTON_RELEASE); OS.XtAddEventHandler(handle, OS.PointerMotionMask, false, windowProc, POINTER_MOTION); OS.XtAddEventHandler(handle, OS.EnterWindowMask, false, windowProc, ENTER_WINDOW); OS.XtAddEventHandler(handle, OS.LeaveWindowMask, false, windowProc, LEAVE_WINDOW); OS.XtAddCallback(handle, OS.XmNexposeCallback, windowProc, EXPOSURE_CALLBACK); OS.XtInsertEventHandler( handle, OS.FocusChangeMask, false, windowProc, FOCUS_CHANGE, OS.XtListTail); }
void releaseHandle() { super.releaseHandle(); parent = null; }
public void dispose() { if (isDisposed()) return; ToolBar parent = this.parent; super.dispose(); parent.relayout(); }
void destroyWidget() { parent.destroyItem(this); super.destroyWidget(); }