Exemplo n.º 1
0
  void setData(final Repository localDb, final PushOperationResult result) {
    reader = localDb.newObjectReader();
    repo = localDb;

    // Set empty result for a while.
    treeViewer.setInput(null);

    if (result == null) {
      root.layout();
      return;
    }

    final List<RefUpdateElement> results = new ArrayList<RefUpdateElement>();

    for (URIish uri : result.getURIs())
      if (result.isSuccessfulConnection(uri))
        for (RemoteRefUpdate update : result.getPushResult(uri).getRemoteUpdates())
          results.add(new RefUpdateElement(result, update, uri, reader, repo));

    treeViewer.setInput(results.toArray());
    // select the first row of table to get the details of the first
    // push result shown in the Text control
    Tree table = treeViewer.getTree();
    if (table.getItemCount() > 0)
      treeViewer.setSelection(new StructuredSelection(table.getItem(0).getData()));
    root.layout();
  }
  private void loadViewPanesVisibility() {
    String visiblePanes =
        Platform.getPreferencesService()
            .getString(DebugUIPlugin.getUniqueIdentifier(), getVisibilityPrefId(), null, null);

    if (visiblePanes != null && visiblePanes.length() > 0) {
      StringTokenizer tokenizer = new StringTokenizer(visiblePanes, ","); // $NON-NLS-1$
      while (tokenizer.hasMoreTokens()) {
        String paneId = tokenizer.nextToken();
        fVisibleViewPanes.add(paneId);
      }
    } else {
      for (int i = 0; i < defaultVisiblePaneIds.length; i++) {
        fVisibleViewPanes.add(defaultVisiblePaneIds[i]);
      }
    }

    Enumeration<String> enumeration = fViewPaneControls.keys();
    while (enumeration.hasMoreElements()) {
      String paneId = enumeration.nextElement();
      boolean visible = false;
      if (fVisibleViewPanes.contains(paneId)) visible = true;

      Control control = fViewPaneControls.get(paneId);
      control.setVisible(visible);

      IMemoryViewPane viewPane = fViewPanes.get(paneId);
      viewPane.setVisible(visible);
    }

    fSashForm.layout();
  }
Exemplo n.º 3
0
  public Text findOrCreateText(RemoteServerDetails remoteServerDetails) {
    for (ServerText serverText : textList) {
      if (serverText.remoteServerDetails.equals(remoteServerDetails)) {
        return serverText.text;
      }
    }

    ServerText serverText = new ServerText(sashForm, remoteServerDetails);
    sashForm.layout(true);
    textList.add(serverText);
    return serverText.text;
  }
Exemplo n.º 4
0
 public void setMode(int mode) {
   if (this.mode != mode) {
     this.mode = mode;
     ArrayList<AbstractArrayController> controllers =
         new ArrayList<AbstractArrayController>(historyControllers);
     for (AbstractArrayController controller : controllers) {
       controller.getView().dispose();
     }
     historyControllers.clear();
     for (AbstractArrayController controller : controllers) {
       createArrayController(viewsArea, controller.exp, controller.field);
     }
     viewsArea.layout();
   }
 }
 public void setInput(Object object) {
   selected = (XModelObject) object;
   String[] h = editor.getHelper().getHeader();
   editor.getHelper().setEntity(selected.getModelEntity(), 0);
   if (h != editor.getHelper().getHeader()) {
     if (composite != null) {
       editor.getControl().dispose();
       editor.createControl(composite);
       composite.setWeights(new int[] {15, 30});
       composite.update();
       composite.layout();
     }
   }
   editor.setObject(selected);
   editor.update();
   properties.setInput(selected);
 }
 public void run() {
   if (defaultComponent.equals(currentComponent)) {
     // do nothing, we cannot close the default component
   } else {
     // set the default as the current
     ViewersMultiSandboxViewComponent target = getCurrentComponent();
     setCurrentComponent(defaultComponent);
     // remove selection changed listeners
     for (ISelectionChangedListener l :
         defaultComponent.selectionHelper.selectionChangedListeners) {
       target.removeSelectionChangedListener(l);
     }
     target.dispose();
     additionalComponents.remove(target);
     container.layout();
   }
 }
 public void run() {
   ViewersMultiSandboxViewComponent newC =
       new ViewersMultiSandboxViewComponent(ViewersMultiSandboxView.this);
   additionalComponents.add(newC);
   // add selection changed listeners
   for (ISelectionChangedListener l :
       defaultComponent.selectionHelper.selectionChangedListeners) {
     newC.addSelectionChangedListener(l);
   }
   // set contents from default
   try {
     newC.initializeContents(defaultComponent.initialConfiguration);
   } catch (ViatraQueryException e) {
     log("addNewComponentAction.run", e);
   }
   // container.pack();
   container.layout();
 }
  /*
   * (non-Javadoc)
   * @see
   * org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#showViewPane
   * (boolean, java.lang.String)
   */
  public void showViewPane(boolean show, String paneId) {

    Control viewPaneControl = fViewPaneControls.get(paneId);

    if (viewPaneControl != null) {
      Control children[] = fSashForm.getChildren();

      for (int i = 0; i < children.length; i++) {
        if (children[i] == viewPaneControl) {
          children[i].setVisible(show);
          IMemoryViewPane viewPane = fViewPanes.get(paneId);
          if (viewPane != null) viewPane.setVisible(show);
        }
      }
      fSashForm.layout();
    }

    storeViewPaneVisibility();
  }
Exemplo n.º 9
0
 /** {@inheritDoc} */
 @Override
 public void layout() {
   sashForm.layout();
 }