Examples of ITreeSelection


Examples of org.eclipse.jface.viewers.ITreeSelection

  protected Object reverse(IWorkbenchWindow w)
  throws ExecutionException {
    lastSourceWorkbenchWindow = w;
    String sourceViewId = fetchSourceViewId(w);
    lastSourceViewId = sourceViewId;
    ITreeSelection treeSel = fetchTreeSelection(
        w,
        sourceViewId
    );
    // If we have a selection,
    if(treeSel!=null) {
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

    lastSourceWorkbenchWindow = workbenchWindow;
    String sourceViewId =
      fetchSourceViewId(workbenchWindow);
    lastSourceViewId = sourceViewId;
    File target = null;
    ITreeSelection treeSel =
      fetchTreeSelection(workbenchWindow, sourceViewId);
    // If we have a selection,
    if(treeSel!=null) {
      IProject proj = null;
      // Then we try to get a selected Java element
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

                    IJavaProject container = (IJavaProject) obj;
                    containerText.setText(container.getPath().toString());
                }
            }
        } else if (selection != null && selection.isEmpty() == false && selection instanceof ITreeSelection) {
            ITreeSelection tsel = (ITreeSelection) selection;
            if (tsel.size() <= 1) {
                Object obj = tsel.getFirstElement();
                System.out.println(obj.getClass().getInterfaces()[0].getName());
                if (obj instanceof IContainer) {
                    IContainer container;
                    if (obj instanceof IContainer)
                        container = (IContainer) obj;
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

   *            the position of the element after it is moved
   */
  public void move(Object parent, Object element, int oldPosition,
      int newPosition) {
    if (isElementOrderPreserved()) {
      ITreeSelection selection = (ITreeSelection) viewer.getSelection();

      remove(parent, element, oldPosition);
      insert(parent, element, newPosition);

      // If the moved element is selected (or is an ancestor of a selected
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

   * if the selection is not a server)
   *
   * @return the currently selected server entry
   */
  public HadoopServer getSelectedServer() {
    ITreeSelection selection = (ITreeSelection) viewer.getSelection();
    Object first = selection.getFirstElement();
    if (first instanceof HadoopServer) {
      return (HadoopServer) first;
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

                save(path, "expanded");
            }

            ISelection selection = viewer.getSelection();
            if (selection instanceof ITreeSelection) {
                ITreeSelection treeSelection = (ITreeSelection) selection;
                TreePath[] paths = treeSelection.getPaths();
                for (TreePath path : paths) {
                    if (DEBUG) {
                        System.out.println("saveState selected:" + path);
                    }
                    save(path, "selected");
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

  /*
   * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
   * @since 2.1
   */
  public void menuAboutToShow(IMenuManager manager) {
    ITreeSelection selection = (ITreeSelection) tree.getSelection();
    if (selection.isEmpty())
      return;

    manager.add(new Separator(ICommonMenuConstants.GROUP_OPEN));
    manager.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));

View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

   * @see org.eclipse.ui.part.IShowInSource#getShowInContext()
   * @since 2.1
   */
  public ShowInContext getShowInContext() {
    IPath repoPath = getRepositoryPath();
    ITreeSelection selection = (ITreeSelection) tree.getSelection();
    List<IResource> resources = new ArrayList<IResource>();
    for (Iterator it = selection.iterator(); it.hasNext();) {
      Object obj = it.next();
      if (obj instanceof IResource)
        resources.add((IResource) obj);
      else if (obj instanceof PathNode && repoPath != null) {
        PathNode pathNode = (PathNode) obj;
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

  public TreeViewer getCategoryTree() {
    return categoryTree;
  }
 
  public String getCategoryID(){
    ITreeSelection selection = (ITreeSelection)categoryTree.getSelection();
    Object firstElement = selection.getFirstElement();
   
    if (firstElement instanceof Library) {
      Library lib = (Library) firstElement;
      return lib.getID();
     
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

   */
  public boolean performFinish() {
    logger.debug("Performing the finish");
   
    //Get the library we will submit to (its a category alright!)
    ITreeSelection selection = (ITreeSelection)categoryPage.getCategoryTree().getSelection();
   
   
    Object firstElement = selection.getFirstElement();
    if (firstElement instanceof Library) {
      Library library = (Library) firstElement;
     
      //Get all the values
      String username = descriptionPage.getUserName();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.