コード例 #1
0
ファイル: Sash.java プロジェクト: sjhorn/eclipse.platform.swt
 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);
   }
 }
コード例 #2
0
 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);
   }
 }