Beispiel #1
0
 public void setCursor(Cursor cursor) {
   checkWidget();
   super.setCursor(cursor);
   if (cursor == null && this.cursor != 0) {
     int xWindow = OS.XtWindow(handle);
     if (xWindow == 0) return;
     int xDisplay = OS.XtDisplay(handle);
     if (xDisplay == 0) return;
     OS.XDefineCursor(xDisplay, xWindow, this.cursor);
     OS.XFlush(xDisplay);
   }
 }
 private void updateCursor(final String selection) {
   Cursor cursor = null;
   Class swtClass = SWT.class;
   if (selection != null) {
     try {
       Field field = swtClass.getField(selection);
       int cursorStyle = field.getInt(swtClass);
       cursor = Display.getCurrent().getSystemCursor(cursorStyle);
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     control.setCursor(cursor);
   }
 }