Examples of ISelection


Examples of org.eclipse.jface.viewers.ISelection

    action.setMenuCreator(getMenu(item));
    return action;
  }

  private void updateActions(IWorkbenchPart activePart) {
    ISelection selection = null;
    if (activePart != null && activePart.getSite() != null && activePart.getSite().getSelectionProvider() != null)
      selection = activePart.getSite().getSelectionProvider().getSelection();

    CoolBarItem[] items = CoolBarItem.values();
    for (CoolBarItem item : items) {
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

        lastSelectedItem = tree.getItem(indexOfEntityGroup - 1);
    }

    /* Navigate to next News if possible */
    ITreeNode startingNode = new WidgetTreeNode(lastSelectedItem, this);
    ISelection newSelection = navigate(startingNode, true);

    /* Try previous News if possible then */
    if (newSelection == null)
      newSelection = navigate(startingNode, false);

View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    };

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

    return null;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    if (page != null) {
      IWorkbenchPart part = page.getActivePart();
      if (part != null && part.getSite() != null) {
        ISelectionProvider selectionProvider = part.getSite().getSelectionProvider();
        if (selectionProvider != null) {
          ISelection selection = selectionProvider.getSelection();
          if (!selection.isEmpty() && selection instanceof IStructuredSelection)
            return (IStructuredSelection) selection;
        }
      }
    }
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    });

    /* Control Preview Button Enablement */
    fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
        ISelection selection = event.getSelection();
        fPreviewButton.setEnabled(!selection.isEmpty() && ((IStructuredSelection) selection).getFirstElement() instanceof IBookMark);
      }
    });

    /* Filter (exclude existing) */
    fViewer.addFilter(fExistingFilter);
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

  private void refreshTableViewer(boolean delayRedraw, boolean updateLabels) {
    if (isTableViewerVisible()) {
      boolean groupingEnabled = fNewsGrouping.getType() != NewsGrouping.Type.NO_GROUPING;

      /* Remember Selection if grouping enabled */
      ISelection selection = StructuredSelection.EMPTY;
      if (groupingEnabled)
        selection = fNewsTableControl.getViewer().getSelection();

      /* Delay redraw operations if requested */
      if (delayRedraw)
View Full Code Here

Examples of org.eclipse.jface.viewers.ISelection

    };

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