Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.IStructuredSelection


    fParent = null;
    fPosition = null;

    /* Check Selection */
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structSel = (IStructuredSelection) selection;
      if (!structSel.isEmpty()) {
        Object firstElement = structSel.getFirstElement();
        if (firstElement instanceof IFolder)
          fParent = (IFolder) firstElement;
        else if (firstElement instanceof IMark) {
          fParent = ((IMark) firstElement).getParent();
          fPosition = ((IMark) firstElement);
View Full Code Here


      @Override
      public boolean performDrop(final Object data) {
        if (data instanceof IStructuredSelection) {
          SafeRunner.run(new LoggingSafeRunnable() {
            public void run() throws Exception {
              IStructuredSelection selection = (IStructuredSelection) data;
              List<?> draggedObjects = selection.toList();
              perfromDrop(draggedObjects, getCurrentTarget());
            }
          });

          return true;
View Full Code Here

  }

  private void onEdit() {
    showInfo();

    IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();
    if (!selection.isEmpty()) {
      new EntityPropertyDialogAction(this, fViewer).run();
      fViewer.refresh();
    }
  }
View Full Code Here

    if (fViewer.getTable().getItemCount() == 1) {
      setErrorMessage("It is not possible to delete the last Bookmark-Set. Please create a new Set first.");
      return;
    }

    IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();
    if (!selection.isEmpty()) {
      DeleteTypesAction deleteAction = new DeleteTypesAction(getShell(), selection);
      deleteAction.run();

      if (deleteAction.isConfirmed())
        fViewer.remove(selection.getFirstElement());
    }
  }
View Full Code Here

    setErrorMessage(null);
    setMessage("Please select a Bookmark-Set to manage.", IMessageProvider.INFORMATION);
  }

  private void updateStatusLabel() {
    IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();
    if (selection.isEmpty())
      fStatusLabel.setText("");
    else {
      IFolder bookmarkSet = (IFolder) selection.getFirstElement();
      int counter[] = new int[3];

      count(bookmarkSet, counter);

      StringBuilder str = new StringBuilder("Set contains ");
View Full Code Here

    fParent = null;
    fPosition = null;

    /* Check Selection */
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structSel = (IStructuredSelection) selection;
      if (!structSel.isEmpty()) {
        Object firstElement = structSel.getFirstElement();
        if (firstElement instanceof IFolder)
          fParent = (IFolder) firstElement;
        else if (firstElement instanceof IMark) {
          fParent = ((IMark) firstElement).getParent();
          fPosition = ((IMark) firstElement);
View Full Code Here

    });
  }

  private void updateSelectionAfterDelete(Runnable runnable) {
    Tree tree = (Tree) getControl();
    IStructuredSelection selection = (IStructuredSelection) getSelection();

    /* Nothing to do, since no selection */
    if (selection.isEmpty()) {
      runnable.run();
      return;
    }

    /* Look for the minimal Index of all selected Elements */
    int minSelectedIndex = Integer.MAX_VALUE;
    TreeItemAdapter parentOfMinSelected = new TreeItemAdapter(tree);

    /* For each selected Element */
    Object[] selectedElements = selection.toArray();
    for (Object selectedElement : selectedElements) {
      Widget widget = findItem(selectedElement);
      if (widget instanceof TreeItem) {
        TreeItem item = (TreeItem) widget;
        TreeItemAdapter parent = new TreeItemAdapter(item).getParent();
View Full Code Here

   * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
   */
  public void run(IAction action) {
    FeedView activeFeedView = OwlUI.getActiveFeedView();
    if (activeFeedView != null) {
      IStructuredSelection selection = (IStructuredSelection) activeFeedView.getSite().getSelectionProvider().getSelection();
      new MarkTypesReadAction(selection).run();
    }
  }
View Full Code Here

        /* Only Track selections from the HeadlineControl */
        if (!part.equals(fEditorSite.getPart()))
          return;

        IStructuredSelection selection = (IStructuredSelection) sel;

        /* Restore Initial Input if selection is empty */
        if (selection.isEmpty())
          fViewer.setInput(fInitialInput);

        /* Set Elements as Input if 1 Item is selected */
        else if (selection.size() == 1)
          setPartInput(selection.getFirstElement());
      }
    };
    fEditorSite.getPage().addPostSelectionListener(fSelectionListener);

    /* Send Browser-Status to Workbench-Status */
 
View Full Code Here

     * @see org.eclipse.jface.dialogs.Dialog#okPressed()
     */
    @Override
    protected void okPressed() {
      Object[] checkedObjects = fViewer.getCheckedElements();
      IStructuredSelection selection = new StructuredSelection(checkedObjects);

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

      /* Normalize */
 
View Full Code Here

TOP

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

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.