Package org.eclipse.jface.viewers

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


    remove.setText(HTMLPlugin.getResourceString("Button.Remove"));
    remove.setLayoutData(createButtonGridData());
    remove.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(SelectionEvent evt){
        IStructuredSelection sel = (IStructuredSelection)tableViewer.getSelection();
        tableModel.removeAll(sel.toList());
        remove.setEnabled(false);
        tableViewer.refresh();
        modelChanged();
      }
    });
View Full Code Here


    private class RemoveVariableSelectionListener extends SelectionAdapter {

        @Override
        public void widgetSelected(SelectionEvent e) {
            IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
            List<Variable> variables = (List<Variable>) selection.toList();
            for (Variable variable : variables) {
                try {
                    delete(variable);
                } catch (Exception e1) {
                    DesignerLogger.logError(e1);
View Full Code Here

    private class CopyVariableSelectionListener extends SelectionAdapter {

        @Override
        public void widgetSelected(SelectionEvent e) {
            IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
            Clipboard.getDefault().setContents(selection.toList());
        }

    }

    private class PasteVariableSelectionListener extends SelectionAdapter {
View Full Code Here

    }

    protected void fillContextMenu(IMenuManager manager) {
        final IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
        final Object selectedObject = selection.getFirstElement();
        final List<IResource> resources = selection.toList();

        if (!selection.isEmpty() && selectedObject instanceof IFolder) {
            manager.add(new Action(Messages.getString("ExplorerTreeView.menu.label.openProcess")) {
                @Override
                public void run() {
View Full Code Here

  public IDownload getSelectedDownload() {
    ISelection lSelection = mView.getTableViewer().getSelection();
    if (lSelection instanceof IStructuredSelection) {
      IStructuredSelection lSelect = (IStructuredSelection) lSelection;
      for (Object l : lSelect.toList()) {
        if (l instanceof IDownload) {
          // TODO will not work!!!!!!!!!!!!!
        }
      }
    }
View Full Code Here

      if (structuredSelection != null) {
        TabItem editorSelectionTab = new TabItem(tabfolder, SWT.BORDER);
        editorSelectionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_14);
        Composite editorSelectionComposite = new Composite(tabfolder, SWT.NONE);
        editorSelectionTab.setControl(editorSelectionComposite);
        fillSelectionTabContents(editorSelectionComposite, structuredSelection.toList(), "Class: " + structuredSelection.getClass().getName()); //$NON-NLS-1$
      }

      model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
      if (model != null) {
        TabItem overlappingIndexedRegionsTab = new TabItem(tabfolder, SWT.BORDER);
View Full Code Here

   * @param selection
   */
  private void removeTags(ISelection selection) {
    IStructuredSelection structuredSelection = (IStructuredSelection) selection;
    List taskTags = new ArrayList(Arrays.asList(fTaskTags));
    taskTags.removeAll(structuredSelection.toList());
    fTaskTags = (TaskTag[]) taskTags.toArray(new TaskTag[taskTags.size()]);
    valueTable.setInput(fTaskTags);
  }

  private void save() {
View Full Code Here

   * @param selection
   */
  private void removeTags(ISelection selection) {
    IStructuredSelection structuredSelection = (IStructuredSelection) selection;
    List taskTags = new ArrayList(Arrays.asList(fTaskTags));
    taskTags.removeAll(structuredSelection.toList());
    fTaskTags = (TaskTag[]) taskTags.toArray(new TaskTag[taskTags.size()]);
    valueTable.setInput(fTaskTags);
  }

  private void save() {
View Full Code Here

             * feedback constants (even though it converts in
             * the other direction as well)
             */
            float feedbackFloat = getHeightInItem(event);

            final DragNodeCommand command = new DragNodeCommand(event.item.getData(), feedbackFloat, event.operations, event.detail, selection.toList(), XMLTableTreeViewer.this);
            if (command != null && command.canExecute()) {
              SafeRunnable.run(new SafeRunnable() {
                public void run() throws Exception {
                  command.execute();
                }
View Full Code Here

  public Collection<Class<? extends Element>> getSelectedElementKindSet() {
    // JFace guarantees that TableViewers always provide a structured selection
    IStructuredSelection selectedElementKinds = getSelection();

    Collection<Class<? extends Element>> result = Lists.newArrayList();
    for(Object obj : selectedElementKinds.toList()) {
      ElementKindDescriptor item = (ElementKindDescriptor) obj;
      result.add(item.getElementKind());
    }
    return result;
  }
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.