예제 #1
0
 public void renderInitialization(final Widget widget) throws IOException {
   Tree tree = (Tree) widget;
   JSWriter writer = JSWriter.getWriterFor(tree);
   StringBuffer style = new StringBuffer();
   if ((tree.getStyle() & SWT.MULTI) != 0) {
     style.append("multi|");
   }
   if ((tree.getStyle() & SWT.CHECK) != 0) {
     style.append("check|");
   }
   if ((tree.getStyle() & SWT.VIRTUAL) != 0) {
     style.append("virtual|");
   }
   writer.newWidget("org.eclipse.swt.widgets.Tree", new Object[] {style.toString()});
   ControlLCAUtil.writeStyleFlags(tree);
 }
예제 #2
0
 int parseMnemonics(char[] buffer, int start, int end, StringBuffer result) {
   int mnemonic = -1, index = start;
   while (index < end) {
     if (buffer[index] == '&') {
       if (index + 1 < end && buffer[index + 1] == '&') {
         result.append(buffer[index]);
         index++;
       } else {
         mnemonic = result.length();
       }
     } else {
       result.append(buffer[index]);
     }
     index++;
   }
   return mnemonic;
 }