private static void updateSelectionListener(final Tree tree) throws IOException { Boolean newValue = Boolean.valueOf(SelectionEvent.hasListener(tree)); String prop = PROP_SELECTION_LISTENERS; if (WidgetLCAUtil.hasChanged(tree, prop, newValue, Boolean.FALSE)) { JSWriter writer = JSWriter.getWriterFor(tree); writer.set("selectionListeners", newValue); } }
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); }