Beispiel #1
0
 private void writeColumnOrder(final Tree tree) throws IOException {
   JSWriter writer = JSWriter.getWriterFor(tree);
   int[] values = tree.getColumnOrder();
   if (values.length > 0) {
     Integer[] newValue = new Integer[values.length];
     for (int i = 0; i < values.length; i++) {
       newValue[i] = new Integer(values[i]);
     }
     if (WidgetLCAUtil.hasChanged(tree, PROP_COLUMN_ORDER, newValue, new Integer[] {})) {
       writer.set(PROP_COLUMN_ORDER, "columnOrder", newValue, null);
     }
   }
 }
Beispiel #2
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);
 }