Examples of ISelection


Examples of org.eclipse.jface.viewers.ISelection

  private void performNavigation(ITreeNode targetNode, boolean newsScoped, boolean unread) {
    IMark mark = (IMark) targetNode.getData();

    /* Set Selection to Mark */
    ISelection selection = new StructuredSelection(mark);
    fViewer.setSelection(selection);

    /* Open in FeedView */
    try {
      PerformAfterInputSet perform = null;
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    /* Selection Transfer */
    if (LocalSelectionTransfer.getTransfer().isSupportedType(transferType)) {
      final boolean[] result = new boolean[] { false };
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {
          ISelection selection = LocalSelectionTransfer.getTransfer().getSelection();
          if (selection instanceof IStructuredSelection) {
            List<?> draggedObjects = ((IStructuredSelection) selection).toList();
            result[0] = isValidDrop((IEntity) target, draggedObjects);
          }
        }
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

      public void selectionChanged(SelectionChangedEvent event) {
        IStructuredSelection selection = (IStructuredSelection) event.getSelection();
        if (!selection.isEmpty()) {

          /* Remember old Selection */
          ISelection oldSelection = fSpecifierViewer.getSelection();

          /* Set Field as Input */
          ISearchField field = (ISearchField) selection.getFirstElement();
          fSpecifierViewer.setInput(field);

View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

  /*
   * @see org.eclipse.jface.action.Action#isEnabled()
   */
  @Override
  public boolean isEnabled() {
    ISelection selection = getSelection();
    if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
      List<?> list = ((IStructuredSelection) selection).toList();
      for (Object entry : list) {
        if (entry instanceof IBookMark || entry instanceof INews)
          return true;
      }
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

  /*
   * @see org.eclipse.jface.action.Action#run()
   */
  @Override
  public void run() {
    ISelection selection = getSelection();
    if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
      IStructuredSelection structuredSelection = (IStructuredSelection) selection;
      StringBuilder str = new StringBuilder();

      /* Build Contents */
      if (!structuredSelection.isEmpty()) {
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

  }

  private ISelection getSelection() {

    /* First look for active Selection */
    ISelection activeSelection = OwlUI.getActiveSelection();
    if (activeSelection != null && !activeSelection.isEmpty() && activeSelection instanceof IStructuredSelection)
      return activeSelection;

    /* Fallback to explicitly set one */
    return fSelection;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

            /* Select the first matching Item */
            if (hasFocus && textChanged && fFilterText.getText().trim().length() > 0) {
              TreeItem item = getFirstMatchingItem(fViewer.getTree().getItems());
              if (item != null) {
                fViewer.getTree().setSelection(new TreeItem[] { item });
                ISelection sel = fViewer.getSelection();
                fViewer.setSelection(sel, true);
              }
            }
          }
        }
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

                for (Entry<IFolder, IFolder> entry : entries) {
                  IFolder reparentedFolder = entry.getKey();
                  IFolder oldParent = entry.getValue();

                  /* Reparent while keeping the Selection / Expansion */
                  ISelection selection = fViewer.getSelection();
                  boolean expand = expandedElements.contains(reparentedFolder);
                  fViewer.remove(oldParent, new Object[] { reparentedFolder });
                  fViewer.refresh(reparentedFolder.getParent(), false);
                  fViewer.setSelection(selection);

View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

            for (Entry<IMark, IFolder> entry : entries) {
              IMark reparentedMark = entry.getKey();
              IFolder oldParent = entry.getValue();

              /* Reparent while keeping the Selection */
              ISelection selection = fViewer.getSelection();
              fViewer.remove(oldParent, new Object[] { reparentedMark });
              fViewer.refresh(reparentedMark.getParent(), false);
              fViewer.setSelection(selection);

              /* Remember to update parents */
 
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

        if (!fBgMonitor.isCanceled() && (!isTableViewerVisible() || (BROWSER_SHOWS_ALL /* && oldSelection == null */)))
          fNewsBrowserControl.setPartInput(mark);

        /* Reset old Input to Browser if available */
        else if (!fBgMonitor.isCanceled() && oldSelection != null) {
          ISelection selection = fNewsTableControl.getViewer().getSelection();
          if (!selection.isEmpty()) //Could be filtered
            fNewsBrowserControl.setPartInput(oldSelection.getFirstElement());
        }

        /* Clear old Input from Browser */
        else if (!fBgMonitor.isCanceled() && reused)
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.