Examples of StructuredSelection


Examples of org.eclipse.jface.viewers.StructuredSelection


  private void initialize() {
    _wgaRuntimeProjects = WGADesignerPlugin.getAllRuntimes();
    if (_selection instanceof StructuredSelection) {
      StructuredSelection treeSel = (StructuredSelection) _selection;
      Object selectedElement = treeSel.getFirstElement();

      if (selectedElement instanceof IResource) {
        IResource resource = (IResource) selectedElement;
        IProject selectedRuntimeProject = resource.getProject();
        try {
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

    /* Hook into Reload */
    fReloadAction = new Action() {
      @Override
      public void run() {
        new ReloadTypesAction(new StructuredSelection(fInput.getMark()), getEditorSite().getShell()).run();
      }
    };

    /* Mark All Read */
    fMarkAllReadAction = new Action("Mark all News as Read") {
      @Override
      public void run() {
        new MarkReadAction(new StructuredSelection(fInput.getMark())).run();
      }
    };

    /* Select All */
    fSelectAllAction = new Action() {
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

      else if (perform.getType() == PerformAfterInputSet.Types.SELECT_UNREAD_NEWS)
        navigate(false, true, true, true);

      /* Select specific News */
      else if (perform.getType() == PerformAfterInputSet.Types.SELECT_SPECIFIC_NEWS)
        setSelection(new StructuredSelection(perform.getNewsToSelect()));

      /* Make sure to activate this FeedView in case of an action */
      if (perform.shouldActivate())
        fEditorSite.getPage().activate(fEditorSite.getPart());
    }

    /* DB Roundtrips done in the background */
    JobRunner.runInBackgroundThread(new Runnable() {
      public void run() {
        if (fInput == null)
          return;

        IMark mark = fInput.getMark();

        /* Trigger a reload if this is the first time open */
        if (mark instanceof IBookMark) {
          IBookMark bookmark = (IBookMark) mark;
          if ((bookmark.getLastVisitDate() == null && !fContentProvider.hasCachedNews()))
            new ReloadTypesAction(new StructuredSelection(mark), getEditorSite().getShell()).run();
        }

        /* Update some fields due to displaying the mark */
        if (mark instanceof ISearchMark) {
          DynamicDAO.getDAO(ISearchMarkDAO.class).visited((ISearchMark) mark);
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

      @Override
      protected void runInUI(IProgressMonitor monitor) {
        IStructuredSelection oldSelection = null;
        Object value = fgSelectionCache.get(fInput.hashCode());
        if (value != null)
          oldSelection = new StructuredSelection(value);

        /* Set input to News-Table if Visible */
        if (!fBgMonitor.isCanceled() && isTableViewerVisible())
          stableSetInputToNewsTable(mark, oldSelection);

View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

      /* Select and Focus TreeViewer */
      if (isTableViewerVisible()) {
        Tree tree = (Tree) fNewsTableControl.getViewer().getControl();
        if (tree.getItemCount() > 0) {
          fNewsTableControl.getViewer().setSelection(new StructuredSelection(tree.getItem(0).getData()));
          fNewsTableControl.setFocus();
        }
      }

      /* Move Focus into BrowserViewer */
 
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

    };

    /* Retrieve and select new Target Node */
    ITreeNode targetNode = (next ? traverse.nextNode() : traverse.previousNode());
    if (targetNode != null) {
      ISelection selection = new StructuredSelection(targetNode.getData());
      fNewsTableControl.getViewer().setSelection(selection);
      return true;
    }

    return false;
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

        /* Select added Folder */
        JobRunner.runInUIThread(SELECTION_DELAY, fFolderViewer.getControl(), new Runnable() {
          public void run() {
            FolderEvent event = events.iterator().next();
            fFolderViewer.setSelection(new StructuredSelection(event.getEntity()));
          }
        });
      }
    };

View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

        }
      }
    });

    /* Select the input Folder and expand */
    fFolderViewer.setSelection(new StructuredSelection(fSelectedFolder));
    fFolderViewer.setExpandedState(fSelectedFolder, true);

    /* Add Menu: "New Folder" */
    MenuManager menuManager = new MenuManager();
    menuManager.add(new Action("New Folder...") {
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

    /* Restore selection to last Element */
    else if (parentOfMinSelected.getItemCount() > 0)
      data = parentOfMinSelected.getItem(parentOfMinSelected.getItemCount() - 1).getData();

    if (data != null)
      setSelection(new StructuredSelection(data));
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

      ILabel newLabel = Owl.getModelFactory().createLabel(null, name);
      newLabel.setColor(color.red + "," + color.green + "," + color.blue);
      DynamicDAO.save(newLabel);

      fViewer.refresh();
      fViewer.setSelection(new StructuredSelection(newLabel));
    }
    fViewer.getTree().setFocus();
  }
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.