Example #1
0
 public void readData(final Widget widget) {
   Tree tree = (Tree) widget;
   readSelection(tree);
   readScrollPosition(tree);
   processWidgetSelectedEvent(tree);
   processWidgetDefaultSelectedEvent(tree);
   ControlLCAUtil.processMouseEvents(tree);
   ControlLCAUtil.processKeyEvents(tree);
   ControlLCAUtil.processMenuDetect(tree);
   WidgetLCAUtil.processHelp(tree);
 }
Example #2
0
 public void renderChanges(final Widget widget) throws IOException {
   Tree tree = (Tree) widget;
   ControlLCAUtil.writeChanges(tree);
   updateSelectionListener(tree);
   writeHeaderHeight(tree);
   writeHeaderVisible(tree);
   writeColumnOrder(tree);
   writeScrollLeft(tree);
   writeOverflow(tree);
   WidgetLCAUtil.writeCustomVariant(tree);
 }
Example #3
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);
 }
Example #4
0
 public void preserveValues(final Widget widget) {
   Tree tree = (Tree) widget;
   ControlLCAUtil.preserveValues((Control) widget);
   IWidgetAdapter adapter = WidgetUtil.getAdapter(tree);
   adapter.preserve(PROP_SELECTION_LISTENERS, Boolean.valueOf(SelectionEvent.hasListener(tree)));
   adapter.preserve(PROP_HEADER_HEIGHT, new Integer(tree.getHeaderHeight()));
   adapter.preserve(PROP_HEADER_VISIBLE, Boolean.valueOf(tree.getHeaderVisible()));
   int[] values = tree.getColumnOrder();
   Integer[] columnOrder = new Integer[values.length];
   for (int i = 0; i < values.length; i++) {
     columnOrder[i] = new Integer(values[i]);
   }
   adapter.preserve(PROP_COLUMN_ORDER, columnOrder);
   adapter.preserve(PROP_SCROLL_LEFT, getScrollLeft(tree));
   adapter.preserve(PROP_HAS_H_SCROLL_BAR, hasHScrollBar(tree));
   adapter.preserve(PROP_HAS_V_SCROLL_BAR, hasVScrollBar(tree));
   WidgetLCAUtil.preserveCustomVariant(tree);
 }