Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.TreePath


    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


    buf.append("\tBounds: " + control.getBounds() + "\n");
    buf.append("\n");
  }

  public void getLocationInformation(Control control, StringBuffer buf) {
    TreePath path = controlFinder.getPath(control);
    String stringFromPath = new PathGenerator().getPathAsString(path);
    buf.append("Location: \n").append(stringFromPath).append("\n\n");
  }
View Full Code Here

  public void getParentInformation(Control control, StringBuffer buf) {
    Composite parent = control.getParent();
    if (parent != null) {
      buf.append("Parent Tree:\n");

      TreePath parents = controlFinder.getPath(control).getParentPath();

      int segmentCount = parents.getSegmentCount();
      for (int i = segmentCount - 1; i >= 0; i--) {
        String prefix = "";
        Widget segment = (Widget) parents.getSegment(i);
        for (int j = 0; j < segmentCount - i - 1; j++)
          prefix += "\t";

        buf.append(prefix + renderWidget(segment) + "[" + SWTUtils.widgetIndex(segment) + "]" + "@" + "\n");
        if (segment instanceof Composite) {
View Full Code Here

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

    return result;
  }
View Full Code Here

        default:
          break;
        }
      }

      TreePath parent = new TreePath(segments.toArray());
      result.add(parent.createChildPath(data.get(ILaunchData.COUNT)));
      result.add(parent.createChildPath(data.get(ILaunchData.DURATION)));
     
      for (IFile file : data.get(ILaunchData.FILES)) {
        TreePath filePath = parent;
       
        IProject project = file.getProject();
        filePath = filePath.createChildPath(project);
       
        IContainer parentFolder = file.getParent();
        if (!project.equals(parentFolder)) {
          filePath = filePath.createChildPath(parentFolder);
        }
        filePath = filePath.createChildPath(file);
        result.add(filePath);
      }
    }
    return result;
  }
View Full Code Here

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

    return result;
  }
View Full Code Here

      }

      try {
        // Note that new TreePath(...) will also throw an exception if one of
        // the segments is null:
        paths.addAll(transform(node, new TreePath(segments.toArray())));
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
    return paths;
View Full Code Here

    return valueProvider;
  }

  @Override
  public void update(ViewerCell cell) {
    TreePath path = cell.getViewerRow().getTreePath();
    String text = null;
    if (getValueProvider().shouldPaint(cell.getElement())) {
      text = DurationFormat.format(getValueProvider().getValue(path));
    }
    cell.setText(text);
View Full Code Here

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

    return result;
  }
View Full Code Here

    return valueProvider;
  }

  @Override
  public void update(ViewerCell cell) {
    TreePath path = cell.getViewerRow().getTreePath();
    String text = null;
    if (getValueProvider().shouldPaint(cell.getElement())) {
      text = String.valueOf(getValueProvider().getValue(path));
    }
    cell.setText(text);
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.