Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.SelectionChangedEvent


    /**
     * Fires a SelectionEvent to all registered selection listeners.
     */
    private void fireSelectionChangedEvent() {
        firingSelectionChangedEvent = true;
        SelectionChangedEvent event =
                new SelectionChangedEvent(root, root.getSelection());
        Object[] listeners = selectionChangedListeners.getListeners();
        if (listeners != null && listeners.length > 0) {
            for (int i = 0; i < listeners.length; i++) {
                if (listeners[i] != null) {
                    ((ISelectionChangedListener) listeners[i]).
View Full Code Here


                elements.size());

        // Should throw an IllegalArgumentException (the element list should
        // only contain ODOMElements).
        try {
            SelectionChangedEvent event =
                    new SelectionChangedEvent(sp, structuredSelection);
            manager.selectionChanged(event);
            fail("Expected and IllegalArgumentException");
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testSetEnabled() throws Exception {
        StructuredSelection structuredSelection = new StructuredSelection();
        MockDefaultODOMElementSelectionProvider provider =
                getMockProviderFromFilter(null);

        SelectionChangedEvent event =
                new SelectionChangedEvent(sp, structuredSelection);

        // check the manager is working
        manager.selectionChanged(event);
        assertTrue("Update should have been called.", provider.updateCalled);
        provider.updateCalled = false;
View Full Code Here

                elements.size());

        assertFalse("Update should not have been called.", provider.updateCalled);
        // Should use the listeners' providers update method(s). Testing this
        // behaviour should be covered by the DefaultODOMSelectionProvderTestCase.
        SelectionChangedEvent event =
                new SelectionChangedEvent(sp, structuredSelection);
        manager.selectionChanged(event);
        assertTrue("Update should have been called.", provider.updateCalled);
    }
View Full Code Here

        synchronized (selection) {
            selection.clear();
            selection.addAll(selectionList);
        }
        // Create the event that is fired to interested listeners.
        SelectionChangedEvent event =
                new SelectionChangedEvent(this, getSelection());
        Object[] listeners = selectionChangedListeners.getListeners();
        // Fire a SelectionChangedEvent at each listener.
        for (int i = 0; i < listeners.length; i++) {
            ((ISelectionChangedListener) listeners[i]).selectionChanged(event);
        }
View Full Code Here

            public void setSelection(ISelection iSelection) {
            }
        };

        // Create the selection event and give it to the manager.
        SelectionChangedEvent event =
                new SelectionChangedEvent(sp, structuredSelection);
        manager.selectionChanged(event);
    }
View Full Code Here

   * fires a SelectionChangedEvent to all listening SelectionChangedListeners
   */
  public void notifySelectionService() {
    for (ISelectionChangedListener listener : selectionChangedListeners) {

      SelectionChangedEvent event = new SelectionChangedEvent(
          selectionProvider, new StructuredSelection(
              zestGraph.getSelection()));
      try {
        listener.selectionChanged(event);
      } catch (Exception e) {
View Full Code Here

    IStructuredSelection structuredSelection = (IStructuredSelection) selection;

    mCurrentSelection = structuredSelection;

    for (ISelectionChangedListener listener : mListeners) {
      SelectionChangedEvent event = new SelectionChangedEvent(this, mCurrentSelection);

      listener.selectionChanged(event);
    }
  }
View Full Code Here

      selectionProvider.addSelectionChangedListener(this);

      // Fake a selection changed event to update the menus.
      //
      if (selectionProvider.getSelection() != null) {
        selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
      }
    }
  }
View Full Code Here

   */
  public void setSelection(ISelection selection) {
    editorSelection = selection;

    for (ISelectionChangedListener listener : selectionChangedListeners) {
      listener.selectionChanged(new SelectionChangedEvent(this, selection));
    }
    setStatusLineManager(selection);
  }
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.