Package org.eclipse.jface.viewers

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


    parameterNameText.setText("");
  }
 
  private void handleRemoveParameter() {
    final IStructuredSelection selection = (IStructuredSelection) excludedParameterList.getSelection();
    for(Object elem: selection.toArray()) {
      if(elem instanceof String) {
        parameterNames.remove(elem);
      }
    }
    excludedParameterList.setInput(parameterNames.toArray());
View Full Code Here


  }

  private void edit() {
    IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();

    Object[] objects= selection.toArray();
    if ((objects == null) || (objects.length != 1))
      return;

    TemplatePersistenceData data= (TemplatePersistenceData) selection.getFirstElement();
    edit(data);
View Full Code Here

    }
  }

  private void export() {
    IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
    Object[] templates= selection.toArray();

    TemplatePersistenceData[] datas= new TemplatePersistenceData[templates.length];
    for (int i= 0; i != templates.length; i++)
      datas[i]= (TemplatePersistenceData) templates[i];
View Full Code Here

  public void selectionChanged(IWorkbenchPart part, ISelection selection) {
    if(!(selection instanceof IStructuredSelection)) {
      return;
    }
    final IStructuredSelection ss = (IStructuredSelection) selection;
    for(Object ob: ss.toArray()) {
      if(ob instanceof IWebEntity) {
        handleWebEntitySelected((IWebEntity) ob);
      }
    }
  }
View Full Code Here

  public static Object[] multipleSelection(final ISelection selection) {
    if (!(selection instanceof IStructuredSelection)) {
      return null;
    }
    IStructuredSelection structuredSelection = (IStructuredSelection)selection;
    Object[] toArray = structuredSelection.toArray();
    if (toArray.length == 0) {
      return null; // simplifies the client; anything non-null means we have something to process
    }
    return toArray;
  }
View Full Code Here

      @Override
      public void selectionChanged(SelectionChangedEvent event) {
        if (areEventsActive) {
          activities.clear();
          IStructuredSelection selection = (IStructuredSelection) event.getSelection();
          for (Object obj : selection.toArray()) {
            activities.add((Activity)obj);
          }
          dialogChanged();
        }
      }
View Full Code Here

 
    if( container.getSelection() instanceof IStructuredSelection ) {
     
      IStructuredSelection sel = (IStructuredSelection) container.getSelection();
     
      for(Object elem: sel.toArray())
      {
        if( elem instanceof IAdaptable ) {
         
          IResource res = null;
         
View Full Code Here

    if (selectedProjects.length > 0)
      return getRepositoriesFor(selectedProjects);
    IStructuredSelection selection = getSelection(event);
    if (!selection.isEmpty()) {
      Set<Repository> repos = new LinkedHashSet<Repository>();
      for (Object o : selection.toArray())
        if (o instanceof Repository)
          repos.add((Repository) o);
        else if (o instanceof PlatformObject) {
          Repository repo = (Repository) ((PlatformObject) o)
              .getAdapter(Repository.class);
View Full Code Here

    if (selectedProjects.length > 0)
      return getRepositoriesFor(selectedProjects);
    IStructuredSelection selection = getSelection();
    if (!selection.isEmpty()) {
      Set<Repository> repos = new LinkedHashSet<Repository>();
      for (Object o : selection.toArray())
        if (o instanceof Repository)
          repos.add((Repository) o);
        else if (o instanceof PlatformObject) {
          Repository repo = (Repository) ((PlatformObject) o)
              .getAdapter(Repository.class);
View Full Code Here

      IStructuredSelection sel = (IStructuredSelection) selection;
      if (sel.size() == 0)
        return null;

      File workTree = repo.getWorkTree();
      for (Object o : sel.toArray()) {
        if (!(o instanceof IAdaptable))
          continue;

        IResource res = (IResource) ((IAdaptable) o)
            .getAdapter(IResource.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.