Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.TreePath


    //     2 - 2 - 4  // Value of this path is 10
    //       \
    //         3 - 2  // Value of this path is 2
    //
    // @formatter:on
    TreePath leaf1 = new TreePath(new Object[]{"1", "2", "3"});
    TreePath leaf2 = new TreePath(new Object[]{"2", "2", "4"});
    TreePath leaf3 = new TreePath(new Object[]{"2", "3", "2"});

    // And element "2" belongs to a different category:
    ICategory theCategory = mock(ICategory.class);
    ICategory tmpCategory = mock(ICategory.class);
    ICategorizer categorizer = mock(ICategorizer.class);
View Full Code Here


    for (TreePath parent : parents) {
      Object[] children = provider.getChildren(parent);
      for (Object child : children) {
        if (child == element) {
          TreePath currentPath = parent.createChildPath(child);
          if (isMatch(viewer, currentPath)) {
            return true;
          }
        }
      }
View Full Code Here

    List<Object> segments = newArrayListWithCapacity(endIndex);
    for (int i = 0; i < endIndex; ++i) {
      segments.add(path.getSegment(i));
    }
    return new TreePath(segments.toArray());
  }
View Full Code Here

  public void paint(Event event, Object element) {
    if (!valueProvider.shouldPaint(element)) {
      return;
    }

    TreePath path = getTreePath((TreeItem) event.item);
    int columnWidth = event.gc.getClipping().width;
    int width = getWidth(columnWidth, path);
    if (width == 0) {
      return;
    }
View Full Code Here

    List<Object> segments = newLinkedList();
    while (item != null) {
      segments.add(0, item.getData());
      item = item.getParentItem();
    }
    return new TreePath(segments.toArray());
  }
View Full Code Here

        default:
          break;
        }
      }
      segments.add(data.get(ITaskData.DURATION));
      result.add(new TreePath(segments.toArray()));
    }

    return result;
  }
View Full Code Here

          }
          break;
        }
      }
      segments.add(data.get(IJavaData.DURATION));
      result.add(new TreePath(segments.toArray()));
    }

    return result;
  }
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);
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, selectedTypes);
        if (!documentAlreadyDone) {
          AnnotationCheckTreeNode node = new AnnotationCheckTreeNode(root, element);
          root.addChild(node);
          AnnotationIndex<AnnotationFS> annotationIndex = cas.getAnnotationIndex();
          for (AnnotationFS each : annotationIndex) {
            boolean annotationAlreadyDoneforTypes = annotationAlreadyDoneforTypes(each,
                    selectedTypes, element.checkedTypes);
            if (!annotationAlreadyDoneforTypes) {
              CheckElement ac = new CheckAnnotation(each);
              AnnotationCheckTreeNode anode = new AnnotationCheckTreeNode(node, ac);
              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(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

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.