Class UIEvents


  • public class UIEvents
    extends java.lang.Object
    E4 UI events and event topic definitions. This file contains generated and hand crafted event topic constants. There are also hand crafted utility methods for constructing topic strings and publishing events. When the UI model changes org.eclipse.e4.ui.internal.workbench.swt.GenTopic should be run as an Eclipse application and the console results should be pasted into this file replacing the code below the "Place Generated Code Here" comment
    Since:
    1.0
    Restriction:
    This class is not intended to be subclassed by clients.
    Restriction:
    This class is not intended to be instantiated by clients.
    • Field Detail

      • TOPIC_SEP

        public static final java.lang.String TOPIC_SEP
        Topic separator character
        See Also:
        Constant Field Values
      • ALL_SUB_TOPICS

        public static final java.lang.String ALL_SUB_TOPICS
        Wild card character for matching all sub topics
        See Also:
        Constant Field Values
      • UITopicBase

        public static final java.lang.String UITopicBase
        Base name of all E4 UI events
        See Also:
        Constant Field Values
      • UIModelTopicBase

        public static final java.lang.String UIModelTopicBase
        Name element for all E4 UI model events (these are generated by GenTopic)
        See Also:
        Constant Field Values
      • UIRendererTopicBase

        public static final java.lang.String UIRendererTopicBase
        Name element for E4 Renderer events
        Since:
        1.1
        See Also:
        Constant Field Values
      • ALL_ELEMENT_ID

        public static final java.lang.String ALL_ELEMENT_ID
        Special id passed to force all elements to be checked
        Since:
        1.1
        See Also:
        Constant Field Values
    • Constructor Detail

      • UIEvents

        public UIEvents()
    • Method Detail

      • isMOVE

        public static boolean isMOVE​(org.osgi.service.event.Event event)
        Parameters:
        event - An OSGI event representing a UIEvent
        Returns:
        true if it is a move event, false otherwise.
        Since:
        1.10
      • isSET

        public static boolean isSET​(org.osgi.service.event.Event event)
        Parameters:
        event - An OSGI event representing a UIEvent
        Returns:
        true if it is a set event, false otherwise.
      • isCREATE

        public static boolean isCREATE​(org.osgi.service.event.Event event)
        Parameters:
        event - An OSGI event representing a UIEvent
        Returns:
        true if it is a create event, false otherwise.
      • contains

        public static boolean contains​(org.osgi.service.event.Event event,
                                       java.lang.String propertyName,
                                       java.lang.Object o)
        Return true if the specified property contains o. Intended as a helper function for UIEvents.EventTypes.ADD, UIEvents.EventTypes.ADD_MANY, UIEvents.EventTypes.REMOVE, and UIEvents.EventTypes.REMOVE_MANY. If the property is not a container (e.g., a collection or array), then return true then if container is equal to o.
        Parameters:
        event - the event
        propertyName - the property name
        o - the object to check for containment
        Returns:
        true if the property value contains o or is equal to o
      • asIterable

        public static java.lang.Iterable<?> asIterable​(org.osgi.service.event.Event event,
                                                       java.lang.String propertyName)
        Return the provided event property as an iterable. If already a collection, return the collection.
        Parameters:
        event - the event object
        propertyName - the name of the property
        Returns:
        an iterable collection over the property elements
      • publishEvent

        public static boolean publishEvent​(java.lang.String topic,
                                           MUIElement changedElement)
        Publish the topic to the changedElements global event bus. The changedElement is added the the EventTags.ELEMENT tag.
        Parameters:
        topic - to broadcast
        changedElement - the element that changed
        Returns:
        true if the event is published correctly, false otherwise
      • publishEvent

        public static boolean publishEvent​(java.lang.String topic,
                                           java.util.Map<java.lang.String,​java.lang.Object> argMap)
        Publish the topic with the provided arguments to the global event bus. argMap MUST contain an EventTags.ELEMENT argument that is an MUIElement. the contained MUIElement will be used to determine the event bus to publish to.
        Parameters:
        topic - to broadcast
        argMap - arguments map with a minimum of a changedElement
        Returns:
        true if the event is published correctly, false otherwise
      • buildTopic

        @Deprecated
        public static java.lang.String buildTopic​(java.lang.String topic)
        Deprecated.
      • buildTopic

        @Deprecated
        public static java.lang.String buildTopic​(java.lang.String topic,
                                                  java.lang.String attrName)
        Deprecated.
      • buildTopic

        @Deprecated
        public static java.lang.String buildTopic​(java.lang.String topic,
                                                  java.lang.String attrName,
                                                  java.lang.String eventType)
        Deprecated.