Package org.eclipse.jface.viewers

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


              if (selection.isEmpty()) {
                removeButton.setEnabled(false);
                return;
              }
              boolean enabled = true;
              List elements = selection.toList();
              for (Iterator i = elements.iterator(); i.hasNext();) {
                Spec spec = (Spec) i.next();
                if (spec.isPredefined) {
                  enabled = false;
                }
View Full Code Here


          .getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME);
      final IEvaluationContext contextWithDefaultVariable;
      if (defaultVariable instanceof IStructuredSelection) {
        final IStructuredSelection selection = (IStructuredSelection) defaultVariable;
        contextWithDefaultVariable = new EvaluationContext(context,
            selection.toList());
      } else if ((defaultVariable instanceof ISelection)
          && (!((ISelection) defaultVariable).isEmpty())) {
        contextWithDefaultVariable = new EvaluationContext(context,
            Collections.singleton(defaultVariable));
      } else {
View Full Code Here

    sb.append(headers[CoverageView.COLUMN_TOTAL]).append(Text.DELIMITER);

    // Rows:
    final IStructuredSelection selection = (IStructuredSelection) selectionSource
        .getSelection();
    for (final Object element : selection.toList()) {
      appendColumn(sb, element, CoverageView.COLUMN_ELEMENT).append(SWT.TAB);
      appendColumn(sb, element, CoverageView.COLUMN_RATIO).append(SWT.TAB);
      appendColumn(sb, element, CoverageView.COLUMN_COVERED).append(SWT.TAB);
      appendColumn(sb, element, CoverageView.COLUMN_MISSED).append(SWT.TAB);
      appendColumn(sb, element, CoverageView.COLUMN_TOTAL).append(
View Full Code Here

    _remove.setLayoutData(createButtonGridData());
    _remove.addSelectionListener(new SelectionAdapter(){
      @Override
      public void widgetSelected(SelectionEvent evt){
        IStructuredSelection sel = (IStructuredSelection)_tableViewer.getSelection();
        _tableModel.removeAll(sel.toList());
        updateButtons();
        _tableViewer.refresh();
        modelChanged();
      }
    });
View Full Code Here

    buttonRemove.setEnabled(false);
    buttonRemove.addSelectionListener(
        new SelectionAdapter(){
          public void widgetSelected(SelectionEvent evt){
            IStructuredSelection sel = (IStructuredSelection)viewer.getSelection();
            doRemove(sel.toList());
            viewer.refresh();
          }
        });
   
    viewer.addSelectionChangedListener(new ISelectionChangedListener(){
View Full Code Here

    }
  }

  public void removePrefetchKeyPath() {
    IStructuredSelection selection = (IStructuredSelection) myPrefetchKeyPathsTableViewer.getSelection();
    Iterator selectedObjectsIter = selection.toList().iterator();
    while (selectedObjectsIter.hasNext()) {
      String prefetchKeyPath = (String) selectedObjectsIter.next();
      myFetchSpecification.removePrefetchingRelationshipKeyPath(prefetchKeyPath, true);
    }
  }
View Full Code Here

    try {
      if (mySelectionDepth == 1) {
        IStructuredSelection previousSelection = mySelection;
        IStructuredSelection selection = (IStructuredSelection) _selection;
        mySelection = selection;
        if (previousSelection == null || !selection.toList().equals(previousSelection.toList())) {
          Object selectedObject = null;
          if (!selection.isEmpty()) {
            selectedObject = selection.getFirstElement();
          }
          if (selectedObject instanceof EOModel) {
View Full Code Here

    }
  }

  public void removeSortOrdering() {
    IStructuredSelection selection = (IStructuredSelection) mySortOrderingsTableViewer.getSelection();
    Iterator selectedObjectsIter = selection.toList().iterator();
    while (selectedObjectsIter.hasNext()) {
      EOSortOrdering sortOrdering = (EOSortOrdering) selectedObjectsIter.next();
      myFetchSpecification.removeSortOrdering(sortOrdering, true);
    }
  }
View Full Code Here

    return myModel;
  }

  public void setSelectedEntity(EOEntity _entity) {
    IStructuredSelection selection = (IStructuredSelection) myEntitiesTableViewer.getSelection();
    if ((_entity == null && !selection.isEmpty()) || (selection != null && !selection.toList().contains(_entity))) {
      if (_entity == null) {
        myEntitiesTableViewer.setSelection(new StructuredSelection(), true);
      } else {
        myEntitiesTableViewer.setSelection(new StructuredSelection(_entity), true);
      }
View Full Code Here

    }
  }

  public void removePrefetchKeyPath() {
    IStructuredSelection selection = (IStructuredSelection) myRawRowKeyPathsTableViewer.getSelection();
    Iterator selectedObjectsIter = selection.toList().iterator();
    while (selectedObjectsIter.hasNext()) {
      String rawRowKeyPath = (String) selectedObjectsIter.next();
      myFetchSpecification.removeRawRowKeyPath(rawRowKeyPath, true);
    }
    updateButtonsEnabled();
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.