Examples of toList()


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

            return;
        }
       
        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        ArrayList<ICompilationUnit> compilationUnits = new ArrayList<ICompilationUnit>();
        for(Object entry: structuredSelection.toList()) {
            if (!(entry instanceof ICompilationUnit)) continue;
            compilationUnits.add((ICompilationUnit) entry);
        }
        setText(PREFIX + makeText(compilationUnits));
    }
View Full Code Here

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

                    selected.clear();
                }
                else
                {
                    IStructuredSelection sel = (IStructuredSelection) event.getSelection();
                    selected.addAll(sel.toList());
                }
            }
        });

        viewer.setInput(elements);
View Full Code Here

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

            final IWorkbenchSite site = getSite();
            final ISelection selection = site.getSelectionProvider().getSelection();
            if (selection instanceof IStructuredSelection) {
                final IStructuredSelection ss = (IStructuredSelection) selection;
                final Collection<IProject> result = Sets.newHashSet();
                for (final Object element : ss.toList()) {
                    if (element instanceof IErlElement) {
                        final IErlElement e = (IErlElement) element;
                        result.add(e.getResource().getProject());
                    } else if (element instanceof IResource) {
                        final IResource r = (IResource) element;
View Full Code Here

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

    public void select(final ISourceReference reference) {
        if (getTreeViewer() != null) {
            ISelection s = getTreeViewer().getSelection();
            if (s instanceof IStructuredSelection) {
                final IStructuredSelection ss = (IStructuredSelection) s;
                final List<?> elements = ss.toList();
                if (!elements.contains(reference)) {
                    s = reference == null ? StructuredSelection.EMPTY
                            : new StructuredSelection(reference);
                    getTreeViewer().setSelection(s, true);
                }
View Full Code Here

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

            }
            if (linkedSelection != null) {
                final IStructuredSelection currentSelection = (IStructuredSelection) getTreeViewer()
                        .getSelection();
                if (currentSelection == null
                        || !currentSelection.toList().containsAll(
                                linkedSelection.toList())) {
                    getTreeViewer().setSelection(linkedSelection, true);
                }
            }
        }
View Full Code Here

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

    }

    protected void removeSelectedPLTFiles() {
        final IStructuredSelection selection = (IStructuredSelection) fPLTTableViewer
                .getSelection();
        for (final Object o : selection.toList()) {
            shownPLTFiles.remove(o);
        }
        fPLTTableViewer.refresh();
    }
View Full Code Here

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

    private List<String> getSelectedPltFiles() {
        final IStructuredSelection selection = (IStructuredSelection) fPLTTableViewer
                .getSelection();
        final List<String> result = Lists.newArrayListWithCapacity(selection.size());
        for (final Object o : selection.toList()) {
            final String s = (String) o;
            result.add(s);
        }
        return result;
    }
View Full Code Here

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

                    && sSelection.getFirstElement() instanceof org.erlide.engine.new_model.IErlElement) {
                selectedElement2 = (org.erlide.engine.new_model.IErlElement) sSelection
                        .getFirstElement();
                return true;
            }
            for (final Object element : sSelection.toList()) {
                if (element instanceof IProject) {
                    final IProject project = (IProject) element;
                    if (!project.isOpen()) {
                        selectedClosedProjects.add(project);
                        return true;
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection.toList()

    ITreeSelection treeSelection = (ITreeSelection) selection;
    if (treeSelection.isEmpty())
      return EMPTY_WORKING_SET_ARRAY;

    List elements = treeSelection.toList();
    if (elements.size() == 1) {
      Object element = elements.get(0);
      TreePath[] paths = treeSelection.getPathsFor(element);
      if (paths.length != 1)
        return EMPTY_WORKING_SET_ARRAY;
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection.toList()

  protected StructuredSelection getSelectedItems() {

    StructuredSelection selection = (StructuredSelection) list
        .getSelection();

    List selectedItems = selection.toList();
    Object itemToRemove = null;

    for (Iterator it = selection.iterator(); it.hasNext();) {
      Object item = it.next();
      if (item instanceof ItemsListSeparator) {
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.