Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.SelectionChangedEvent


        return SimpleWizardSelectionPage.this.getText(element);
      }
    });
    listViewer.addDoubleClickListener(new IDoubleClickListener() {
      public void doubleClick(DoubleClickEvent event) {
        selectionChanged(new SelectionChangedEvent(listViewer,
            listViewer.getSelection()));
        advanceToNextPage();
      }
    });
    listViewer.setSorter(new ViewerSorter());
View Full Code Here


    private void fireSelectionChanged()
    {
        for (final Iterator it = _selectionListeners.iterator(); it.hasNext();)
        {
            ISelectionChangedListener listener = (ISelectionChangedListener) it.next();
            listener.selectionChanged(new SelectionChangedEvent(this, _selection));
        }
    }
View Full Code Here

    private StructuredTextEditor getStructuredTextEditor() {
      return fEditor;
    }

    void handlePostSelectionChanged(SelectionChangedEvent event) {
      SelectionChangedEvent updatedEvent = null;
      if (fLastSelection == event.getSelection() && fLastSelectionProvider == event.getSelectionProvider()) {
        updatedEvent = fLastUpdatedSelectionChangedEvent;
      }
      else {
        updatedEvent = updateEvent(event);
      }
      // only update the range indicator on post selection
      StructuredTextEditor localEditor = fEditor;

      if (localEditor != null) {
        localEditor.updateRangeIndication(updatedEvent.getSelection());
        fireSelectionChanged(updatedEvent, postListeners);
      }
    }
View Full Code Here

        fireSelectionChanged(updatedEvent, postListeners);
      }
    }

    void handleSelectionChanged(SelectionChangedEvent event) {
      SelectionChangedEvent updatedEvent = event;
      if (fLastSelection != event.getSelection() || fLastSelectionProvider != event.getSelectionProvider()) {
        fLastSelection = event.getSelection();
        fLastSelectionProvider = event.getSelectionProvider();
        fLastUpdatedSelectionChangedEvent = updatedEvent = updateEvent(event);
      }
View Full Code Here

          }
        }
        if (selection == null)
          selection = new StructuredTextSelection(getDocument(), (ITextSelection) event.getSelection(), new Object[0]);
      }
      SelectionChangedEvent newEvent = new SelectionChangedEvent(event.getSelectionProvider(), selection);
      return newEvent;
    }
View Full Code Here

             * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
             */
            public void doubleClick(DoubleClickEvent event) {
                  IStructuredSelection s = (IStructuredSelection) event
            .getSelection();
        selectionChanged(new SelectionChangedEvent(event.getViewer(), s));
       
        Object element = s.getFirstElement();
                if (treeViewer.isExpandable(element)) {
                  treeViewer.setExpandedState(element, !treeViewer
                            .getExpandedState(element));
View Full Code Here

    ISelection originalSelection = selectionProvider.getSelection();
    if (selectionProvider instanceof StructuredSelectionProvider && originalSelection instanceof ITextSelection) {
      ITextSelection textSelection = (ITextSelection) originalSelection;
      // make sure the old selection is actually still valid
      if (!textSelection.isEmpty() && (document == null || textSelection.getOffset() + textSelection.getLength() <= document.getLength())) {
        SelectionChangedEvent syntheticEvent = new SelectionChangedEvent(selectionProvider, new TextSelection(textSelection.getOffset(), textSelection.getLength()));
        ((StructuredSelectionProvider) selectionProvider).handleSelectionChanged(syntheticEvent);
        ((StructuredSelectionProvider) selectionProvider).handlePostSelectionChanged(syntheticEvent);
      }
      else {
        SelectionChangedEvent syntheticEvent = new SelectionChangedEvent(selectionProvider, new TextSelection(0, 0));
        ((StructuredSelectionProvider) selectionProvider).handleSelectionChanged(syntheticEvent);
        ((StructuredSelectionProvider) selectionProvider).handlePostSelectionChanged(syntheticEvent);
      }
    }
  }
View Full Code Here

    private StructuredTextEditor getStructuredTextEditor() {
      return fEditor;
    }

    void handlePostSelectionChanged(SelectionChangedEvent event) {
      SelectionChangedEvent updatedEvent = null;
      if (fLastSelection == event.getSelection() && fLastSelectionProvider == event.getSelectionProvider()) {
        updatedEvent = fLastUpdatedSelectionChangedEvent;
      }
      else {
        updatedEvent = updateEvent(event);
      }
      // only update the range indicator on post selection
      StructuredTextEditor localEditor = fEditor;

      if (localEditor != null) {
        localEditor.updateRangeIndication(updatedEvent.getSelection());
        fireSelectionChanged(updatedEvent, postListeners);
      }
    }
View Full Code Here

        fireSelectionChanged(updatedEvent, postListeners);
      }
    }

    void handleSelectionChanged(SelectionChangedEvent event) {
      SelectionChangedEvent updatedEvent = event;
      if (fLastSelection != event.getSelection() || fLastSelectionProvider != event.getSelectionProvider()) {
        fLastSelection = event.getSelection();
        fLastSelectionProvider = event.getSelectionProvider();
        fLastUpdatedSelectionChangedEvent = updatedEvent = updateEvent(event);
      }
View Full Code Here

          }
        }
        if (selection == null)
          selection = new StructuredTextSelection(getDocument(), (ITextSelection) event.getSelection(), new Object[0]);
      }
      SelectionChangedEvent newEvent = new SelectionChangedEvent(event.getSelectionProvider(), selection);
      return newEvent;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.SelectionChangedEvent

Copyright © 2018 www.massapicom. 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.