Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.IStructuredSelection.toArray()


        List<StagingEntry> stagingEntryList = new ArrayList<StagingEntry>();

        boolean submoduleSelected = false;
        boolean folderSelected = false;
        for (Object element : selection.toArray()) {
          if (element instanceof StagingFolderEntry) {
            StagingFolderEntry folder = (StagingFolderEntry) element;
            folderSelected = true;
            StagingViewContentProvider contentProvider = getContentProvider(treeViewer);
            List<StagingEntry> stagingEntries = contentProvider
View Full Code Here


  @Override
  protected String refNameFromDialog() {
    selectedRefs.clear();
    Set<String> selected = new HashSet<String>();
    IStructuredSelection selection = (IStructuredSelection) branchTree.getSelection();
    for (Object sel : selection.toArray()) {
      if (!(sel instanceof RefNode))
        continue;

      RefNode node = (RefNode) sel;
      Ref ref = node.getObject();
View Full Code Here

    btnRemove.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        IStructuredSelection selection = (IStructuredSelection) mListViewer.getSelection();
        if (selection.size() > 0) {
          for (Object file : selection.toArray()) {           
            mListViewer.remove((String)file);
          }
        }
      }
    });
View Full Code Here

  }

  private void openPreview(ISelection selection) {
    IStructuredSelection sel = (IStructuredSelection) selection;
    if (!sel.isEmpty()) {
      Object[] elements = sel.toArray();
      int offset = 0;
      for (Object element : elements) {
        if (element instanceof IBookMark) {
          IBookMark bookmark = (IBookMark) element;
          IFeed loadedFeed = fLoadedFeedCache.get(bookmark.getFeedLinkReference().getLink());
View Full Code Here

        ISearchFilter filter = (ISearchFilter) iterator.next();
        filtersToDelete.add(filter);
      }

      fSearchFilterDao.deleteAll(filtersToDelete);
      fViewer.remove(selection.toArray());
      fixOrderAfterDelete();
      updateTitle();
    }
  }
View Full Code Here

            fExpandedElements = fViewer.getExpandedElements();

          /* Remember Selected Elements if present */
          IStructuredSelection sel = (IStructuredSelection) fViewer.getSelection();
          if (!sel.isEmpty())
            fSelectedElements = sel.toArray();

          /* Refresh Tree */
          BusyIndicator.showWhile(getDisplay(), new Runnable() {
            public void run() {
              fViewer.refresh(false);
View Full Code Here

  /*
   * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
   */
  public void selectionChanged(SelectionChangedEvent event) {
    IStructuredSelection selection = (IStructuredSelection) event.getSelection();
    String text = formatElements(selection.toArray());

    /* Show Message */
    fStatusLineManager.setMessage(text);
  }

View Full Code Here

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

  private void deleteSelectedMatch() {
    if( getResultViewer().getSelection() == null )
      return;
    IStructuredSelection selection = (IStructuredSelection)resultViewer.getSelection();
    getResultViewer().remove(selection.toArray());
  }
 
  /**
   *
   */
 
View Full Code Here

        AbstractPythonSearchQuery query = (AbstractPythonSearchQuery) getInput().getQuery();
        if (query.getSearchString().length() > 0) {
            IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
            if (!selection.isEmpty()) {
                ReplaceAction replaceSelection = new ReplaceAction(getSite().getShell(),
                        (PythonFileSearchResult) getInput(), selection.toArray(), true);
                replaceSelection.setText(SearchMessages.ReplaceAction_label_selected);
                mgr.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, replaceSelection);

            }
            ReplaceAction replaceAll = new ReplaceAction(getSite().getShell(), (PythonFileSearchResult) getInput(),
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.