Package org.eclipse.jface.viewers

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


    /* Look for the minimal Index of all selected Elements */
    int minSelectedIndex = Integer.MAX_VALUE;
    TreeItemAdapter parentOfMinSelected = new TreeItemAdapter(tree);

    /* For each selected Element */
    Object[] selectedElements = selection.toArray();
    for (Object selectedElement : selectedElements) {
      Widget widget = findItem(selectedElement);
      if (widget instanceof TreeItem) {
        TreeItem item = (TreeItem) widget;
        TreeItemAdapter parent = new TreeItemAdapter(item).getParent();
View Full Code Here


  /*
   * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
   */
  public void selectionChanged(SelectionChangedEvent event) {
    IStructuredSelection selection = (IStructuredSelection) event.getSelection();
    String text = formatElements(selection.toArray());

    /* Replace & with && */
    text = text.replaceAll("&", "&&"); //$NON-NLS-1$//$NON-NLS-2$

    /* Show Message */
 
View Full Code Here

    /* Look for the minimal Index of all selected Elements */
    int minSelectedIndex = Integer.MAX_VALUE;
    TreeItemAdapter parentOfMinSelected = new TreeItemAdapter(tree);

    /* For each selected Element */
    Object[] selectedElements = selection.toArray();
    for (Object selectedElement : selectedElements) {
      Widget widget = findItem(selectedElement);
      if (widget instanceof TreeItem) {
        TreeItem item = (TreeItem) widget;
        TreeItemAdapter parent = new TreeItemAdapter(item).getParent();
View Full Code Here

  }

  private void openPreview(ISelection selection) {
    IStructuredSelection sel = (IStructuredSelection) selection;
    if (!sel.isEmpty()) {
      Object[] elements = sel.toArray();
      int offset = 0;
      for (Object element : elements) {
        if (element instanceof IBookMark) {
          IBookMark bookmark = (IBookMark) element;
          IFeed loadedFeed = fLoadedFeedCache.get(bookmark.getFeedLinkReference().getLink());
View Full Code Here

            fExpandedElements = fViewer.getExpandedElements();

          /* Remember Selected Elements if present */
          IStructuredSelection sel = (IStructuredSelection) fViewer.getSelection();
          if (!sel.isEmpty())
            fSelectedElements = sel.toArray();

          /* Refresh Tree */
          BusyIndicator.showWhile(getDisplay(), new Runnable() {
            public void run() {
              fViewer.refresh(false);
View Full Code Here

    /* Look for the minimal Index of all selected Elements */
    int minSelectedIndex = Integer.MAX_VALUE;
    TreeItemAdapter parentOfMinSelected = new TreeItemAdapter(tree);

    /* For each selected Element */
    Object[] selectedElements = selection.toArray();
    for (Object selectedElement : selectedElements) {
      Widget widget = findItem(selectedElement);
      if (widget instanceof TreeItem) {
        TreeItem item = (TreeItem) widget;
        TreeItemAdapter parent = new TreeItemAdapter(item).getParent();
View Full Code Here

            fExpandedElements = fViewer.getExpandedElements();

          /* Remember Selected Elements if present */
          IStructuredSelection sel = (IStructuredSelection) fViewer.getSelection();
          if (!sel.isEmpty())
            fSelectedElements = sel.toArray();

          /* Refresh Tree */
          BusyIndicator.showWhile(getDisplay(), new Runnable() {
            public void run() {
              fViewer.refresh(false);
View Full Code Here

        ISearchFilter filter = (ISearchFilter) iterator.next();
        filtersToDelete.add(filter);
      }

      fSearchFilterDao.deleteAll(filtersToDelete);
      fViewer.remove(selection.toArray());
      fixOrderAfterDelete();
      updateTitle();
    }
  }
View Full Code Here

    }

    void doRemove() {
        IStructuredSelection sel = (IStructuredSelection) viewer.getSelection();

        viewer.remove(sel.toArray());
        data.removeAll(sel.toList());

        if (!sel.isEmpty())
            markDirty();
    }
View Full Code Here

    void doRemove() {
        IStructuredSelection sel = (IStructuredSelection) viewer.getSelection();
        if (!sel.isEmpty()) {
            testSuites.removeAll(sel.toList());
            viewer.remove(sel.toArray());
            markDirty();
            validate();
        }
    }
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.