Package org.eclipse.jface.viewers

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


    if (operation == DND.DROP_COPY || operation == DND.DROP_DEFAULT) {
      if (LocalSelectionTransfer.getTransfer().isSupportedType(type)) {
        IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer()
            .getSelection();
        Object[] objects = selection.toArray();
        for (Object obj : objects) {
          if (obj instanceof CloudService) {
            return true;
          }
        }
View Full Code Here


  protected List<EnvironmentVariable> getViewerSelection() {
    IStructuredSelection selection = (IStructuredSelection) envVariablesViewer.getSelection();
    List<EnvironmentVariable> selectedVars = new ArrayList<EnvironmentVariable>();
    if (!selection.isEmpty()) {
      Object[] servicesObjs = selection.toArray();
      for (Object serviceObj : servicesObjs) {
        selectedVars.add((EnvironmentVariable) serviceObj);
      }
    }
    return selectedVars;
View Full Code Here

        serversViewer.addOpenListener(new IOpenListener() {
          public void open(OpenEvent event) {
            ISelection s = event.getSelection();
            if (s instanceof IStructuredSelection) {
              IStructuredSelection selection = (IStructuredSelection) s;
              Object[] selectedObjects = selection.toArray();
              if (selectedObjects.length == 1 && selectedObjects[0] instanceof ModuleServer) {
                ModuleServer moduleServer = (ModuleServer) selectedObjects[0];
                openApplicationPage(moduleServer);
              }
            }
View Full Code Here

  public List<CaldecottTunnelDescriptor> getSelectedCaldecotTunnelDescriptors() {
    IStructuredSelection selection = (IStructuredSelection) servicesViewer.getSelection();
    List<CaldecottTunnelDescriptor> descriptors = new ArrayList<CaldecottTunnelDescriptor>();
    if (!selection.isEmpty()) {
      Object[] servicesObjs = selection.toArray();
      for (Object serviceObj : servicesObjs) {
        descriptors.add((CaldecottTunnelDescriptor) serviceObj);

      }
    }
View Full Code Here

            for (Iterator<IClasspathEntry> i = selection.iterator(); i.hasNext();)
            {
                getBundle().removeClasspathEntry(
                    getProjectModel().getJavaModel().encodeClasspathEntry(i.next()).trim());
            }
            viewer.remove(selection.toArray());
            markDirty();
        }
    }
}
View Full Code Here

        {
            @Override
            public void widgetSelected(SelectionEvent e)
            {
                IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
                Object[] deleted = selection.toArray();
                for (Object delete : deleted)
                {
                    resources.remove(delete);
                }
                viewer.remove(deleted);
View Full Code Here

        {
            for (Iterator<String> i = selection.iterator(); i.hasNext();)
            {
                getBundle().removePackage(i.next());
            }
            viewer.remove(selection.toArray());
            markDirty();
        }
    }
}
View Full Code Here

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final IStructuredSelection selection = (IStructuredSelection) listViewer
                        .getSelection();
                for (final Object o : selection.toArray()) {
                    contentProvider.removeModule((IErlModule) o);
                }
                listViewer.refresh();
                updateLaunchConfigurationDialog();
            }
View Full Code Here

     */
    public void doSelectionChanged(final ISelection selection) {
        ISourceReference reference = null;
        if (selection instanceof IStructuredSelection) {
            final IStructuredSelection ss = (IStructuredSelection) selection;
            for (final Object o : ss.toArray()) {
                if (o instanceof ISourceReference) {
                    reference = (ISourceReference) o;
                    break;
                }
            }
View Full Code Here

        if (!(selection instanceof IStructuredSelection)) {
            return;
        }
        final Set<IErlProject> projects = Sets.newHashSet();
        final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        for (final Object element : structuredSelection.toArray()) {
            if (!(element instanceof IResource)) {
                return;
            }
            final IErlElement erlElement = ErlangEngine.getInstance().getModel()
                    .findElement((IResource) element);
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.