Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.TreePath


            private ISelection toTreePathSelection( List<IGeoResource> exported ) {

                List<TreePath> paths = new ArrayList<TreePath>(exported.size());

                for( IGeoResource resource : exported ) {
                    paths.add(new TreePath(toTreePath(resource).toArray()));
                }
                return new TreeSelection(paths.toArray(new TreePath[paths.size()]));
            }

            private List<IResolve> toTreePath( IGeoResource resource ) {
View Full Code Here


    Control ctrl = super.createContents(parent);
    if (imgFile != null) {
      IJavaProject prj = VisualSwingPlugin.getCurrentProject();
      Stack<Object> stack = new Stack<Object>();
      if (buildPath(imgFile, prj, stack)) {
        TreePath path = new TreePath(stack.toArray());
        view.expandToLevel(path, 0);
        view.expandAll();
        view.setSelection(new StructuredSelection(imgFile));
      }
    }
View Full Code Here

    Control ctrl = super.createContents(parent);
    if (imgFile != null) {
      IJavaProject prj = VisualSwingPlugin.getCurrentProject();
      Stack<Object> stack = new Stack<Object>();
      if (buildPath(imgFile, prj, stack)) {
        TreePath path = new TreePath(stack.toArray());
        view.expandToLevel(path, 0);
        view.expandAll();
        view.setSelection(new StructuredSelection(imgFile));
      }
    }
View Full Code Here

    objects.add(input);
    objects.add(designer);
    addPathObject(objects, component);
    Object[] array = new Object[objects.size()];
    objects.toArray(array);
    TreePath treePath = new TreePath(array);
    return treePath;
  }
View Full Code Here

      }

      if (tsd == null || cas == null) {
        return Status.CANCEL_STATUS;
      }
      TreePath treePath = null;
      final IAnnotationCheckTreeNode root = new AnnotationCheckRootNode();
      for (File file : listFiles) {
        cas.reset();
        try {
          XmiCasDeserializer.deserialize(new FileInputStream(file), cas, true);
        } catch (FileNotFoundException e) {
          RutaAddonsPlugin.error(e);
        } catch (SAXException e) {
          RutaAddonsPlugin.error(e);
        } catch (IOException e) {
          RutaAddonsPlugin.error(e);
        }
        CheckDocument element = getCheckDocument(docs, file.getAbsolutePath());
        boolean documentAlreadyDone = documentAlreadyDoneforTypes(element, new LinkedList<String>(
                typesToCheck.keySet()));
        if (!documentAlreadyDone) {
          AnnotationCheckTreeNode node = new AnnotationCheckTreeNode(root, element);
          root.addChild(node);
          AnnotationIndex<AnnotationFS> annotationIndex = cas.getAnnotationIndex();
          for (AnnotationFS each : annotationIndex) {
            boolean annotationAlreadyDoneforTypes = annotationAlreadyDoneforTypes(each,
                    typesToCheck.keySet(), element.checkedTypes);
            if (!annotationAlreadyDoneforTypes) {
              CheckElement ac = new CheckAnnotation(each);
              AnnotationCheckTreeNode anode = new AnnotationCheckTreeNode(node, ac);
              for (String feature : typesToCheck.get(each.getType().getName())) {
                anode.addChild(new FeatureCheckTreeNode(anode, each.getType().getFeatureByBaseName(
                        feature), each.getFeatureValueAsString(each.getType().getFeatureByBaseName(
                        feature))));
              }
              if (treePath == null) {
                treePath = new TreePath(new Object[] { root, node, anode });
              }
              node.addChild(anode);
            }
          }
          if (treePath == null) {
            treePath = new TreePath(new Object[] { root, node });
          }
        }
      }
      if (root.getChildren().length == 0) {
        return Status.OK_STATUS;
      }
      if (previousSelection != null) {
        CheckElement element = previousSelection.getElement();
        TreePath oldPath = getPathTo(element, root);
        if (oldPath != null) {
          treePath = oldPath;
        }
      }
      final TreeSelection firstSelection = new TreeSelection(treePath);
View Full Code Here

      for (AnnotationCheckTreeNode eachDocNode : children) {
        if (element instanceof CheckAnnotation) {
          AnnotationCheckTreeNode[] children2 = eachDocNode.getChildren();
          for (AnnotationCheckTreeNode eachANode : children2) {
            if (isSameElement(eachANode.getElement(), element)) {
              return new TreePath(new Object[] { root, eachDocNode, eachANode });
            }
          }
        } else {
          if (isSameElement(eachDocNode.getElement(), element)) {
            return new TreePath(new Object[] { root, eachDocNode });
          }
        }

      }
      return null;
View Full Code Here

        if (uncle.getChildren().length != 0) {
          brother = uncle.getChildren()[0];
        }
      }
    }
    TreePath treePath = null;
    if (brother == null) {
      treePath = new TreePath(new Object[] { treeView.getInput(), uncle });
    } else {
      treePath = new TreePath(new Object[] { treeView.getInput(), uncle, brother });

    }
    final TreeSelection newSelection = new TreeSelection(treePath);
    treeView.setSelection(newSelection, true);
    treeView.expandToLevel(((AnnotationCheckTreeNode) newSelection.getFirstElement()).getParent(),
View Full Code Here

    IProject project = getExtendedSelectedProject(stucturedSelection.getFirstElement());
    if(project != null) {
      return project;
    }
    if(selection instanceof TreeSelection && (((TreeSelection)selection).getPaths().length > 0)){
      TreePath path = (((TreeSelection)selection).getPaths()[0]);
      if(path.getSegmentCount() > 0 && path.getSegment(0) instanceof IProject) {
        return (IProject) path.getSegment(0);
      }
    }
    return null;
  }
View Full Code Here

    IProject project = getExtendedSelectedProject(stucturedSelection.getFirstElement());
    if(project != null) {
      return project;
    }
    if(selection instanceof TreeSelection && (((TreeSelection)selection).getPaths().length > 0)){
      TreePath path = (((TreeSelection)selection).getPaths()[0]);
      if(path.getSegmentCount() > 0 && path.getSegment(0) instanceof IProject) {
        return (IProject) path.getSegment(0);
      }
    }
    return null;
  }
View Full Code Here

    IProject project = getExtendedSelectedProject(stucturedSelection.getFirstElement());
    if(project != null) {
      return project;
    }
    if(selection instanceof TreeSelection && (((TreeSelection)selection).getPaths().length > 0)){
      TreePath path = (((TreeSelection)selection).getPaths()[0]);
      if(path.getSegmentCount() > 0 && path.getSegment(0) instanceof IProject) {
        return (IProject) path.getSegment(0);
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.TreePath

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.