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);
   }
 }
示例#2
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);
   }
 }
 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);
   }
 }
示例#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
 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);
 }
示例#8
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);
   }
 }
示例#9
0
 public void renderDispose(final Widget widget) throws IOException {
   JSWriter writer = JSWriter.getWriterFor(widget);
   writer.dispose();
 }
示例#10
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);
 }
示例#11
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);
 }
示例#12
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);
 }
 public void renderDispose(final Widget widget) throws IOException {
   ScrolledComposite composite = (ScrolledComposite) widget;
   JSWriter writer = JSWriter.getWriterFor(composite);
   writer.dispose();
 }
 public void renderInitialization(final Widget widget) throws IOException {
   ScrolledComposite scrolledComposite = (ScrolledComposite) widget;
   JSWriter writer = JSWriter.getWriterFor(scrolledComposite);
   writer.newWidget(QX_TYPE);
   ControlLCAUtil.writeStyleFlags(scrolledComposite);
 }
 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);
 }