Class ActiveEditorObserver
java.lang.Object
org.modelversioning.emfprofile.application.registry.ui.observer.ActiveEditorObserver
- All Implemented Interfaces:
PluginExtensionOperationsListener
It manages mapping of opened editors of interest to
the generated id for an opened model in editor.
It is also a
PluginExtensionOperationsListener
.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyStereotype
(EObject eObject) Executes the operation of applying stereotypes on givenEObject
void
cleanUp()
The cleanup is executed if the profile application view in workbench is closing, but not the Workbench.void
eObjectSelected
(EObject eObject) Notifies the extended plug-in that the new selection on an instance ofEObject
was registered.findProfileApplicationDecorator
(EObject eObject) If we needProfileApplicationDecorator
because of its extended functionalities, and callingEObject.eContainer()
will eventually returnProfileApplication
but we cannot cast it toProfileApplicationDecorator
.void
refreshDecoration
(EObject eObject) The method collects all stereotypes applied toeObject
from profile applications that can be found for this model inProfileApplicationRegistry
and then informs active editor decorator to decorate the eObject.void
refreshDecorations
(Collection<EObject> eObjects) It calls therefreshDecoration(EObject)
for eachEObject
.void
Complete refresh of the viewer tree if needed.void
refreshViewer
(Object object) Collection can be provided as parameter.void
revealElement
(Object element) void
setActivateViewFilter
(boolean activateFilter) void
This method will be called fromProfileApplicationDecoratorReflectiveItemProviderAdapterFactory
when notification is fired that an attribute is changed in properties view.void
setViewer
(TreeViewer viewer) To set the Tree Viewer from outside.void
updateViewer
(Object element) Updates the element of the viewer.
-
Field Details
-
INSTANCE
-
-
Method Details
-
getLastActiveEditorPart
-
setViewer
To set the Tree Viewer from outside. After calling this method a part listener will be added on active page which registers activation of editors that can be decorated. Note: without setting a tree viewer the services of this class implementation will work properly.- Parameters:
viewer
-
-
refreshViewer
public void refreshViewer()Complete refresh of the viewer tree if needed. -
refreshViewer
Collection can be provided as parameter. Refresh will be executed asynchronously for whole group of collection items in one runnable.- Parameters:
object
- an viewer tree element or a collection of them.
-
updateViewer
Updates the element of the viewer.- Parameters:
element
- of the tree in question.
-
revealElement
-
getModelIdForWorkbenchPart
-
applyStereotype
Executes the operation of applying stereotypes on givenEObject
- Specified by:
applyStereotype
in interfacePluginExtensionOperationsListener
-
eObjectSelected
Notifies the extended plug-in that the new selection on an instance ofEObject
was registered.- Specified by:
eObjectSelected
in interfacePluginExtensionOperationsListener
-
setActivateViewFilter
public void setActivateViewFilter(boolean activateFilter) - Parameters:
activateFilter
-true
orfalse
-
refreshDecorations
It calls therefreshDecoration(EObject)
for eachEObject
. Note: This method can be used to refresh decorations when loading or unloading profile applications.- Parameters:
eObjects
- collection ofEObject
s for which decorations must be refreshed.
-
refreshDecoration
The method collects all stereotypes applied toeObject
from profile applications that can be found for this model inProfileApplicationRegistry
and then informs active editor decorator to decorate the eObject.- Parameters:
eObject
- that has stereotype applications
-
cleanUp
public void cleanUp()The cleanup is executed if the profile application view in workbench is closing, but not the Workbench. If the workbench is closing, then the clean-up will be executed inIWorkbenchListener.preShutdown(IWorkbench, boolean)
which calls clean-up for all profile applications inDecoratableEditorPartListener.cleanUpForAllEditorParts()
. -
setProfileApplicationChanged
public void setProfileApplicationChanged()This method will be called fromProfileApplicationDecoratorReflectiveItemProviderAdapterFactory
when notification is fired that an attribute is changed in properties view. Notifications will be fired for every change, but we are here only interested in scenario when only one tree element is selected and we can find profile application decorator from it, otherwise this method will do nothing. -
findProfileApplicationDecorator
If we needProfileApplicationDecorator
because of its extended functionalities, and callingEObject.eContainer()
will eventually returnProfileApplication
but we cannot cast it toProfileApplicationDecorator
. Thus, the easiest way to get it is to ask theProfileApplicationRegistry
, which this method does for you.- Parameters:
eObject
-- Returns:
-