Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.StructuredSelection


    fFieldViewer.setContentProvider(new ComboContentProvider());
    fFieldViewer.setLabelProvider(new ComboLabelProvider());
    fFieldViewer.setInput(fCondition);

    /* Select the Condition's Field */
    fFieldViewer.setSelection(new StructuredSelection(fCondition.getField()));

    /* Listen to Changes */
    fFieldViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
        fModified = true;
View Full Code Here


    fSpecifierViewer.setLabelProvider(new ComboLabelProvider());
    fSpecifierViewer.setInput(fCondition.getField());

    /* Select the Condition's Specifier */
    if (fCondition.getSpecifier() != null)
      fSpecifierViewer.setSelection(new StructuredSelection(fCondition.getSpecifier()));

    /* Make sure to at least select the first item */
    if (fSpecifierViewer.getSelection().isEmpty())
      fSpecifierViewer.getCombo().select(0);

View Full Code Here

    /* 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

      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 */
        mark.setPopularity(mark.getPopularity() + 1);
        mark.setLastVisitDate(new Date(System.currentTimeMillis()));
View Full Code Here

      @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

      /* 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

    };

    /* 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

  public void run() {
    IStructuredSelection selection = (IStructuredSelection) fSelectionProvider.getSelection();
    if (selection.isEmpty()) {
      String selectedBookMarkSetPref = BookMarkExplorer.getSelectedBookMarkSetPref(OwlUI.getWindow());
      Long selectedRootFolderID = DynamicDAO.getDAO(IPreferenceDAO.class).load(selectedBookMarkSetPref).getLong();
      selection = new StructuredSelection(new FolderReference(selectedRootFolderID).resolve());
    }

    List<IFolderChild> entities = ModelUtils.getFoldersAndBookMarks(selection);
    List<IEntity> entitiesTmp = new ArrayList<IEntity>(entities);
View Full Code Here

          IEditorPart existingEditor = page.findEditor(fvInput);
          if (existingEditor != null && existingEditor instanceof FeedView) {
            feedview = (FeedView) existingEditor;

            /* Set Selection */
            feedview.setSelection(new StructuredSelection(news));
          }

          /* Otherwise open the Input in a new Editor */
          else
            feedview = (FeedView) page.openEditor(fvInput, FeedView.ID, true);
View Full Code Here

      parent = DynamicDAO.save(parent);

      /* Auto-Reload added BookMark */
      for (IMark mark : parent.getMarks()) {
        if (mark.equals(bookmark)) {
          new ReloadTypesAction(new StructuredSelection(mark), fShell).run();
          break;
        }
      }
    }
  }
View Full Code Here

TOP

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

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.