Package org.eclipse.jface.viewers

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


    @Override
    public Object execute(final ExecutionEvent event) throws ExecutionException {
        final ISelection selection = HandlerUtil.getCurrentSelection(event);
        if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
            final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
            for (final Object o : structuredSelection.toArray()) {
                if (o instanceof IResource) {
                    final IResource resource = (IResource) o;
                    DialyzerMarkerUtils.removeDialyzerMarkersFor(resource);
                }
            }
View Full Code Here


    }

    @Override
    public void run(final IAction action) {
        final IStructuredSelection ss = (IStructuredSelection) fSelection;
        for (final Object o : ss.toArray()) {
            if (o instanceof ErlangProcess) {
                final ErlangProcess p = (ErlangProcess) o;
                p.setTracing(!p.getTracing());
            }
        }
View Full Code Here

    @Override
    public void selectionChanged(final IAction action, final ISelection selection) {
        fTarget = null;
        if (selection instanceof IStructuredSelection) {
            final IStructuredSelection ss = (IStructuredSelection) selection;
            for (final Object o : ss.toArray()) {
                if (o instanceof IDebugTarget) {
                    final IDebugTarget target = (IDebugTarget) o;
                    fTarget = target;
                    break;
                }
View Full Code Here

    @Override
    public void selectionChanged(final IAction action, final ISelection selection) {
        fLaunch = null;
        if (selection instanceof IStructuredSelection) {
            final IStructuredSelection ss = (IStructuredSelection) selection;
            for (final Object o : ss.toArray()) {
                if (o instanceof ErlangDebugElement) {
                    final ErlangDebugElement d = (ErlangDebugElement) o;
                    fLaunch = d.getLaunch();
                } else if (o instanceof ILaunch) {
                    fLaunch = (ILaunch) o;
View Full Code Here

            @Override
            public void doubleClick(final DoubleClickEvent event) {
                final IStructuredSelection ss = (IStructuredSelection) event
                        .getSelection();
                for (final Object o : ss.toArray()) {
                    try {
                        EditorUtility.openInEditor(o);
                    } catch (final PartInitException e) {
                        ErlLogger.warn(e);
                    }
View Full Code Here

            }
        } else if (commandId.equals(DEINTERPRET_COMMAND_ID)) {
            final ISelection selection = HandlerUtil.getCurrentSelection(event);
            if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
                final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
                for (final Object o : structuredSelection.toArray()) {
                    final IErlModule module = (IErlModule) o;
                    view.interpretOrDeinterpret(module, false);
                }
            }
        } else {
View Full Code Here

      try {
        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        List<String> testCases = new ArrayList<String>();
        String projectName = "";
        List<IFile> files = new ArrayList<IFile>();
        for (Object object : structuredSelection.toArray()) {
          if (object instanceof IFile) {
            IFile file = (IFile) object;
            files.add(file);
            projectName = file.getProject().getName();
            testCases.addAll(finder.getTestCases(file.getLocation().toFile()));
View Full Code Here

    void doRemove() {
        IStructuredSelection selection = (IStructuredSelection) selectedViewer.getSelection();
        for (Object clause : selection.toList()) {
            selectedBundles.remove(((VersionedClause) clause).getName());
        }
        selectedViewer.remove(selection.toArray());
        availableViewer.refresh();
        propSupport.firePropertyChange(PROP_SELECTION, null, selectedBundles);
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
View Full Code Here

   */
  public void showSelection(IWorkbenchPart sourcepart, ISelection selection) {
    setContentDescription(sourcepart.getTitle() + " (" + selection.getClass().getName() + ")");
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection ss = (IStructuredSelection) selection;
      showItems(ss.toArray());
    }
    if (selection instanceof ITextSelection) {
      ITextSelection ts = (ITextSelection) selection;
      showText(ts.getText());
    }
View Full Code Here

   * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
   */
  public void run(IAction action) {
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structuredSelection = (IStructuredSelection) selection;
      for (Object element : structuredSelection.toArray()) {
        IProject project = null;
        if (element instanceof IProject) {
          project = (IProject) element;
        } else if (element instanceof IAdaptable) {
          project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
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.