EGF Engine
Release 0.1.0

org.eclipse.egf.pattern.ui.editor.page
Class ExternalSelectionManager

java.lang.Object
  extended by org.eclipse.egf.pattern.ui.editor.page.ExternalSelectionManager
All Implemented Interfaces:
IExternalSelectionProvider

public class ExternalSelectionManager
extends Object
implements IExternalSelectionProvider

A default implementation of an external selection manager.
Handlers are registered to the type of the first selected object.
It is assumed that every other object in the selection is of the same type.
Thus handlers registering to this manager are most likely to deal with the first selected object only (although that is not mandatory).


Constructor Summary
ExternalSelectionManager()
           
 
Method Summary
 void addExternalHandlerFor(Class selectedObjectType_p, IExternalSelectionHandler handler_p)
          Add a new handler for given type.
 void dispose()
          Dispose.
 void fireExternalSelection(Object firstSelectedObject_p, IStructuredSelection selection_p)
          Fire an external selection.
 void removeExternalHandler(IExternalSelectionHandler handler_p)
          Remove given handler from all possible registrations.
 void removeExternalHandler(IExternalSelectionHandler handler_p, Class type_p)
          Remove given handler for given type.
 void removeHandlersForType(Class type_p)
          Remove all handlers for given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalSelectionManager

public ExternalSelectionManager()
Method Detail

dispose

public void dispose()
Dispose.


addExternalHandlerFor

public void addExternalHandlerFor(Class selectedObjectType_p,
                                  IExternalSelectionHandler handler_p)
Add a new handler for given type.
Several different handlers can be added for the same type.

Parameters:
selectedObjectType_p - The selected object type, must be not null.
handler_p - The new handler, must be not null.

removeHandlersForType

public void removeHandlersForType(Class type_p)
Remove all handlers for given type.

Parameters:
type_p - The type of the selected object.

removeExternalHandler

public void removeExternalHandler(IExternalSelectionHandler handler_p)
Remove given handler from all possible registrations.
That is remove the handler, whatever the types it may be registered for.

Parameters:
handler_p - The handler to remove, must be not null.

removeExternalHandler

public void removeExternalHandler(IExternalSelectionHandler handler_p,
                                  Class type_p)
Remove given handler for given type.

Parameters:
handler_p - The handler to remove, must be not null.
type_p - The type the handler is to be removed for. If null, the handler is removed for all types. This is strictly equivalent to calling removeExternalHandler(IExternalSelectionHandler) then.

fireExternalSelection

public void fireExternalSelection(Object firstSelectedObject_p,
                                  IStructuredSelection selection_p)
Description copied from interface: IExternalSelectionProvider
Fire an external selection.

Specified by:
fireExternalSelection in interface IExternalSelectionProvider
Parameters:
firstSelectedObject_p - The first selected object of the selection.
selection_p - The whole selection.
See Also:
org.eclipse.egf.pattern.ui.editor.page.IExternalSelectionProvider#fireExternalSelection(java.lang.Object, org.eclipse.jface.viewers.IStructuredSelection)

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.