# Class UIEvents

java.lang.Object
org.eclipse.e4.ui.workbench.UIEvents

public class UIEvents extends 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.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static interface`
`UIEvents.Application`
`static interface`
`UIEvents.ApplicationElement`
`static interface`
`UIEvents.BindingContext`
`static interface`
`UIEvents.Bindings`
`static interface`
`UIEvents.BindingTable`
`static interface`
`UIEvents.BindingTableContainer`
`static interface`
`UIEvents.Category`
`static interface`
`UIEvents.Command`
`static interface`
`UIEvents.CommandParameter`
`static interface`
`UIEvents.Context`
`static interface`
`UIEvents.Contribution`
`static interface`
`UIEvents.CoreExpression`
`static interface`
`UIEvents.Dirtyable`
`static interface`
`UIEvents.ElementContainer`
`static interface`
`UIEvents.EventTags`
E4 UI Event argument attribute keys.
`static interface`
`UIEvents.EventTypes`
E4 UI Event Types.
`static interface`
`UIEvents.GenericTile`
`static interface`
`UIEvents.GenericTrimContainer`
`static interface`
`UIEvents.HandledItem`
`static interface`
`UIEvents.Handler`
`static interface`
`UIEvents.HandlerContainer`
`static interface`
`UIEvents.ImperativeExpression`
`static interface`
`UIEvents.Item`
`static interface`
`UIEvents.KeyBinding`
`static interface`
`UIEvents.KeySequence`
`static interface`
`UIEvents.Menu`
`static interface`
`UIEvents.MenuContribution`
`static interface`
`UIEvents.MenuContributions`
`static interface`
`UIEvents.MenuElement`
`static interface`
`UIEvents.OpaqueMenuItem`
`static interface`
`UIEvents.OpaqueMenuSeparator`
`static interface`
`UIEvents.OpaqueToolItem`
`static interface`
`UIEvents.Parameter`
`static interface`
`UIEvents.Part`
`static interface`
`UIEvents.PartDescriptor`
`static interface`
`UIEvents.PartDescriptorContainer`
`static interface`
`UIEvents.Perspective`
`static interface`
`UIEvents.Placeholder`
`static interface`
`UIEvents.RenderedMenu`
`static interface`
`UIEvents.RenderedMenuItem`
`static interface`
`UIEvents.RenderedToolBar`
`static interface`
`UIEvents.SnippetContainer`
`static interface`
`UIEvents.StringToObjectMap`
`static interface`
`UIEvents.StringToStringMap`
`static interface`
`UIEvents.ToolBarContribution`
`static interface`
`UIEvents.ToolBarContributions`
`static interface`
`UIEvents.ToolItem`
`static interface`
`UIEvents.TrimBar`
`static interface`
`UIEvents.TrimContribution`
`static interface`
`UIEvents.TrimContributions`
`static interface`
`UIEvents.TrimmedWindow`
`static interface`
`UIEvents.UIElement`
`static interface`
`UIEvents.UILabel`
`static interface`
`UIEvents.UILifeCycle`
E4 UI life cycle events.
`static interface`
`UIEvents.Window`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ALL_ELEMENT_ID`
Special id passed to force all elements to be checked
`static final String`
`ALL_SUB_TOPICS`
Wild card character for matching all sub topics
`static final String`
`REQUEST_ENABLEMENT_UPDATE_TOPIC`
Event sent when a enabled update is requested for tool-items.
`static final String`
`TOPIC_SEP`
Topic separator character
`static final String`
`UIModelTopicBase`
Name element for all E4 UI model events (these are generated by GenTopic)
`static final String`
`UIRendererTopicBase`
Name element for E4 Renderer events
`static final String`
`UITopicBase`
Base name of all E4 UI events

## Constructor Summary

Constructors
Constructor
Description
`UIEvents()`

## Method Summary

Modifier and Type
Method
Description
`static Iterable<?>`
`asIterable(Event event, String propertyName)`
Return the provided event property as an iterable.
`static String`
`buildTopic(String topic)`
Deprecated.
`static String`
`buildTopic(String topic, String attrName)`
Deprecated.
`static String`
`buildTopic(String topic, String attrName, String eventType)`
Deprecated.
`static boolean`
`contains(Event event, String propertyName, Object o)`
Return true if the specified property contains `o`.
`static boolean`
`isADD(Event event)`
`static boolean`
`isCREATE(Event event)`
`static boolean`
`isMOVE(Event event)`
`static boolean`
`isREMOVE(Event event)`
`static boolean`
`isSET(Event event)`
`static boolean`
`publishEvent(String topic, Map<String,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.
`static boolean`
`publishEvent(String topic, MUIElement changedElement)`
Publish the topic to the changedElements global event bus.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### TOPIC_SEP

public static final String TOPIC_SEP
Topic separator character

See Also:
  - Constant Field Values

### ALL_SUB_TOPICS

public static final String ALL_SUB_TOPICS
Wild card character for matching all sub topics

See Also:
  - Constant Field Values

### UITopicBase

public static final String UITopicBase
Base name of all E4 UI events

See Also:
  - Constant Field Values

### UIModelTopicBase

public static final String UIModelTopicBase
Name element for all E4 UI model events (these are generated by GenTopic)

See Also:
  - Constant Field Values

### UIRendererTopicBase

public static final String UIRendererTopicBase
Name element for E4 Renderer events

Since:
  1.1
See Also:
  - Constant Field Values

### REQUEST_ENABLEMENT_UPDATE_TOPIC

public static final String REQUEST_ENABLEMENT_UPDATE_TOPIC
Event sent when a enabled update is requested for tool-items.

As a value you may pass in to the `IEventBroker.DATA`:

- the special value `ALL_ELEMENT_ID` to request changes of all applicable elements (the default)
- the `MApplicationElement.getElementId()` of the element to check
- instance of `Selector`

Since:
  1.1
See Also:
  - Constant Field Values

### ALL_ELEMENT_ID

public static final String ALL_ELEMENT_ID
Special id passed to force all elements to be checked

Since:
  1.1
See Also:
  - Constant Field Values

## Constructor Details

### UIEvents

public UIEvents()

## Method Details

### isADD

public static boolean isADD(Event event)

Parameters:
  `event` - An OSGI event representing a UIEvent
Returns:
  true if it is an add event (i.e., `UIEvents.EventTypes.ADD` or `UIEvents.EventTypes.ADD_MANY`), or false otherwise.
See Also:
  - `UIEvents.EventTags.NEW_VALUE`
  - `asIterable(Event, String)`

### isREMOVE

public static boolean isREMOVE(Event event)

Parameters:
  `event` - An OSGI event representing a UIEvent
Returns:
  true if it is a remove event (i.e., `UIEvents.EventTypes.REMOVE` or `UIEvents.EventTypes.REMOVE_MANY`), or false otherwise.
See Also:
  - `UIEvents.EventTags.OLD_VALUE`
  - `asIterable(Event, String)`

### isMOVE

public static boolean isMOVE(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(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(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(Event event, String propertyName, 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 Iterable<?> asIterable(Event event, 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(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(String topic, Map<String,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 String buildTopic(String topic)
Deprecated.

### buildTopic

@Deprecated public static String buildTopic(String topic, String attrName)
Deprecated.

### buildTopic

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