Interface IPresentationEngine


  • public interface IPresentationEngine
    The presentation engine is used to translate the generic workbench model into widgets. Implementations of this service are responsible for creating or destroying widgets corresponding to model elements, as well as for running any event loop required for handling user events on those widgets.
    Since:
    1.0
    Restriction:
    This interface is not intended to be implemented by clients.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String ACTIVE
      This is the tag name that indicates that the model element is active.
      static String ADORNMENT_PIN
      This is a Tag that when applied to an MUILabel element will cause whatever Image is to be shown to be adorned with the 'pinned' affordance.
      static String ANIMATIONS_ENABLED
      Deprecated.
      not supported in the Eclipse platform anymore
      static String CUSTOM_RENDERER_KEY
      This is a persistedState 'key' whose value is expected to be the URI of a subclass of ABstractPartRenderer that is to be used to render the element
      static String DISABLED_ICON_IMAGE_KEY
      This key should be used to add an optional String to an element that is a URI to the elements disabled icon.
      static String DRAGGABLE
      This is the tag name that enables the DND support for the element.
      static String HIDDEN_EXPLICITLY
      This tag can be used by the renderer implementation to decide that the user interface element has been hidden.
      static String MAXIMIZED
      When added to an element's 'tags' this should cause the presentation to minimize all other presentation elements.
      static String MIN_MAXIMIZEABLE_CHILDREN_AREA_TAG
      When applied to an MArea causes it to behave like a MPartSashContainer allowing the different parts to be minimized/maximized separately.
      static String MINIMIZED
      When added to an element's 'tags' this should cause the presentation to move that element to the trim.
      static String MINIMIZED_BY_ZOOM
      This tag should be applied to any element that had its MINIMIZED tag set due to a different element going maximized.
      static String NO_AUTO_COLLAPSE
      Don't remove the element from the display even if it has no displayable children
      static String NO_CLOSE
      When applied as a tag to an MPlaceholder inhibits the display of the close affordance.
      static String NO_DETACH
      When applied as a tag to an MUIElement inhibits detaching the element (ie.
      static String NO_MOVE
      When applied as a tag to an MUIElement inhibits moving the element (ie. through DnD...
      static String NO_RESTORE
      When applied as a tag to an MPartDescriptor marks the part as not restorable.
      static String NO_TITLE
      When applied as a tag to an MUILabel inhibits the display of the label text
      static String ORIENTATION_HORIZONTAL
      This tag can be applied to an element as a hint to the renderers that the element would prefer to be horizontal.
      static String ORIENTATION_VERTICAL
      This tag can be applied to an element as a hint to the renderers that the element would prefer to be vertical.
      static String OVERRIDE_ICON_IMAGE_KEY
      This key should be used to add an optional org.eclipse.swt.graphics.Image to an elements TRANSIENTDATA.
      static String OVERRIDE_TITLE_TOOL_TIP_KEY
      This key should be used to add an optional String to an elements TRANSIENTDATA.
      static String RENDERING_PARENT_KEY
      This key can be used , if the model element does not have a parent and a parent needs to be specified for the renderer to create the widget.
      static String SERVICE_NAME
      The ID to access the service in the IEclipseContext
      static String SPLIT_HORIZONTAL
      This tag can be applied to an element (usually an MPart) to indicate that the element should be split with the result being side by side.
      static String SPLIT_VERTICAL
      This tag can be applied to an element (usually an MPart) to indicate that the element should be split with the result being one above the other.
      static String STANDALONE
      Declare the stack as containing a singe 'standalone' view.
      static String STYLE_OVERRIDE_KEY
      This key is used to store information in the 'persistentData' map which will be used to override the initial style of an element at rendering time.
      static String WINDOW_MAXIMIZED_TAG
      When applied to an MWindow causes the renderer to maximize the resulting control.
      static String WINDOW_MINIMIZED_TAG
      When applied to an MWindow causes the renderer to minimize the resulting control.
      static String WINDOW_TOP_LEVEL
      When applied to an MWindow causes the renderer to render the resulting control as a top level window
    • Field Detail

      • NO_TITLE

        static final String NO_TITLE
        When applied as a tag to an MUILabel inhibits the display of the label text
        See Also:
        Constant Field Values
      • NO_CLOSE

        static final String NO_CLOSE
        When applied as a tag to an MPlaceholder inhibits the display of the close affordance. This allows a part to be closeable in one perspective but not in a different one. NOTE: If you are not using perspectives then use the MPart's 'isCloseable' attribute to control the affordance.
        See Also:
        Constant Field Values
      • STANDALONE

        static final String STANDALONE
        Declare the stack as containing a singe 'standalone' view. These stacks will not allow either dragging the view out of the stack nor dragging other views in.
        Since:
        1.1
        See Also:
        Constant Field Values
      • NO_AUTO_COLLAPSE

        static final String NO_AUTO_COLLAPSE
        Don't remove the element from the display even if it has no displayable children
        See Also:
        Constant Field Values
      • NO_MOVE

        static final String NO_MOVE
        When applied as a tag to an MUIElement inhibits moving the element (ie. through DnD...
        See Also:
        Constant Field Values
      • NO_DETACH

        static final String NO_DETACH
        When applied as a tag to an MUIElement inhibits detaching the element (ie. through DnD...
        Since:
        1.6
        See Also:
        Constant Field Values
      • HIDDEN_EXPLICITLY

        static final String HIDDEN_EXPLICITLY
        This tag can be used by the renderer implementation to decide that the user interface element has been hidden.
        Since:
        1.1
        See Also:
        Constant Field Values
      • STYLE_OVERRIDE_KEY

        static final String STYLE_OVERRIDE_KEY
        This key is used to store information in the 'persistentData' map which will be used to override the initial style of an element at rendering time. For example the SWT renderer will expect to see an integer (as a string) which defines the initial SWT style bits.
        Since:
        1.1
        See Also:
        Constant Field Values
      • WINDOW_MINIMIZED_TAG

        static final String WINDOW_MINIMIZED_TAG
        When applied to an MWindow causes the renderer to minimize the resulting control.
        Since:
        1.1
        See Also:
        Constant Field Values
      • WINDOW_MAXIMIZED_TAG

        static final String WINDOW_MAXIMIZED_TAG
        When applied to an MWindow causes the renderer to maximize the resulting control.
        Since:
        1.1
        See Also:
        Constant Field Values
      • MIN_MAXIMIZEABLE_CHILDREN_AREA_TAG

        static final String MIN_MAXIMIZEABLE_CHILDREN_AREA_TAG
        When applied to an MArea causes it to behave like a MPartSashContainer allowing the different parts to be minimized/maximized separately.
        Since:
        1.5
        See Also:
        Constant Field Values
      • WINDOW_TOP_LEVEL

        static final String WINDOW_TOP_LEVEL
        When applied to an MWindow causes the renderer to render the resulting control as a top level window
        Since:
        1.3
        See Also:
        Constant Field Values
      • MINIMIZED

        static final String MINIMIZED
        When added to an element's 'tags' this should cause the presentation to move that element to the trim. In the default implementation you can only apply this tag to an MPartStack or the MPlaceholder of the MArea.
        See Also:
        Constant Field Values
      • MAXIMIZED

        static final String MAXIMIZED
        When added to an element's 'tags' this should cause the presentation to minimize all other presentation elements. In the default implementation you can only apply this tag to an MPartStack or the MPlaceholder of the MArea.
        See Also:
        Constant Field Values
      • MINIMIZED_BY_ZOOM

        static final String MINIMIZED_BY_ZOOM
        This tag should be applied to any element that had its MINIMIZED tag set due to a different element going maximized. This allows the restore operation to only restore elements that the user did not explicitly minimize.
        See Also:
        Constant Field Values
      • ORIENTATION_HORIZONTAL

        static final String ORIENTATION_HORIZONTAL
        This tag can be applied to an element as a hint to the renderers that the element would prefer to be horizontal. For an MPart this could be used both as a hint to how to show the view when it's in the trim but could also be used when picking a stack to add a newly opening part to. It could also be used for example to control where the tabs appear on an MPartStack.
        See Also:
        Constant Field Values
      • ORIENTATION_VERTICAL

        static final String ORIENTATION_VERTICAL
        This tag can be applied to an element as a hint to the renderers that the element would prefer to be vertical. For an MPart this could be used both as a hint to how to show the view when it's in the trim but could also be used when picking a stack to add a newly opening part to. It could also be used for example to control where the tabs appear on an MPartStack.
        See Also:
        Constant Field Values
      • SPLIT_HORIZONTAL

        static final String SPLIT_HORIZONTAL
        This tag can be applied to an element (usually an MPart) to indicate that the element should be split with the result being side by side.
        Since:
        1.1
        See Also:
        Constant Field Values
      • SPLIT_VERTICAL

        static final String SPLIT_VERTICAL
        This tag can be applied to an element (usually an MPart) to indicate that the element should be split with the result being one above the other.
        Since:
        1.1
        See Also:
        Constant Field Values
      • DISABLED_ICON_IMAGE_KEY

        static final String DISABLED_ICON_IMAGE_KEY
        This key should be used to add an optional String to an element that is a URI to the elements disabled icon. This is used, for example, by Toolbar Items which, in Eclipse SDK, provide a unique icon for disabled tool items that look better than the OS default graying on the default icon. There is a strong argument to be made that this disabledIconURI actually be part of the model
        See Also:
        Constant Field Values
      • OVERRIDE_ICON_IMAGE_KEY

        static final String OVERRIDE_ICON_IMAGE_KEY
        This key should be used to add an optional org.eclipse.swt.graphics.Image to an elements TRANSIENTDATA. If present, the image will be used to override that elements iconURI. An example is drawing the error icon on a minimized problems view stack. NOTE: This image must be checked to ensure that it hasn't been disposed on retrieval.
        See Also:
        Constant Field Values
      • OVERRIDE_TITLE_TOOL_TIP_KEY

        static final String OVERRIDE_TITLE_TOOL_TIP_KEY
        This key should be used to add an optional String to an elements TRANSIENTDATA. If present, the string will be used to override the elements TitleToolTip. An example is setting the ToolTip of a minimized problems view stack to the number of errors and warnings in the view.
        See Also:
        Constant Field Values
      • ADORNMENT_PIN

        static final String ADORNMENT_PIN
        This is a Tag that when applied to an MUILabel element will cause whatever Image is to be shown to be adorned with the 'pinned' affordance.
        Since:
        1.1
        See Also:
        Constant Field Values
      • ANIMATIONS_ENABLED

        static final String ANIMATIONS_ENABLED
        Deprecated.
        not supported in the Eclipse platform anymore
        This is a Boolean preference used to control animations in the application
        See Also:
        Constant Field Values
      • CUSTOM_RENDERER_KEY

        static final String CUSTOM_RENDERER_KEY
        This is a persistedState 'key' whose value is expected to be the URI of a subclass of ABstractPartRenderer that is to be used to render the element
        See Also:
        Constant Field Values
      • RENDERING_PARENT_KEY

        static final String RENDERING_PARENT_KEY
        This key can be used , if the model element does not have a parent and a parent needs to be specified for the renderer to create the widget.
        Since:
        1.4
        See Also:
        Constant Field Values
      • DRAGGABLE

        static final String DRAGGABLE
        This is the tag name that enables the DND support for the element. The element's tags list has to be updated with the tag in order to enable the DND processing.
        Since:
        1.1
        See Also:
        Constant Field Values
      • ACTIVE

        static final String ACTIVE
        This is the tag name that indicates that the model element is active.
        Since:
        1.3
        See Also:
        Constant Field Values
      • NO_RESTORE

        static final String NO_RESTORE
        When applied as a tag to an MPartDescriptor marks the part as not restorable.
        Since:
        1.6
        See Also:
        Constant Field Values
    • Method Detail

      • createGui

        Object createGui​(MUIElement element,
                         Object parentWidget,
                         IEclipseContext parentContext)
        Creates and returns the UI element for the given model element.
        Parameters:
        element - the model element
        parentWidget - the parent
        parentContext - the context within which this element is being rendered
        Returns:
        the created UI element
      • createGui

        Object createGui​(MUIElement element)
        Creates and returns the UI element corresponding to the given model element. The resulting UI element sits at the top of a widget hierarchy
        Parameters:
        element - the model element
        Returns:
        the create UI element
      • removeGui

        void removeGui​(MUIElement element)
        Remove the UI element created for this model element.
        Parameters:
        element - the model element whose UI element should removed
      • focusGui

        void focusGui​(MUIElement element)
        Attempts to set the UI focus onto the given element. By default we delegate this to the elements implementation's @Focus method (if any). If no such method exists we delegate the the renderer's 'forceFocus' method.
        Parameters:
        element - the element to set UI focus on
      • run

        Object run​(MApplicationElement uiRoot,
                   IEclipseContext appContext)
        Run the UI. This method is responsible for creating the initial UI and (if necessary) spinning the event loop for the life of the application.
        Parameters:
        uiRoot - the root gui element
        appContext - application context
        Returns:
        The application's return value
      • stop

        void stop()
        Shuts down the presentation engine