Exemplo n.º 1
0
 void updateViewport() {
   baseEditor.lineCountEvent(text.getLineCount());
   int start = 0;
   try {
     start = text.getTopIndex() - 1;
   } catch (Exception e) {
     e.printStackTrace(System.out);
   }
   if (start < 0) start = 0;
   int end = start + text.getClientArea().height / text.getLineHeight();
   baseEditor.visibleTextEvent(start, end - start + 2);
 }
Exemplo n.º 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);
   }
 }