Package org.fusesource.ide.commons.tree

Examples of org.fusesource.ide.commons.tree.Refreshable


    final Node parent = node.getParent();
    if (parent instanceof Refreshable) {
      final Viewer viewer = getViewer(node);
      final Object firstSelection = Selections.getFirstSelection(viewer);
      final String text = node.toString();
      Refreshable refreshable = (Refreshable) parent;
      refreshable.refresh();
      if (viewer != null) {
        Viewers.async(new Runnable() {
          @Override
          public void run() {
            if (firstSelection == node) {
              selectChild(viewer, parent, text);
            } else {
              addExpanded(viewer, parent, text);
            }
          }});
      }
    } else if (node instanceof Refreshable) {
      Refreshable refreshable = (Refreshable) node;
      refreshable.refresh();
    }

  }
View Full Code Here


    final Node parent = node.getParent();
    if (parent instanceof Refreshable) {
      final LinkedList<String> path = new LinkedList<String>();
      final Node root = getRootAndAppendPath(path, node);
      final Viewer viewer = getViewer(node);
      Refreshable refreshable = (Refreshable) parent;
      refreshable.refresh();
      if (viewer != null) {
        Viewers.async(new Runnable() {
          @Override
          public void run() {
            selectPath(viewer, root, path);
          }});
      }
    } else if (node instanceof Refreshable) {
      Refreshable refreshable = (Refreshable) node;
      refreshable.refresh();
    }

  }
View Full Code Here

    // as the parent node becomes a JvmConnectionWrapper rather than Root
    // so we can't easily find the nodes to expand again.
    //
    // refreshParent();
    if (getParent() instanceof Refreshable) {
      Refreshable refreshable = (Refreshable) getParent();
      refreshable.refresh();
    }

  }
View Full Code Here

    final Runnable addAction = new Runnable() {
      @Override
      public void run() {
        final SetHeaderDefinition sh = new SetHeaderDefinition("myHeaderName", new LanguageExpressionBean(CamelModelHelper.getDefaultLanguageName(), ""));
        final TableViewer viewer = tableView.getViewer();
        Refreshable refreshable = new Refreshable() {

          @Override
          public void refresh() {
            input.add(sh);
            viewer.setSelection(new StructuredSelection(sh));
            Viewers.refresh(viewer);
            layoutForm();
            panel.layout(true, true);
            fireNodePropertyChangedEvent(id);
          }
        };
        SetHeaderDialog.showDialog(sh, refreshable);
      }
    };
    final Runnable editAction = new Runnable() {
      @Override
      public void run() {
        Activator.getLogger().debug("Starting the edit...");

        final TableViewer viewer = tableView.getViewer();
        if (!viewer.getSelection().isEmpty()) {
          IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
          Iterator iter = selection.iterator();
          while (iter.hasNext()) {
            SetHeaderDefinition sh = toSetHeaderDefinition(iter.next());
            if (sh != null) {
              Refreshable refreshable = new Refreshable() {

                @Override
                public void refresh() {
                  Viewers.refresh(viewer);
                  fireNodePropertyChangedEvent(id);
View Full Code Here

   *            - node to refresh
   */
  private void refreshObjectNode(Object onode) {
    if (onode == null) return;
    if (onode instanceof Refreshable) {
      Refreshable refreshable = (Refreshable) onode;
      refreshable.refresh();
      refreshViewer(onode);
    }
  }
View Full Code Here

TOP

Related Classes of org.fusesource.ide.commons.tree.Refreshable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.