private static void writeClipBounds(final ScrolledComposite composite) throws IOException {
   Rectangle bounds = composite.getBounds();
   if (WidgetLCAUtil.hasChanged(composite, PROP_BOUNDS, bounds, null)) {
     JSWriter writer = JSWriter.getWriterFor(composite);
     writer.set("clipWidth", bounds.width);
     writer.set("clipHeight", bounds.height);
   }
 }
 private static void writeBarSelection(final ScrolledComposite composite) throws IOException {
   JSWriter writer = JSWriter.getWriterFor(composite);
   Integer hBarSelection = getBarSelection(composite.getHorizontalBar());
   if (hBarSelection != null) {
     writer.set(PROP_H_BAR_SELECTION, "hBarSelection", hBarSelection, ZERO);
   }
   Integer vBarSelection = getBarSelection(composite.getVerticalBar());
   if (vBarSelection != null) {
     writer.set(PROP_V_BAR_SELECTION, "vBarSelection", vBarSelection, ZERO);
   }
 }
Пример #3
0
 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 writeShowFocusedControl(final ScrolledComposite composite)
     throws IOException {
   Boolean newValue = Boolean.valueOf(composite.getShowFocusedControl());
   String prop = PROP_SHOW_FOCUSED_CONTROL;
   if (WidgetLCAUtil.hasChanged(composite, prop, newValue, Boolean.FALSE)) {
     JSWriter writer = JSWriter.getWriterFor(composite);
     writer.set("showFocusedControl", newValue);
   }
 }
 private static void writeSelectionListener(final ScrolledComposite composite) throws IOException {
   boolean hasListener = hasSelectionListener(composite);
   Boolean newValue = Boolean.valueOf(hasListener);
   String prop = Props.SELECTION_LISTENERS;
   if (WidgetLCAUtil.hasChanged(composite, prop, newValue, Boolean.FALSE)) {
     JSWriter writer = JSWriter.getWriterFor(composite);
     writer.set("hasSelectionListener", newValue);
   }
 }
Пример #6
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);
     }
   }
 }
Пример #7
0
 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);
   }
 }
Пример #8
0
 private void writeScrollLeft(final Tree tree) throws IOException {
   JSWriter writer = JSWriter.getWriterFor(tree);
   Integer newValue = getScrollLeft(tree);
   writer.set(PROP_SCROLL_LEFT, "scrollLeft", newValue, DEFAULT_SCROLL_LEFT);
 }
Пример #9
0
 private static void writeHeaderVisible(final Tree tree) throws IOException {
   JSWriter writer = JSWriter.getWriterFor(tree);
   Boolean newValue = Boolean.valueOf(tree.getHeaderVisible());
   writer.set(PROP_HEADER_VISIBLE, "headerVisible", newValue, Boolean.FALSE);
 }
Пример #10
0
 private static void writeHeaderHeight(final Tree tree) throws IOException {
   JSWriter writer = JSWriter.getWriterFor(tree);
   Integer newValue = new Integer(tree.getHeaderHeight());
   writer.set(PROP_HEADER_HEIGHT, "headerHeight", newValue, null);
 }
 private static void writeScrollBars(final ScrolledComposite composite) throws IOException {
   String overflow = getOverflow(composite);
   JSWriter writer = JSWriter.getWriterFor(composite);
   writer.set(PROP_OVERFLOW, "overflow", overflow, null);
 }