Class ActiveEditorObserver

    • Method Detail

      • getLastActiveEditorPart

        public IWorkbenchPart getLastActiveEditorPart()
      • setViewer

        public void setViewer​(TreeViewer viewer)
        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

        public void refreshViewer​(Object object)
        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

        public void updateViewer​(Object element)
        Updates the element of the viewer.
        Parameters:
        element - of the tree in question.
      • revealElement

        public void revealElement​(Object element)
      • refreshDecorations

        public void refreshDecorations​(Collection<EObject> eObjects)
        It calls the refreshDecoration(EObject) for each EObject.
        Note: This method can be used to refresh decorations when loading or unloading profile applications.
        Parameters:
        eObjects - collection of EObjects for which decorations must be refreshed.
      • refreshDecoration

        public void refreshDecoration​(EObject eObject)
        The method collects all stereotypes applied to eObject from profile applications that can be found for this model in ProfileApplicationRegistry and then informs active editor decorator to decorate the eObject.
        Parameters:
        eObject - that has stereotype applications
      • setProfileApplicationChanged

        public void setProfileApplicationChanged()
        This method will be called from ProfileApplicationDecoratorReflectiveItemProviderAdapterFactory 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.