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);
   }
 }
 private static void writeOverflow(final Tree tree) throws IOException {
   boolean hasHChanged =
       WidgetLCAUtil.hasChanged(tree, PROP_HAS_H_SCROLL_BAR, hasHScrollBar(tree), Boolean.TRUE);
   boolean hasVChanged =
       WidgetLCAUtil.hasChanged(tree, PROP_HAS_V_SCROLL_BAR, hasVScrollBar(tree), Boolean.TRUE);
   if (hasHChanged || hasVChanged) {
     boolean scrollX = hasHScrollBar(tree).booleanValue();
     boolean scrollY = hasVScrollBar(tree).booleanValue();
     String overflow;
     if (scrollX && scrollY) {
       overflow = "scroll";
     } else if (scrollX) {
       overflow = "scrollX";
     } else if (scrollY) {
       overflow = "scrollY";
     } else {
       overflow = "hidden";
     }
     JSWriter writer = JSWriter.getWriterFor(tree);
     writer.set("treeOverflow", overflow);
   }
 }
 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);
     }
   }
 }