Example #1
0
 /**
  * Sets the receiver's text. The string may include the mnemonic character.
  *
  * <p>Mnemonics are indicated by an '&amp;' 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 '&amp;' can be escaped by doubling it in the string,
  * causing a single '&amp;' 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();
 }
Example #2
0
 void releaseWidget() {
   super.releaseWidget();
   display.releaseToolTipHandle(handle);
   if (parent.lastFocus == this) parent.lastFocus = null;
   control = null;
   toolTipText = null;
   image = disabledImage = hotImage = null;
 }
Example #3
0
 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();
 }
Example #4
0
 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();
   }
 }
Example #5
0
 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);
 }
Example #6
0
 void releaseHandle() {
   super.releaseHandle();
   parent = null;
 }
Example #7
0
 public void dispose() {
   if (isDisposed()) return;
   ToolBar parent = this.parent;
   super.dispose();
   parent.relayout();
 }
Example #8
0
 void destroyWidget() {
   parent.destroyItem(this);
   super.destroyWidget();
 }