public void preserveValues(final Widget widget) {
   ScrolledComposite composite = (ScrolledComposite) widget;
   ControlLCAUtil.preserveValues(composite);
   IWidgetAdapter adapter = WidgetUtil.getAdapter(composite);
   adapter.preserve(PROP_BOUNDS, composite.getBounds());
   adapter.preserve(PROP_OVERFLOW, getOverflow(composite));
   adapter.preserve(PROP_H_BAR_SELECTION, getBarSelection(composite.getHorizontalBar()));
   adapter.preserve(PROP_V_BAR_SELECTION, getBarSelection(composite.getVerticalBar()));
   adapter.preserve(Props.SELECTION_LISTENERS, Boolean.valueOf(hasSelectionListener(composite)));
   adapter.preserve(PROP_SHOW_FOCUSED_CONTROL, Boolean.valueOf(composite.getShowFocusedControl()));
   WidgetLCAUtil.preserveCustomVariant(composite);
 }
 public void preserveValues(final Widget widget) {
   ControlLCAUtil.preserveValues((Control) widget);
   Shell shell = (Shell) widget;
   IWidgetAdapter adapter = WidgetUtil.getAdapter(shell);
   adapter.preserve(PROP_ACTIVE_CONTROL, getActiveControl(shell));
   adapter.preserve(PROP_ACTIVE_SHELL, shell.getDisplay().getActiveShell());
   adapter.preserve(PROP_TEXT, shell.getText());
   adapter.preserve(PROP_IMAGE, shell.getImage());
   adapter.preserve(PROP_ALPHA, new Integer(shell.getAlpha()));
   adapter.preserve(PROP_MODE, getMode(shell));
   adapter.preserve(PROP_FULLSCREEN, Boolean.valueOf(shell.getFullScreen()));
   adapter.preserve(PROP_SHELL_LISTENER, Boolean.valueOf(ShellEvent.hasListener(shell)));
   adapter.preserve(PROP_SHELL_MENU, shell.getMenuBar());
   adapter.preserve(PROP_MINIMUM_SIZE, shell.getMinimumSize());
   WidgetLCAUtil.preserveCustomVariant(shell);
 }
Beispiel #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);
   }
 }
Beispiel #4
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);
 }
 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 writeFullScreen(final Shell shell) throws IOException {
   Object defValue = Boolean.FALSE;
   Boolean newValue = Boolean.valueOf(shell.getFullScreen());
   if (WidgetLCAUtil.hasChanged(shell, PROP_FULLSCREEN, newValue, defValue)) {
     //      JSWriter writer = JSWriter.getWriterFor( shell );
     //      writer.set( "fullScreen", newValue );
     IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell);
     synchronizer.setWidgetProperty("fullScreen", newValue);
   }
 }
 private static void writeOpen(final Shell shell) throws IOException {
   // TODO [rst] workaround: qx window should be opened only once.
   Boolean defValue = Boolean.FALSE;
   Boolean actValue = Boolean.valueOf(shell.getVisible());
   if (WidgetLCAUtil.hasChanged(shell, Props.VISIBLE, actValue, defValue) && shell.getVisible()) {
     //      JSWriter writer = JSWriter.getWriterFor( shell );
     //      writer.call( "open", null );
     IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell);
     synchronizer.call("open");
   }
 }
 private static void writeCloseListener(final Shell shell) throws IOException {
   //    JSWriter writer = JSWriter.getWriterFor( shell );
   Boolean newValue = Boolean.valueOf(ShellEvent.hasListener(shell));
   Boolean defValue = Boolean.FALSE;
   //    writer.set( PROP_SHELL_LISTENER, "hasShellListener", newValue, defValue );
   boolean hasChanged = WidgetLCAUtil.hasChanged(shell, PROP_SHELL_LISTENER, newValue, defValue);
   if (hasChanged) {
     IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell);
     if (newValue.booleanValue()) {
       synchronizer.addListener("closelistener");
     } else {
       synchronizer.removeListener("closelistener");
     }
   }
 }
Beispiel #10
0
  public void modelChanged(IModelChangedEvent e) {
    // No need to call super, handling world changed event here
    if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) {
      handleModelEventWorldChanged(e);
      return;
    }

    String prop = e.getChangedProperty();
    Object[] objects = e.getChangedObjects();
    if (prop == null || objects == null || !(objects[0] instanceof IProduct)) return;
    if (prop.equals(IProduct.P_UID)) {
      fIdEntry.setValue(e.getNewValue().toString(), true);
    } else if (prop.equals(IProduct.P_NAME)) {
      fNameEntry.setValue(e.getNewValue().toString(), true);
    } else if (prop.equals(IProduct.P_VERSION)) {
      fVersionEntry.setValue(e.getNewValue().toString(), true);
    } else if (prop.equals(IProduct.P_INCLUDE_LAUNCHERS)) {
      fLaunchersButton.setSelection(Boolean.valueOf(e.getNewValue().toString()).booleanValue());
    }
  }
Beispiel #11
0
 private static Boolean hasVScrollBar(final Tree tree) {
   Object adapter = tree.getAdapter(ITreeAdapter.class);
   ITreeAdapter treeAdapter = (ITreeAdapter) adapter;
   return Boolean.valueOf(treeAdapter.hasVScrollBar());
 }
Beispiel #12
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);
 }