diff options
| author | Dean Roberts | 2011-11-29 19:32:56 +0000 |
|---|---|---|
| committer | Paul Webster | 2011-11-29 19:32:56 +0000 |
| commit | 6046e7de40a4c7dc7a70dd1580afb05a2d3a8e57 (patch) | |
| tree | b5625e94d613f79dbcc09c54f21a9ac6f94b86e2 | |
| parent | 292131cab2810efc8743447f56509bdee53b22c8 (diff) | |
| download | eclipse.platform.ui-6046e7de40a4c7dc7a70dd1580afb05a2d3a8e57.tar.gz eclipse.platform.ui-6046e7de40a4c7dc7a70dd1580afb05a2d3a8e57.tar.xz eclipse.platform.ui-6046e7de40a4c7dc7a70dd1580afb05a2d3a8e57.zip | |
Bug 363961 - Restructure UIEvents to increase clarity and performancev20111129-1932
31 files changed, 733 insertions, 284 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java index 368d14330ef..5a559b7ce74 100644 --- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java +++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java @@ -277,14 +277,9 @@ public class CleanupAddon { @PostConstruct void init(IEclipseContext context) { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.CHILDREN), childrenHandler); - eventBroker.subscribe( - UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.TOBERENDERED), - renderingChangeHandler); - eventBroker.subscribe( - UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.VISIBLE), - visibilityChangeHandler); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_CHILDREN, childrenHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_TOBERENDERED, renderingChangeHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_VISIBLE, visibilityChangeHandler); } @PreDestroy diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDAddon.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDAddon.java index 5727c4ed2e3..64ba1bc1c4a 100644 --- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDAddon.java +++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDAddon.java @@ -51,7 +51,7 @@ public class DnDAddon { @PostConstruct void hookListeners() { - String topic = UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.WIDGET); + String topic = UIEvents.UIElement.WIDGET; eventBroker.subscribe(topic, null, installHook, false); } diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDManager.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDManager.java index 5b5be2db1c8..9447a8065ff 100644 --- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDManager.java +++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDManager.java @@ -112,9 +112,7 @@ class DnDManager { } }; - eventBroker.subscribe( - UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.WIDGET), - stackWidgetHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, stackWidgetHandler); getDragShell().addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java index b80a2cc0fbb..4477ec00fde 100644 --- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java +++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java @@ -414,20 +414,12 @@ public class MinMaxAddon { @PostConstruct void hookListeners() { - String topic = UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.WIDGET); - eventBroker.subscribe(topic, widgetListener); - topic = UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.CHILDREN); - eventBroker.subscribe(topic, perspectiveRemovedListener); - topic = UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.SELECTEDELEMENT); - eventBroker.subscribe(topic, perspectiveChangeListener); - topic = UIEvents.buildTopic(UIEvents.ApplicationElement.TOPIC, - UIEvents.ApplicationElement.TAGS); - eventBroker.subscribe(topic, tagChangeListener); - topic = UIEvents.buildTopic(UIEvents.ApplicationElement.TOPIC, - UIEvents.ApplicationElement.ELEMENTID); - eventBroker.subscribe(topic, idChangeListener); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, widgetListener); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_CHILDREN, perspectiveRemovedListener); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, + perspectiveChangeListener); + eventBroker.subscribe(UIEvents.ApplicationElement.TOPIC_TAGS, tagChangeListener); + eventBroker.subscribe(UIEvents.ApplicationElement.TOPIC_ELEMENTID, idChangeListener); eventBroker.subscribe(UIEvents.UILifeCycle.PERSPECTIVE_SAVED, perspSavedListener); eventBroker.subscribe(UIEvents.UILifeCycle.PERSPECTIVE_OPENED, perspOpenedListener); diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java index ece1f94bb1b..de8d2f0f9d3 100644 --- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java +++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java @@ -317,14 +317,9 @@ public class TrimStack { @PostConstruct void addListeners() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.CHILDREN), childrenHandler); - eventBroker.subscribe( - UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.TOBERENDERED), - toBeRenderedHandler); - eventBroker.subscribe( - UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.WIDGET), - widgetHandler); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_CHILDREN, childrenHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_TOBERENDERED, toBeRenderedHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, widgetHandler); eventBroker.subscribe(UIEvents.UILifeCycle.BRINGTOTOP, openHandler); eventBroker.subscribe(UIEvents.UILifeCycle.ACTIVATE, closeHandler); } diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AreaRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AreaRenderer.java index 9c5b65e307c..b0ac5250e27 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AreaRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AreaRenderer.java @@ -93,11 +93,8 @@ public class AreaRenderer extends SWTPartRenderer { @PostConstruct void init() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC), - itemUpdater); - eventBroker - .subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIElement.WIDGET), widgetListener); + eventBroker.subscribe(UIEvents.UILabel.TOPIC_ALL, itemUpdater); + eventBroker.subscribe(UIElement.TOPIC_WIDGET, widgetListener); } @PreDestroy diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java index c34a14f3128..6a985c33a2f 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java @@ -76,9 +76,8 @@ public abstract class LazyStackRenderer extends SWTPartRenderer { // will call this method eventBroker.unsubscribe(lazyLoader); - eventBroker.subscribe(UIEvents.buildTopic( - UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.SELECTEDELEMENT), lazyLoader); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, + lazyLoader); } /** diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuItemRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuItemRenderer.java index 54e2d748164..c05e05fa778 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuItemRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuItemRenderer.java @@ -137,13 +137,9 @@ public abstract class MenuItemRenderer extends SWTPartRenderer { @PostConstruct public void init() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC), - itemUpdater); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.Item.TOPIC, - UIEvents.Item.SELECTED), selectionUpdater); - eventBroker - .subscribe(UIEvents.buildTopic(UIEvents.Item.TOPIC, - UIEvents.Item.ENABLED), enabledUpdater); + eventBroker.subscribe(UIEvents.UILabel.TOPIC_ALL, itemUpdater); + eventBroker.subscribe(UIEvents.Item.TOPIC_SELECTED, selectionUpdater); + eventBroker.subscribe(UIEvents.Item.TOPIC_ENABLED, enabledUpdater); } @PreDestroy diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java index 2b817a08726..6216f6a9639 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java @@ -207,15 +207,11 @@ public class MenuManagerRenderer extends SWTPartRenderer { @PostConstruct public void init() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC), - itemUpdater); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.Item.TOPIC, - UIEvents.Item.SELECTED), selectionUpdater); + eventBroker.subscribe(UIEvents.UILabel.TOPIC_ALL, itemUpdater); + eventBroker.subscribe(UIEvents.Item.TOPIC_SELECTED, selectionUpdater); + eventBroker.subscribe(UIEvents.Item.TOPIC_ENABLED, enabledUpdater); eventBroker - .subscribe(UIEvents.buildTopic(UIEvents.Item.TOPIC, - UIEvents.Item.ENABLED), enabledUpdater); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC), - toBeRenderedUpdater); + .subscribe(UIEvents.UIElement.TOPIC_ALL, toBeRenderedUpdater); context.set(MenuManagerRenderer.class, this); Display display = context.get(Display.class); diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java index 2184fc3b488..bb34ce49bd7 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java @@ -56,8 +56,8 @@ public class SashRenderer extends SWTPartRenderer { } }; - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.GenericTile.TOPIC, - UIEvents.GenericTile.HORIZONTAL), sashOrientationHandler); + eventBroker.subscribe(UIEvents.GenericTile.TOPIC_HORIZONTAL, + sashOrientationHandler); sashWeightHandler = new EventHandler() { public void handleEvent(Event event) { @@ -72,8 +72,8 @@ public class SashRenderer extends SWTPartRenderer { } }; - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIEvents.UIElement.CONTAINERDATA), sashWeightHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_CONTAINERDATA, + sashWeightHandler); } /** diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java index 28ccc8b1892..b99a3cc2291 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java @@ -285,8 +285,7 @@ public class StackRenderer extends LazyStackRenderer { } }; - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC), - itemUpdater); + eventBroker.subscribe(UIEvents.UILabel.TOPIC_ALL, itemUpdater); dirtyUpdater = new EventHandler() { public void handleEvent(Event event) { @@ -333,9 +332,6 @@ public class StackRenderer extends LazyStackRenderer { } }; - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.Dirtyable.TOPIC, - UIEvents.Dirtyable.DIRTY), dirtyUpdater); - viewMenuUpdater = new EventHandler() { public void handleEvent(Event event) { Object objElement = event @@ -393,11 +389,9 @@ public class StackRenderer extends LazyStackRenderer { } } }; - - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIEvents.UIElement.VISIBLE), viewMenuUpdater); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIEvents.UIElement.TOBERENDERED), viewMenuUpdater); + eventBroker.subscribe(UIEvents.Dirtyable.TOPIC_DIRTY, dirtyUpdater); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_VISIBLE, viewMenuUpdater); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_TOBERENDERED, viewMenuUpdater); } /** diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java index b84e38a86aa..d1d22237251 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java @@ -221,17 +221,13 @@ public class ToolBarManagerRenderer extends SWTPartRenderer { @PostConstruct public void init() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC), - itemUpdater); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.Item.TOPIC, - UIEvents.Item.SELECTED), selectionUpdater); + eventBroker.subscribe(UIEvents.UILabel.TOPIC_ALL, itemUpdater); + eventBroker.subscribe(UIEvents.Item.TOPIC_SELECTED, selectionUpdater); + eventBroker.subscribe(UIEvents.Item.TOPIC_ENABLED, enabledUpdater); eventBroker - .subscribe(UIEvents.buildTopic(UIEvents.Item.TOPIC, - UIEvents.Item.ENABLED), enabledUpdater); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC), - toBeRenderedUpdater); - eventBroker.subscribe(UIEvents.buildTopic(ElementContainer.TOPIC, - ElementContainer.CHILDREN), childAdditionUpdater); + .subscribe(UIEvents.UIElement.TOPIC_ALL, toBeRenderedUpdater); + eventBroker.subscribe(ElementContainer.TOPIC_CHILDREN, + childAdditionUpdater); context.set(ToolBarManagerRenderer.class, this); diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemRenderer.java index f522a0348c9..233528ff4d1 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemRenderer.java @@ -136,13 +136,9 @@ public class ToolItemRenderer extends SWTPartRenderer { @PostConstruct public void init() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC), - itemUpdater); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.Item.TOPIC, - UIEvents.Item.SELECTED), selectionUpdater); - eventBroker - .subscribe(UIEvents.buildTopic(UIEvents.Item.TOPIC, - UIEvents.Item.ENABLED), enabledUpdater); + eventBroker.subscribe(UIEvents.UILabel.TOPIC_ALL, itemUpdater); + eventBroker.subscribe(UIEvents.Item.TOPIC_SELECTED, selectionUpdater); + eventBroker.subscribe(UIEvents.Item.TOPIC_ENABLED, enabledUpdater); } @PreDestroy diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java index f76a5f7abce..faf7bb04f80 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java @@ -229,8 +229,7 @@ public class WBWRenderer extends SWTPartRenderer { } }; - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC), - shellUpdater); + eventBroker.subscribe(UIEvents.UILabel.TOPIC_ALL, shellUpdater); visibilityHandler = new EventHandler() { public void handleEvent(Event event) { @@ -261,8 +260,8 @@ public class WBWRenderer extends SWTPartRenderer { } }; - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIEvents.UIElement.VISIBLE), visibilityHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_VISIBLE, + visibilityHandler); sizeHandler = new EventHandler() { public void handleEvent(Event event) { @@ -307,8 +306,7 @@ public class WBWRenderer extends SWTPartRenderer { } }; - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.Window.TOPIC), - sizeHandler); + eventBroker.subscribe(UIEvents.Window.TOPIC_ALL, sizeHandler); childHandler = new EventHandler() { public void handleEvent(Event event) { @@ -340,9 +338,8 @@ public class WBWRenderer extends SWTPartRenderer { } }; - eventBroker.subscribe(UIEvents.buildTopic( - UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.CHILDREN), childHandler); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_CHILDREN, + childHandler); } @PreDestroy diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/GenTopic.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/GenTopic.java index 53b5721ff50..c0bcb68199d 100644 --- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/GenTopic.java +++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/GenTopic.java @@ -62,6 +62,12 @@ public class GenTopic implements IApplication { } } + private static final String interfaceDeclaration = "\n\tpublic static interface %s {"; + private static final String deprecatedTopicDeclaration = "\n\n\t@Deprecated\n\tpublic static final String ALL = \"org/eclipse/e4/ui/model/%s/%s\"; //$NON-NLS-1$\n"; + private static final String topicAllDeclaration = "\n\tpublic static final String TOPIC_ALL = \"org/eclipse/e4/ui/model/%s/%s/*\"; //$NON-NLS-1$"; + private static final String topicAttributeDeclaration = "\n\tpublic static final String TOPIC_%S = \"org/eclipse/e4/ui/model/%s/%s/%s/*\"; //$NON-NLS-1$"; + private static final String attributeDeclaration = "\n\tpublic static final String %S = \"%s\"; //$NON-NLS-1$"; + private void processEClass(EClass eClass) { EList<EStructuralFeature> features = eClass.getEStructuralFeatures(); if (features.isEmpty()) { @@ -70,19 +76,30 @@ public class GenTopic implements IApplication { String pkgName = eClass.getEPackage().getName(); String className = eClass.getName(); System.out.print("\r\r\t@SuppressWarnings(\"javadoc\")"); + System.out.print(String.format(interfaceDeclaration, className)); + System.out.print("\n\n\t//Topics that can be subscribed to"); + System.out.print(String.format(deprecatedTopicDeclaration, pkgName, + className)); System.out - .print("\n\tpublic static interface " + className + " {" //$NON-NLS-1$ //$NON-NLS-2$ - + "\n\t\tpublic static final String TOPIC = UIModelTopicBase + \"/" //$NON-NLS-1$ - + pkgName + '/' + className + "\"; //$NON-NLS-1$"); //$NON-NLS-1$ + .print(String.format(topicAllDeclaration, pkgName, className)); + Set<String> names = new TreeSet<String>(); for (EStructuralFeature feature : features) { names.add(feature.getName()); } + + for (String name : names) { + System.out.print(String.format(topicAttributeDeclaration, name, + pkgName, className, name)); + } + + System.out.print("\n"); //$NON-NLS-1$ + System.out + .print("\n\t//Attributes that can be tested in event handlers"); for (String name : names) { - System.out.print("\n\t\tpublic static final String " //$NON-NLS-1$ - + name.toUpperCase() + " = \""); //$NON-NLS-1$ - System.out.print(name + "\"; //$NON-NLS-1$"); //$NON-NLS-1$ + System.out.print(String.format(attributeDeclaration, name, name)); } + System.out.print("\n\t}"); //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java index 2f508690946..1da4f95790e 100644 --- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java +++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java @@ -434,21 +434,18 @@ public class PartRenderingEngine implements IPresentationEngine { // Hook up the widget life-cycle subscriber if (eventBroker != null) { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIEvents.UIElement.TOBERENDERED), toBeRenderedHandler); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIEvents.UIElement.VISIBLE), visibilityHandler); - eventBroker.subscribe(UIEvents.buildTopic( - UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.CHILDREN), childrenHandler); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.Window.TOPIC, - UIEvents.Window.WINDOWS), windowsHandler); - eventBroker.subscribe(UIEvents.buildTopic( - UIEvents.Perspective.TOPIC, UIEvents.Perspective.WINDOWS), + eventBroker.subscribe(UIEvents.UIElement.TOPIC_TOBERENDERED, + toBeRenderedHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_VISIBLE, + visibilityHandler); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_CHILDREN, + childrenHandler); + eventBroker + .subscribe(UIEvents.Window.TOPIC_WINDOWS, windowsHandler); + eventBroker.subscribe(UIEvents.Perspective.TOPIC_WINDOWS, windowsHandler); - eventBroker.subscribe(UIEvents.buildTopic( - UIEvents.TrimmedWindow.TOPIC, - UIEvents.TrimmedWindow.TRIMBARS), trimHandler); + eventBroker.subscribe(UIEvents.TrimmedWindow.TOPIC_TRIMBARS, + trimHandler); } } diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java index aa14f3be5b7..ee9564542a3 100644 --- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java +++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java @@ -181,8 +181,9 @@ public class BindingProcessingAddon { sequence = bindingService.createSequence(keySequence); if (cmd == null) { - System.err.println("Failed to find command for binding: " + binding); //$NON-NLS-1$ - } else if(sequence == null) { + System.err + .println("Failed to find command for binding: " + binding); //$NON-NLS-1$ + } else if (sequence == null) { System.err.println("Failed to map binding: " + binding); //$NON-NLS-1$ } else { try { @@ -374,19 +375,15 @@ public class BindingProcessingAddon { } } }; - broker.subscribe(UIEvents.buildTopic( - UIEvents.BindingTableContainer.TOPIC, - UIEvents.BindingTableContainer.BINDINGTABLES), additionHandler); - broker.subscribe(UIEvents.buildTopic(UIEvents.BindingTable.TOPIC, - UIEvents.BindingTable.BINDINGS), additionHandler); - broker.subscribe(UIEvents.buildTopic(UIEvents.KeyBinding.TOPIC, - UIEvents.KeyBinding.COMMAND), additionHandler); - broker.subscribe(UIEvents.buildTopic(UIEvents.KeyBinding.TOPIC, - UIEvents.KeyBinding.PARAMETERS), additionHandler); - broker.subscribe(UIEvents.buildTopic(UIEvents.KeySequence.TOPIC, - UIEvents.KeySequence.KEYSEQUENCE), additionHandler); - broker.subscribe(UIEvents.buildTopic(UIEvents.ApplicationElement.TOPIC, - UIEvents.ApplicationElement.TAGS), additionHandler); + broker.subscribe(UIEvents.BindingTableContainer.TOPIC_BINDINGTABLES, + additionHandler); + broker.subscribe(UIEvents.BindingTable.TOPIC_BINDINGS, additionHandler); + broker.subscribe(UIEvents.KeyBinding.TOPIC_COMMAND, additionHandler); + broker.subscribe(UIEvents.KeyBinding.TOPIC_PARAMETERS, additionHandler); + broker.subscribe(UIEvents.KeySequence.TOPIC_KEYSEQUENCE, + additionHandler); + broker.subscribe(UIEvents.ApplicationElement.TOPIC_TAGS, + additionHandler); contextHandler = new EventHandler() { public void handleEvent(Event event) { @@ -400,8 +397,7 @@ public class BindingProcessingAddon { } } }; - broker.subscribe(UIEvents.buildTopic(UIEvents.Context.TOPIC, - UIEvents.Context.CONTEXT), contextHandler); + broker.subscribe(UIEvents.Context.TOPIC_CONTEXT, contextHandler); } private void unregsiterModelListeners() { diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java index 0d73cb6afa2..919695cad06 100644 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java +++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java @@ -168,8 +168,7 @@ public class PartServiceImpl implements EPartService { @PostConstruct void postConstruct() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.SELECTEDELEMENT), selectedHandler); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, selectedHandler); constructed = true; partActivationHistory = new PartActivationHistory(this, modelService); if (activePart != null) { diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionServiceImpl.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionServiceImpl.java index cbe723d1ba3..8fc39349137 100644 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionServiceImpl.java +++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionServiceImpl.java @@ -92,9 +92,7 @@ public class SelectionServiceImpl implements ESelectionService { @PostConstruct void postConstruct() { - eventBroker - .subscribe(UIEvents.buildTopic(UIEvents.Context.TOPIC, UIEvents.Context.CONTEXT), - eventHandler); + eventBroker.subscribe(UIEvents.Context.TOPIC_CONTEXT, eventHandler); for (MPart part : partService.getParts()) { track(part); diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/CommandProcessingAddon.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/CommandProcessingAddon.java index a5458615d33..e7c9dac2742 100644 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/CommandProcessingAddon.java +++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/CommandProcessingAddon.java @@ -85,12 +85,8 @@ public class CommandProcessingAddon { } } }; - broker.subscribe( - UIEvents.buildTopic(UIEvents.Application.TOPIC, UIEvents.Application.COMMANDS), - additionHandler); - broker.subscribe( - UIEvents.buildTopic(UIEvents.Application.TOPIC, UIEvents.Application.CATEGORIES), - additionHandler); + broker.subscribe(UIEvents.Application.TOPIC_COMMANDS, additionHandler); + broker.subscribe(UIEvents.Application.TOPIC_CATEGORIES, additionHandler); } private void unregsiterModelListeners() { diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java index 7d31d8ac824..4d054300e2f 100644 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java +++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java @@ -95,8 +95,7 @@ public class ContextProcessingAddon { } } }; - broker.subscribe(UIEvents.buildTopic(UIEvents.BindingContext.TOPIC, - UIEvents.BindingContext.CHILDREN), additionHandler); + broker.subscribe(UIEvents.BindingContext.TOPIC_CHILDREN, additionHandler); } private void unregsiterModelListeners() { diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/UIEvents.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/UIEvents.java index 1a1ae482036..a3ea4e69601 100644 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/UIEvents.java +++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/UIEvents.java @@ -134,41 +134,6 @@ public class UIEvents { } /** - * Method for constructing a topic string to subscribe to. - * - * @param topic - * @return a topic that will match all model changes for the given topic. - */ - public static String buildTopic(String topic) { - return topic + TOPIC_SEP + ALL_SUB_TOPICS; - } - - /** - * Method for constructing a topic string to subscribe to. - * - * @param topic - * @param attributeName - * the UI model attribute to match - * @return a topic that will match a particular attribute for a particular model element - */ - public static String buildTopic(String topic, String attributeName) { - return topic + TOPIC_SEP + attributeName + TOPIC_SEP + ALL_SUB_TOPICS; - } - - /** - * Method for constructing a topic string to subscribe to. - * - * @param topic - * @param attributeName - * @param eventType - * @return a topic that will match a particular eventType for a particular attribute of a - * particular model element - */ - public static String buildTopic(String topic, String attributeName, String eventType) { - return topic + TOPIC_SEP + attributeName + TOPIC_SEP + eventType; - } - - /** * Publish the topic to the changedElements global event bus. The changedElement is added the * the EventTags.ELEMENT tag. * @@ -217,6 +182,33 @@ public class UIEvents { return eventBroker.send(topic, argMap); } + @SuppressWarnings("javadoc") + @Deprecated + /** + * @deprecated Subscribe to an all attribute events on a topic using the TOPIC_ALL constant directly + */ + public static String buildTopic(String topic) { + return topic + TOPIC_SEP + ALL_SUB_TOPICS; + } + + @SuppressWarnings("javadoc") + @Deprecated + /** + * @deprecated Subscribe to an attribute event by using the TOPIC_<attribute> constant directly + */ + public static String buildTopic(String topic, String attrName) { + return topic + TOPIC_SEP + attrName + TOPIC_SEP + ALL_SUB_TOPICS; + } + + @SuppressWarnings("javadoc") + @Deprecated + /** + * @deprecated Subscribing to a particular event type on a topic attribute is not longer supported + */ + public static String buildTopic(String topic, String attrName, String eventType) { + return topic + TOPIC_SEP + attrName + TOPIC_SEP + eventType; + } + /************************************************************************************* * GENERATED CODE!! * @@ -228,7 +220,18 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface BindingContext { - public static final String TOPIC = UIModelTopicBase + "/commands/BindingContext"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/BindingContext"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/BindingContext/*"; //$NON-NLS-1$ + public static final String TOPIC_CHILDREN = "org/eclipse/e4/ui/model/commands/BindingContext/children/*"; //$NON-NLS-1$ + public static final String TOPIC_DESCRIPTION = "org/eclipse/e4/ui/model/commands/BindingContext/description/*"; //$NON-NLS-1$ + public static final String TOPIC_NAME = "org/eclipse/e4/ui/model/commands/BindingContext/name/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CHILDREN = "children"; //$NON-NLS-1$ public static final String DESCRIPTION = "description"; //$NON-NLS-1$ public static final String NAME = "name"; //$NON-NLS-1$ @@ -236,34 +239,85 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface BindingTable { - public static final String TOPIC = UIModelTopicBase + "/commands/BindingTable"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/BindingTable"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/BindingTable/*"; //$NON-NLS-1$ + public static final String TOPIC_BINDINGCONTEXT = "org/eclipse/e4/ui/model/commands/BindingTable/bindingContext/*"; //$NON-NLS-1$ + public static final String TOPIC_BINDINGS = "org/eclipse/e4/ui/model/commands/BindingTable/bindings/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String BINDINGCONTEXT = "bindingContext"; //$NON-NLS-1$ public static final String BINDINGS = "bindings"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface BindingTableContainer { - public static final String TOPIC = UIModelTopicBase + "/commands/BindingTableContainer"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/BindingTableContainer"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/BindingTableContainer/*"; //$NON-NLS-1$ + public static final String TOPIC_BINDINGTABLES = "org/eclipse/e4/ui/model/commands/BindingTableContainer/bindingTables/*"; //$NON-NLS-1$ + public static final String TOPIC_ROOTCONTEXT = "org/eclipse/e4/ui/model/commands/BindingTableContainer/rootContext/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String BINDINGTABLES = "bindingTables"; //$NON-NLS-1$ public static final String ROOTCONTEXT = "rootContext"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Bindings { - public static final String TOPIC = UIModelTopicBase + "/commands/Bindings"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/Bindings"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/Bindings/*"; //$NON-NLS-1$ + public static final String TOPIC_BINDINGCONTEXTS = "org/eclipse/e4/ui/model/commands/Bindings/bindingContexts/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String BINDINGCONTEXTS = "bindingContexts"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Category { - public static final String TOPIC = UIModelTopicBase + "/commands/Category"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/Category"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/Category/*"; //$NON-NLS-1$ + public static final String TOPIC_DESCRIPTION = "org/eclipse/e4/ui/model/commands/Category/description/*"; //$NON-NLS-1$ + public static final String TOPIC_NAME = "org/eclipse/e4/ui/model/commands/Category/name/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String DESCRIPTION = "description"; //$NON-NLS-1$ public static final String NAME = "name"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Command { - public static final String TOPIC = UIModelTopicBase + "/commands/Command"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/Command"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/Command/*"; //$NON-NLS-1$ + public static final String TOPIC_CATEGORY = "org/eclipse/e4/ui/model/commands/Command/category/*"; //$NON-NLS-1$ + public static final String TOPIC_COMMANDNAME = "org/eclipse/e4/ui/model/commands/Command/commandName/*"; //$NON-NLS-1$ + public static final String TOPIC_DESCRIPTION = "org/eclipse/e4/ui/model/commands/Command/description/*"; //$NON-NLS-1$ + public static final String TOPIC_PARAMETERS = "org/eclipse/e4/ui/model/commands/Command/parameters/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CATEGORY = "category"; //$NON-NLS-1$ public static final String COMMANDNAME = "commandName"; //$NON-NLS-1$ public static final String DESCRIPTION = "description"; //$NON-NLS-1$ @@ -272,7 +326,18 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface CommandParameter { - public static final String TOPIC = UIModelTopicBase + "/commands/CommandParameter"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/CommandParameter"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/CommandParameter/*"; //$NON-NLS-1$ + public static final String TOPIC_NAME = "org/eclipse/e4/ui/model/commands/CommandParameter/name/*"; //$NON-NLS-1$ + public static final String TOPIC_OPTIONAL = "org/eclipse/e4/ui/model/commands/CommandParameter/optional/*"; //$NON-NLS-1$ + public static final String TOPIC_TYPEID = "org/eclipse/e4/ui/model/commands/CommandParameter/typeId/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String NAME = "name"; //$NON-NLS-1$ public static final String OPTIONAL = "optional"; //$NON-NLS-1$ public static final String TYPEID = "typeId"; //$NON-NLS-1$ @@ -280,39 +345,102 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface Handler { - public static final String TOPIC = UIModelTopicBase + "/commands/Handler"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/Handler"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/Handler/*"; //$NON-NLS-1$ + public static final String TOPIC_COMMAND = "org/eclipse/e4/ui/model/commands/Handler/command/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String COMMAND = "command"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface HandlerContainer { - public static final String TOPIC = UIModelTopicBase + "/commands/HandlerContainer"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/HandlerContainer"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/HandlerContainer/*"; //$NON-NLS-1$ + public static final String TOPIC_HANDLERS = "org/eclipse/e4/ui/model/commands/HandlerContainer/handlers/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String HANDLERS = "handlers"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface KeyBinding { - public static final String TOPIC = UIModelTopicBase + "/commands/KeyBinding"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/KeyBinding"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/KeyBinding/*"; //$NON-NLS-1$ + public static final String TOPIC_COMMAND = "org/eclipse/e4/ui/model/commands/KeyBinding/command/*"; //$NON-NLS-1$ + public static final String TOPIC_PARAMETERS = "org/eclipse/e4/ui/model/commands/KeyBinding/parameters/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String COMMAND = "command"; //$NON-NLS-1$ public static final String PARAMETERS = "parameters"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface KeySequence { - public static final String TOPIC = UIModelTopicBase + "/commands/KeySequence"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/KeySequence"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/KeySequence/*"; //$NON-NLS-1$ + public static final String TOPIC_KEYSEQUENCE = "org/eclipse/e4/ui/model/commands/KeySequence/keySequence/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String KEYSEQUENCE = "keySequence"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Parameter { - public static final String TOPIC = UIModelTopicBase + "/commands/Parameter"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/commands/Parameter"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/commands/Parameter/*"; //$NON-NLS-1$ + public static final String TOPIC_NAME = "org/eclipse/e4/ui/model/commands/Parameter/name/*"; //$NON-NLS-1$ + public static final String TOPIC_VALUE = "org/eclipse/e4/ui/model/commands/Parameter/value/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String NAME = "name"; //$NON-NLS-1$ public static final String VALUE = "value"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface PartDescriptor { - public static final String TOPIC = UIModelTopicBase + "/basic/PartDescriptor"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/basic/PartDescriptor"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/basic/PartDescriptor/*"; //$NON-NLS-1$ + public static final String TOPIC_ALLOWMULTIPLE = "org/eclipse/e4/ui/model/basic/PartDescriptor/allowMultiple/*"; //$NON-NLS-1$ + public static final String TOPIC_CATEGORY = "org/eclipse/e4/ui/model/basic/PartDescriptor/category/*"; //$NON-NLS-1$ + public static final String TOPIC_CLOSEABLE = "org/eclipse/e4/ui/model/basic/PartDescriptor/closeable/*"; //$NON-NLS-1$ + public static final String TOPIC_CONTRIBUTIONURI = "org/eclipse/e4/ui/model/basic/PartDescriptor/contributionURI/*"; //$NON-NLS-1$ + public static final String TOPIC_DESCRIPTION = "org/eclipse/e4/ui/model/basic/PartDescriptor/description/*"; //$NON-NLS-1$ + public static final String TOPIC_DIRTYABLE = "org/eclipse/e4/ui/model/basic/PartDescriptor/dirtyable/*"; //$NON-NLS-1$ + public static final String TOPIC_MENUS = "org/eclipse/e4/ui/model/basic/PartDescriptor/menus/*"; //$NON-NLS-1$ + public static final String TOPIC_TOOLBAR = "org/eclipse/e4/ui/model/basic/PartDescriptor/toolbar/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String ALLOWMULTIPLE = "allowMultiple"; //$NON-NLS-1$ public static final String CATEGORY = "category"; //$NON-NLS-1$ public static final String CLOSEABLE = "closeable"; //$NON-NLS-1$ @@ -325,13 +453,33 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface PartDescriptorContainer { - public static final String TOPIC = UIModelTopicBase + "/basic/PartDescriptorContainer"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/basic/PartDescriptorContainer"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/basic/PartDescriptorContainer/*"; //$NON-NLS-1$ + public static final String TOPIC_DESCRIPTORS = "org/eclipse/e4/ui/model/basic/PartDescriptorContainer/descriptors/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String DESCRIPTORS = "descriptors"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Application { - public static final String TOPIC = UIModelTopicBase + "/application/Application"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/application/Application"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/application/Application/*"; //$NON-NLS-1$ + public static final String TOPIC_ADDONS = "org/eclipse/e4/ui/model/application/Application/addons/*"; //$NON-NLS-1$ + public static final String TOPIC_CATEGORIES = "org/eclipse/e4/ui/model/application/Application/categories/*"; //$NON-NLS-1$ + public static final String TOPIC_COMMANDS = "org/eclipse/e4/ui/model/application/Application/commands/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String ADDONS = "addons"; //$NON-NLS-1$ public static final String CATEGORIES = "categories"; //$NON-NLS-1$ public static final String COMMANDS = "commands"; //$NON-NLS-1$ @@ -339,7 +487,19 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface ApplicationElement { - public static final String TOPIC = UIModelTopicBase + "/application/ApplicationElement"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/application/ApplicationElement"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/application/ApplicationElement/*"; //$NON-NLS-1$ + public static final String TOPIC_CONTRIBUTORURI = "org/eclipse/e4/ui/model/application/ApplicationElement/contributorURI/*"; //$NON-NLS-1$ + public static final String TOPIC_ELEMENTID = "org/eclipse/e4/ui/model/application/ApplicationElement/elementId/*"; //$NON-NLS-1$ + public static final String TOPIC_TAGS = "org/eclipse/e4/ui/model/application/ApplicationElement/tags/*"; //$NON-NLS-1$ + public static final String TOPIC_TRANSIENTDATA = "org/eclipse/e4/ui/model/application/ApplicationElement/transientData/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CONTRIBUTORURI = "contributorURI"; //$NON-NLS-1$ public static final String ELEMENTID = "elementId"; //$NON-NLS-1$ public static final String TAGS = "tags"; //$NON-NLS-1$ @@ -348,7 +508,18 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface Contribution { - public static final String TOPIC = UIModelTopicBase + "/application/Contribution"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/application/Contribution"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/application/Contribution/*"; //$NON-NLS-1$ + public static final String TOPIC_CONTRIBUTIONURI = "org/eclipse/e4/ui/model/application/Contribution/contributionURI/*"; //$NON-NLS-1$ + public static final String TOPIC_OBJECT = "org/eclipse/e4/ui/model/application/Contribution/object/*"; //$NON-NLS-1$ + public static final String TOPIC_PERSISTEDSTATE = "org/eclipse/e4/ui/model/application/Contribution/persistedState/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CONTRIBUTIONURI = "contributionURI"; //$NON-NLS-1$ public static final String OBJECT = "object"; //$NON-NLS-1$ public static final String PERSISTEDSTATE = "persistedState"; //$NON-NLS-1$ @@ -356,34 +527,85 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface StringToObjectMap { - public static final String TOPIC = UIModelTopicBase + "/application/StringToObjectMap"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/application/StringToObjectMap"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/application/StringToObjectMap/*"; //$NON-NLS-1$ + public static final String TOPIC_KEY = "org/eclipse/e4/ui/model/application/StringToObjectMap/key/*"; //$NON-NLS-1$ + public static final String TOPIC_VALUE = "org/eclipse/e4/ui/model/application/StringToObjectMap/value/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String KEY = "key"; //$NON-NLS-1$ public static final String VALUE = "value"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface StringToStringMap { - public static final String TOPIC = UIModelTopicBase + "/application/StringToStringMap"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/application/StringToStringMap"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/application/StringToStringMap/*"; //$NON-NLS-1$ + public static final String TOPIC_KEY = "org/eclipse/e4/ui/model/application/StringToStringMap/key/*"; //$NON-NLS-1$ + public static final String TOPIC_VALUE = "org/eclipse/e4/ui/model/application/StringToStringMap/value/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String KEY = "key"; //$NON-NLS-1$ public static final String VALUE = "value"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Perspective { - public static final String TOPIC = UIModelTopicBase + "/advanced/Perspective"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/advanced/Perspective"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/advanced/Perspective/*"; //$NON-NLS-1$ + public static final String TOPIC_WINDOWS = "org/eclipse/e4/ui/model/advanced/Perspective/windows/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String WINDOWS = "windows"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Placeholder { - public static final String TOPIC = UIModelTopicBase + "/advanced/Placeholder"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/advanced/Placeholder"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/advanced/Placeholder/*"; //$NON-NLS-1$ + public static final String TOPIC_CLOSEABLE = "org/eclipse/e4/ui/model/advanced/Placeholder/closeable/*"; //$NON-NLS-1$ + public static final String TOPIC_REF = "org/eclipse/e4/ui/model/advanced/Placeholder/ref/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CLOSEABLE = "closeable"; //$NON-NLS-1$ public static final String REF = "ref"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Part { - public static final String TOPIC = UIModelTopicBase + "/basic/Part"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/basic/Part"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/basic/Part/*"; //$NON-NLS-1$ + public static final String TOPIC_CLOSEABLE = "org/eclipse/e4/ui/model/basic/Part/closeable/*"; //$NON-NLS-1$ + public static final String TOPIC_DESCRIPTION = "org/eclipse/e4/ui/model/basic/Part/description/*"; //$NON-NLS-1$ + public static final String TOPIC_MENUS = "org/eclipse/e4/ui/model/basic/Part/menus/*"; //$NON-NLS-1$ + public static final String TOPIC_TOOLBAR = "org/eclipse/e4/ui/model/basic/Part/toolbar/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CLOSEABLE = "closeable"; //$NON-NLS-1$ public static final String DESCRIPTION = "description"; //$NON-NLS-1$ public static final String MENUS = "menus"; //$NON-NLS-1$ @@ -392,13 +614,37 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface TrimmedWindow { - public static final String TOPIC = UIModelTopicBase + "/basic/TrimmedWindow"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/basic/TrimmedWindow"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/basic/TrimmedWindow/*"; //$NON-NLS-1$ + public static final String TOPIC_TRIMBARS = "org/eclipse/e4/ui/model/basic/TrimmedWindow/trimBars/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String TRIMBARS = "trimBars"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Window { - public static final String TOPIC = UIModelTopicBase + "/basic/Window"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/basic/Window"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/basic/Window/*"; //$NON-NLS-1$ + public static final String TOPIC_HEIGHT = "org/eclipse/e4/ui/model/basic/Window/height/*"; //$NON-NLS-1$ + public static final String TOPIC_MAINMENU = "org/eclipse/e4/ui/model/basic/Window/mainMenu/*"; //$NON-NLS-1$ + public static final String TOPIC_SHAREDELEMENTS = "org/eclipse/e4/ui/model/basic/Window/sharedElements/*"; //$NON-NLS-1$ + public static final String TOPIC_WIDTH = "org/eclipse/e4/ui/model/basic/Window/width/*"; //$NON-NLS-1$ + public static final String TOPIC_WINDOWS = "org/eclipse/e4/ui/model/basic/Window/windows/*"; //$NON-NLS-1$ + public static final String TOPIC_X = "org/eclipse/e4/ui/model/basic/Window/x/*"; //$NON-NLS-1$ + public static final String TOPIC_Y = "org/eclipse/e4/ui/model/basic/Window/y/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String HEIGHT = "height"; //$NON-NLS-1$ public static final String MAINMENU = "mainMenu"; //$NON-NLS-1$ public static final String SHAREDELEMENTS = "sharedElements"; //$NON-NLS-1$ @@ -410,7 +656,18 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface Context { - public static final String TOPIC = UIModelTopicBase + "/ui/Context"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/Context"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/Context/*"; //$NON-NLS-1$ + public static final String TOPIC_CONTEXT = "org/eclipse/e4/ui/model/ui/Context/context/*"; //$NON-NLS-1$ + public static final String TOPIC_PROPERTIES = "org/eclipse/e4/ui/model/ui/Context/properties/*"; //$NON-NLS-1$ + public static final String TOPIC_VARIABLES = "org/eclipse/e4/ui/model/ui/Context/variables/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CONTEXT = "context"; //$NON-NLS-1$ public static final String PROPERTIES = "properties"; //$NON-NLS-1$ public static final String VARIABLES = "variables"; //$NON-NLS-1$ @@ -418,51 +675,134 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface CoreExpression { - public static final String TOPIC = UIModelTopicBase + "/ui/CoreExpression"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/CoreExpression"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/CoreExpression/*"; //$NON-NLS-1$ + public static final String TOPIC_COREEXPRESSION = "org/eclipse/e4/ui/model/ui/CoreExpression/coreExpression/*"; //$NON-NLS-1$ + public static final String TOPIC_COREEXPRESSIONID = "org/eclipse/e4/ui/model/ui/CoreExpression/coreExpressionId/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String COREEXPRESSION = "coreExpression"; //$NON-NLS-1$ public static final String COREEXPRESSIONID = "coreExpressionId"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Dirtyable { - public static final String TOPIC = UIModelTopicBase + "/ui/Dirtyable"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/Dirtyable"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/Dirtyable/*"; //$NON-NLS-1$ + public static final String TOPIC_DIRTY = "org/eclipse/e4/ui/model/ui/Dirtyable/dirty/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String DIRTY = "dirty"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface ElementContainer { - public static final String TOPIC = UIModelTopicBase + "/ui/ElementContainer"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/ElementContainer"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/ElementContainer/*"; //$NON-NLS-1$ + public static final String TOPIC_CHILDREN = "org/eclipse/e4/ui/model/ui/ElementContainer/children/*"; //$NON-NLS-1$ + public static final String TOPIC_SELECTEDELEMENT = "org/eclipse/e4/ui/model/ui/ElementContainer/selectedElement/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CHILDREN = "children"; //$NON-NLS-1$ public static final String SELECTEDELEMENT = "selectedElement"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface GenericTile { - public static final String TOPIC = UIModelTopicBase + "/ui/GenericTile"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/GenericTile"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/GenericTile/*"; //$NON-NLS-1$ + public static final String TOPIC_HORIZONTAL = "org/eclipse/e4/ui/model/ui/GenericTile/horizontal/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String HORIZONTAL = "horizontal"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface GenericTrimContainer { - public static final String TOPIC = UIModelTopicBase + "/ui/GenericTrimContainer"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/GenericTrimContainer"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/GenericTrimContainer/*"; //$NON-NLS-1$ + public static final String TOPIC_SIDE = "org/eclipse/e4/ui/model/ui/GenericTrimContainer/side/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String SIDE = "side"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface Input { - public static final String TOPIC = UIModelTopicBase + "/ui/Input"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/Input"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/Input/*"; //$NON-NLS-1$ + public static final String TOPIC_INPUTURI = "org/eclipse/e4/ui/model/ui/Input/inputURI/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String INPUTURI = "inputURI"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface SnippetContainer { - public static final String TOPIC = UIModelTopicBase + "/ui/SnippetContainer"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/SnippetContainer"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/SnippetContainer/*"; //$NON-NLS-1$ + public static final String TOPIC_SNIPPETS = "org/eclipse/e4/ui/model/ui/SnippetContainer/snippets/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String SNIPPETS = "snippets"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface UIElement { - public static final String TOPIC = UIModelTopicBase + "/ui/UIElement"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/UIElement"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/UIElement/*"; //$NON-NLS-1$ + public static final String TOPIC_ACCESSIBILITYPHRASE = "org/eclipse/e4/ui/model/ui/UIElement/accessibilityPhrase/*"; //$NON-NLS-1$ + public static final String TOPIC_CONTAINERDATA = "org/eclipse/e4/ui/model/ui/UIElement/containerData/*"; //$NON-NLS-1$ + public static final String TOPIC_CURSHAREDREF = "org/eclipse/e4/ui/model/ui/UIElement/curSharedRef/*"; //$NON-NLS-1$ + public static final String TOPIC_ONTOP = "org/eclipse/e4/ui/model/ui/UIElement/onTop/*"; //$NON-NLS-1$ + public static final String TOPIC_PARENT = "org/eclipse/e4/ui/model/ui/UIElement/parent/*"; //$NON-NLS-1$ + public static final String TOPIC_RENDERER = "org/eclipse/e4/ui/model/ui/UIElement/renderer/*"; //$NON-NLS-1$ + public static final String TOPIC_TOBERENDERED = "org/eclipse/e4/ui/model/ui/UIElement/toBeRendered/*"; //$NON-NLS-1$ + public static final String TOPIC_VISIBLE = "org/eclipse/e4/ui/model/ui/UIElement/visible/*"; //$NON-NLS-1$ + public static final String TOPIC_VISIBLEWHEN = "org/eclipse/e4/ui/model/ui/UIElement/visibleWhen/*"; //$NON-NLS-1$ + public static final String TOPIC_WIDGET = "org/eclipse/e4/ui/model/ui/UIElement/widget/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String ACCESSIBILITYPHRASE = "accessibilityPhrase"; //$NON-NLS-1$ public static final String CONTAINERDATA = "containerData"; //$NON-NLS-1$ public static final String CURSHAREDREF = "curSharedRef"; //$NON-NLS-1$ @@ -477,7 +817,18 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface UILabel { - public static final String TOPIC = UIModelTopicBase + "/ui/UILabel"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/ui/UILabel"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/ui/UILabel/*"; //$NON-NLS-1$ + public static final String TOPIC_ICONURI = "org/eclipse/e4/ui/model/ui/UILabel/iconURI/*"; //$NON-NLS-1$ + public static final String TOPIC_LABEL = "org/eclipse/e4/ui/model/ui/UILabel/label/*"; //$NON-NLS-1$ + public static final String TOPIC_TOOLTIP = "org/eclipse/e4/ui/model/ui/UILabel/tooltip/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String ICONURI = "iconURI"; //$NON-NLS-1$ public static final String LABEL = "label"; //$NON-NLS-1$ public static final String TOOLTIP = "tooltip"; //$NON-NLS-1$ @@ -485,7 +836,18 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface HandledItem { - public static final String TOPIC = UIModelTopicBase + "/menu/HandledItem"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/HandledItem"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/HandledItem/*"; //$NON-NLS-1$ + public static final String TOPIC_COMMAND = "org/eclipse/e4/ui/model/menu/HandledItem/command/*"; //$NON-NLS-1$ + public static final String TOPIC_PARAMETERS = "org/eclipse/e4/ui/model/menu/HandledItem/parameters/*"; //$NON-NLS-1$ + public static final String TOPIC_WBCOMMAND = "org/eclipse/e4/ui/model/menu/HandledItem/wbCommand/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String COMMAND = "command"; //$NON-NLS-1$ public static final String PARAMETERS = "parameters"; //$NON-NLS-1$ public static final String WBCOMMAND = "wbCommand"; //$NON-NLS-1$ @@ -493,7 +855,18 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface Item { - public static final String TOPIC = UIModelTopicBase + "/menu/Item"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/Item"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/Item/*"; //$NON-NLS-1$ + public static final String TOPIC_ENABLED = "org/eclipse/e4/ui/model/menu/Item/enabled/*"; //$NON-NLS-1$ + public static final String TOPIC_SELECTED = "org/eclipse/e4/ui/model/menu/Item/selected/*"; //$NON-NLS-1$ + public static final String TOPIC_TYPE = "org/eclipse/e4/ui/model/menu/Item/type/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String ENABLED = "enabled"; //$NON-NLS-1$ public static final String SELECTED = "selected"; //$NON-NLS-1$ public static final String TYPE = "type"; //$NON-NLS-1$ @@ -501,94 +874,232 @@ public class UIEvents { @SuppressWarnings("javadoc") public static interface Menu { - public static final String TOPIC = UIModelTopicBase + "/menu/Menu"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/Menu"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/Menu/*"; //$NON-NLS-1$ + public static final String TOPIC_ENABLED = "org/eclipse/e4/ui/model/menu/Menu/enabled/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String ENABLED = "enabled"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface MenuContribution { - public static final String TOPIC = UIModelTopicBase + "/menu/MenuContribution"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/MenuContribution"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/MenuContribution/*"; //$NON-NLS-1$ + public static final String TOPIC_PARENTID = "org/eclipse/e4/ui/model/menu/MenuContribution/parentId/*"; //$NON-NLS-1$ + public static final String TOPIC_POSITIONINPARENT = "org/eclipse/e4/ui/model/menu/MenuContribution/positionInParent/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String PARENTID = "parentId"; //$NON-NLS-1$ public static final String POSITIONINPARENT = "positionInParent"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface MenuContributions { - public static final String TOPIC = UIModelTopicBase + "/menu/MenuContributions"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/MenuContributions"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/MenuContributions/*"; //$NON-NLS-1$ + public static final String TOPIC_MENUCONTRIBUTIONS = "org/eclipse/e4/ui/model/menu/MenuContributions/menuContributions/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String MENUCONTRIBUTIONS = "menuContributions"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface MenuElement { - public static final String TOPIC = UIModelTopicBase + "/menu/MenuElement"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/MenuElement"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/MenuElement/*"; //$NON-NLS-1$ + public static final String TOPIC_MNEMONICS = "org/eclipse/e4/ui/model/menu/MenuElement/mnemonics/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String MNEMONICS = "mnemonics"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface OpaqueMenuItem { - public static final String TOPIC = UIModelTopicBase + "/menu/OpaqueMenuItem"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/OpaqueMenuItem"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/OpaqueMenuItem/*"; //$NON-NLS-1$ + public static final String TOPIC_OPAQUEITEM = "org/eclipse/e4/ui/model/menu/OpaqueMenuItem/opaqueItem/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String OPAQUEITEM = "opaqueItem"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface OpaqueMenuSeparator { - public static final String TOPIC = UIModelTopicBase + "/menu/OpaqueMenuSeparator"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/OpaqueMenuSeparator"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/OpaqueMenuSeparator/*"; //$NON-NLS-1$ + public static final String TOPIC_OPAQUEITEM = "org/eclipse/e4/ui/model/menu/OpaqueMenuSeparator/opaqueItem/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String OPAQUEITEM = "opaqueItem"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface OpaqueToolItem { - public static final String TOPIC = UIModelTopicBase + "/menu/OpaqueToolItem"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/OpaqueToolItem"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/OpaqueToolItem/*"; //$NON-NLS-1$ + public static final String TOPIC_OPAQUEITEM = "org/eclipse/e4/ui/model/menu/OpaqueToolItem/opaqueItem/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String OPAQUEITEM = "opaqueItem"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface RenderedMenu { - public static final String TOPIC = UIModelTopicBase + "/menu/RenderedMenu"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/RenderedMenu"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/RenderedMenu/*"; //$NON-NLS-1$ + public static final String TOPIC_CONTRIBUTIONMANAGER = "org/eclipse/e4/ui/model/menu/RenderedMenu/contributionManager/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CONTRIBUTIONMANAGER = "contributionManager"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface RenderedMenuItem { - public static final String TOPIC = UIModelTopicBase + "/menu/RenderedMenuItem"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/RenderedMenuItem"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/RenderedMenuItem/*"; //$NON-NLS-1$ + public static final String TOPIC_CONTRIBUTIONITEM = "org/eclipse/e4/ui/model/menu/RenderedMenuItem/contributionItem/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CONTRIBUTIONITEM = "contributionItem"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface RenderedToolBar { - public static final String TOPIC = UIModelTopicBase + "/menu/RenderedToolBar"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/RenderedToolBar"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/RenderedToolBar/*"; //$NON-NLS-1$ + public static final String TOPIC_CONTRIBUTIONMANAGER = "org/eclipse/e4/ui/model/menu/RenderedToolBar/contributionManager/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String CONTRIBUTIONMANAGER = "contributionManager"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface ToolBarContribution { - public static final String TOPIC = UIModelTopicBase + "/menu/ToolBarContribution"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/ToolBarContribution"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/ToolBarContribution/*"; //$NON-NLS-1$ + public static final String TOPIC_PARENTID = "org/eclipse/e4/ui/model/menu/ToolBarContribution/parentId/*"; //$NON-NLS-1$ + public static final String TOPIC_POSITIONINPARENT = "org/eclipse/e4/ui/model/menu/ToolBarContribution/positionInParent/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String PARENTID = "parentId"; //$NON-NLS-1$ public static final String POSITIONINPARENT = "positionInParent"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface ToolBarContributions { - public static final String TOPIC = UIModelTopicBase + "/menu/ToolBarContributions"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/ToolBarContributions"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/ToolBarContributions/*"; //$NON-NLS-1$ + public static final String TOPIC_TOOLBARCONTRIBUTIONS = "org/eclipse/e4/ui/model/menu/ToolBarContributions/toolBarContributions/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String TOOLBARCONTRIBUTIONS = "toolBarContributions"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface ToolItem { - public static final String TOPIC = UIModelTopicBase + "/menu/ToolItem"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/ToolItem"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/ToolItem/*"; //$NON-NLS-1$ + public static final String TOPIC_MENU = "org/eclipse/e4/ui/model/menu/ToolItem/menu/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String MENU = "menu"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface TrimContribution { - public static final String TOPIC = UIModelTopicBase + "/menu/TrimContribution"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/TrimContribution"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/TrimContribution/*"; //$NON-NLS-1$ + public static final String TOPIC_PARENTID = "org/eclipse/e4/ui/model/menu/TrimContribution/parentId/*"; //$NON-NLS-1$ + public static final String TOPIC_POSITIONINPARENT = "org/eclipse/e4/ui/model/menu/TrimContribution/positionInParent/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String PARENTID = "parentId"; //$NON-NLS-1$ public static final String POSITIONINPARENT = "positionInParent"; //$NON-NLS-1$ } @SuppressWarnings("javadoc") public static interface TrimContributions { - public static final String TOPIC = UIModelTopicBase + "/menu/TrimContributions"; //$NON-NLS-1$ + + // Topics that can be subscribed to + + @Deprecated + public static final String ALL = "org/eclipse/e4/ui/model/menu/TrimContributions"; //$NON-NLS-1$ + + public static final String TOPIC_ALL = "org/eclipse/e4/ui/model/menu/TrimContributions/*"; //$NON-NLS-1$ + public static final String TOPIC_TRIMCONTRIBUTIONS = "org/eclipse/e4/ui/model/menu/TrimContributions/trimContributions/*"; //$NON-NLS-1$ + + // Attributes that can be tested in event handlers public static final String TRIMCONTRIBUTIONS = "trimContributions"; //$NON-NLS-1$ } }
\ No newline at end of file diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java index c3ef88faeac..f6cb501eb5b 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java @@ -256,14 +256,12 @@ public class PerspectiveSwitcher { @PostConstruct void init() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.CHILDREN), childrenHandler); eventBroker.subscribe( - UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.TOBERENDERED), +UIEvents.ElementContainer.TOPIC_CHILDREN, childrenHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_TOBERENDERED, toBeRenderedHandler); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.SELECTEDELEMENT), selectionHandler); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC), + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, selectionHandler); + eventBroker.subscribe(UIEvents.UILabel.TOPIC_ALL, labelHandler); } diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java index c53689ff6be..ea535ebbb32 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java @@ -90,9 +90,7 @@ public final class ViewIntroAdapterPart extends ViewPart { return; eventBroker = introModelPart.getContext().get(IEventBroker.class); - String topic = UIEvents.buildTopic(UIEvents.ApplicationElement.TOPIC, - UIEvents.ApplicationElement.TAGS); - eventBroker.subscribe(topic, zoomChangeListener); + eventBroker.subscribe(UIEvents.ApplicationElement.TOPIC_TAGS, zoomChangeListener); } private MPartStack getIntroStack() { diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java index b2084a8847b..1a7c2cc3b93 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java @@ -1579,8 +1579,7 @@ public final class Workbench extends EventManager implements IWorkbench { } private final void initializeE4Services() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.CHILDREN), new EventHandler() { + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_CHILDREN, new EventHandler() { public void handleEvent(org.osgi.service.event.Event event) { if (application == event.getProperty(UIEvents.EventTags.ELEMENT)) { if (UIEvents.EventTypes.REMOVE.equals(event @@ -1598,8 +1597,7 @@ public final class Workbench extends EventManager implements IWorkbench { } } }); - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.SELECTEDELEMENT), new EventHandler() { + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, new EventHandler() { public void handleEvent(org.osgi.service.event.Event event) { if (application == event.getProperty(UIEvents.EventTags.ELEMENT)) { if (UIEvents.EventTypes.SET.equals(event @@ -1622,8 +1620,8 @@ public final class Workbench extends EventManager implements IWorkbench { // watch for parts' "toBeRendered" attribute being flipped to true, if // they need to be rendered, then they need a corresponding 3.x // reference - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIEvents.UIElement.TOBERENDERED), new EventHandler() { + eventBroker.subscribe( +UIEvents.UIElement.TOPIC_TOBERENDERED, new EventHandler() { public void handleEvent(org.osgi.service.event.Event event) { if (Boolean.TRUE.equals(event.getProperty(UIEvents.EventTags.NEW_VALUE))) { Object element = event.getProperty(UIEvents.EventTags.ELEMENT); @@ -1638,7 +1636,7 @@ public final class Workbench extends EventManager implements IWorkbench { // watch for parts' contexts being set, once they've been set, we need // to inject the ViewReference/EditorReference into the context eventBroker.subscribe( - UIEvents.buildTopic(UIEvents.Context.TOPIC, UIEvents.Context.CONTEXT), +UIEvents.Context.TOPIC_CONTEXT, new EventHandler() { public void handleEvent(org.osgi.service.event.Event event) { Object element = event.getProperty(UIEvents.EventTags.ELEMENT); diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java index 6c6726d75ed..2bd02708bda 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java @@ -2341,13 +2341,12 @@ public class WorkbenchPage extends CompatibleWorkbenchPage implements } } - broker.subscribe(UIEvents.buildTopic(UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.SELECTEDELEMENT), selectionHandler); + broker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, selectionHandler); broker.subscribe(UIEvents.UILifeCycle.BRINGTOTOP, bringToTopHandler); - broker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.WIDGET), + broker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, areaWidgetHandler); broker.subscribe( - UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.TOBERENDERED), +UIEvents.UIElement.TOPIC_TOBERENDERED, referenceRemovalEventHandler); MPerspectiveStack perspectiveStack = getPerspectiveStack(); diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java index ebafa0bfd19..9b37cead418 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java @@ -207,7 +207,7 @@ public abstract class WorkbenchPartReference implements IWorkbenchPartReference, public void subscribe() { IEventBroker broker = windowContext.get(IEventBroker.class); - broker.subscribe(UIEvents.buildTopic(UIEvents.Context.TOPIC, UIEvents.Context.CONTEXT), + broker.subscribe(UIEvents.Context.TOPIC_CONTEXT, createContextEventHandler()); } diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java index 07d7d58316a..75b3c492596 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java @@ -590,9 +590,7 @@ public class WorkbenchWindow implements IWorkbenchWindow { // HandledContributionItem.toolItemUpdater.addWindowRunnable(menuUpdater); } - eventBroker.subscribe( - UIEvents.buildTopic(UIEvents.UIElement.TOPIC, UIEvents.UIElement.WIDGET), - windowWidgetHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, windowWidgetHandler); partService.setPage(page); diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java index 33a181d3c47..33a14f2724a 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java @@ -214,11 +214,8 @@ public abstract class CompatibilityPart { @PostConstruct public void create() { - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIEvents.UIElement.WIDGET), widgetSetHandler); - eventBroker.subscribe( - UIEvents.buildTopic(UIEvents.Contribution.TOPIC, UIEvents.Contribution.OBJECT), - objectSetHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, widgetSetHandler); + eventBroker.subscribe(UIEvents.Contribution.TOPIC_OBJECT, objectSetHandler); WorkbenchPartReference reference = getReference(); diff --git a/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/HeadlessContextPresentationEngine.java b/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/HeadlessContextPresentationEngine.java index 75664c0c25a..ec30d565ec1 100644 --- a/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/HeadlessContextPresentationEngine.java +++ b/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/HeadlessContextPresentationEngine.java @@ -117,9 +117,8 @@ public class HeadlessContextPresentationEngine implements IPresentationEngine { } }; - eventBroker.subscribe(UIEvents.buildTopic( - UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.CHILDREN), childHandler); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_CHILDREN, + childHandler); activeChildHandler = new EventHandler() { public void handleEvent(Event event) { @@ -142,9 +141,8 @@ public class HeadlessContextPresentationEngine implements IPresentationEngine { } }; - eventBroker.subscribe(UIEvents.buildTopic( - UIEvents.ElementContainer.TOPIC, - UIEvents.ElementContainer.SELECTEDELEMENT), activeChildHandler); + eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, + activeChildHandler); toBeRenderedHandler = new EventHandler() { public void handleEvent(Event event) { @@ -161,8 +159,8 @@ public class HeadlessContextPresentationEngine implements IPresentationEngine { } }; - eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC, - UIEvents.UIElement.TOBERENDERED), toBeRenderedHandler); + eventBroker.subscribe(UIEvents.UIElement.TOPIC_TOBERENDERED, + toBeRenderedHandler); } private void adjustPlaceholders(MUIElement element) { diff --git a/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/UIEventsTest.java b/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/UIEventsTest.java index e4700add3fa..b43a011f89e 100644 --- a/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/UIEventsTest.java +++ b/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/UIEventsTest.java @@ -26,7 +26,6 @@ import org.eclipse.e4.ui.model.application.ui.menu.MMenu; import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory; import org.eclipse.e4.ui.tests.model.test.MTestFactory; import org.eclipse.e4.ui.tests.model.test.MTestHarness; -import org.eclipse.e4.ui.workbench.UIEvents; import org.eclipse.e4.ui.workbench.UIEvents.ApplicationElement; import org.eclipse.e4.ui.workbench.UIEvents.Command; import org.eclipse.e4.ui.workbench.UIEvents.Context; @@ -67,7 +66,7 @@ public class UIEventsTest extends HeadlessApplicationElementTest { public EventTester(String name, String topic, String[] attIds, IEventBroker eventBroker) { this.testerName = name; - this.topic = UIEvents.buildTopic(topic); + this.topic = topic; this.attIds = attIds; this.eventBroker = eventBroker; @@ -118,7 +117,7 @@ public class UIEventsTest extends HeadlessApplicationElementTest { public class AppElementTester extends EventTester { AppElementTester(IEventBroker eventBroker) { - super("AppElement", ApplicationElement.TOPIC, new String[] { + super("AppElement", ApplicationElement.TOPIC_ALL, new String[] { ApplicationElement.ELEMENTID, ApplicationElement.TAGS }, eventBroker); } @@ -126,21 +125,21 @@ public class UIEventsTest extends HeadlessApplicationElementTest { public class CommandTester extends EventTester { CommandTester(IEventBroker eventBroker) { - super("Command", Command.TOPIC, + super("Command", Command.TOPIC_ALL, new String[] { Command.COMMANDNAME }, eventBroker); } } public class ContextTester extends EventTester { ContextTester(IEventBroker eventBroker) { - super("Context", Context.TOPIC, new String[] { Context.CONTEXT, + super("Context", Context.TOPIC_ALL, new String[] { Context.CONTEXT, Context.VARIABLES }, eventBroker); } } public class ContributionTester extends EventTester { ContributionTester(IEventBroker eventBroker) { - super("Contribution", Contribution.TOPIC, new String[] { + super("Contribution", Contribution.TOPIC_ALL, new String[] { Contribution.CONTRIBUTIONURI, Contribution.PERSISTEDSTATE, Contribution.OBJECT }, eventBroker); } @@ -148,7 +147,7 @@ public class UIEventsTest extends HeadlessApplicationElementTest { public class ElementContainerTester extends EventTester { ElementContainerTester(IEventBroker eventBroker) { - super("ElementContainer", ElementContainer.TOPIC, + super("ElementContainer", ElementContainer.TOPIC_ALL, new String[] { ElementContainer.CHILDREN, ElementContainer.SELECTEDELEMENT }, eventBroker); } @@ -156,28 +155,28 @@ public class UIEventsTest extends HeadlessApplicationElementTest { public class DirtyableTester extends EventTester { DirtyableTester(IEventBroker eventBroker) { - super("Dirtyable", Dirtyable.TOPIC, + super("Dirtyable", Dirtyable.TOPIC_ALL, new String[] { Dirtyable.DIRTY }, eventBroker); } } public class InputTester extends EventTester { InputTester(IEventBroker eventBroker) { - super("Input", Input.TOPIC, new String[] { Input.INPUTURI }, + super("Input", Input.TOPIC_ALL, new String[] { Input.INPUTURI }, eventBroker); } } public class ParameterTester extends EventTester { ParameterTester(IEventBroker eventBroker) { - super("Parameter", Parameter.TOPIC, new String[] { Parameter.NAME, - Parameter.VALUE }, eventBroker); + super("Parameter", Parameter.TOPIC_ALL, new String[] { + Parameter.NAME, Parameter.VALUE }, eventBroker); } } public class UIElementTester extends EventTester { UIElementTester(IEventBroker eventBroker) { - super("UIElement", UIElement.TOPIC, new String[] { + super("UIElement", UIElement.TOPIC_ALL, new String[] { UIElement.RENDERER, UIElement.TOBERENDERED, UIElement.PARENT, UIElement.ONTOP, UIElement.VISIBLE, UIElement.CONTAINERDATA, UIElement.WIDGET }, eventBroker); @@ -186,14 +185,14 @@ public class UIEventsTest extends HeadlessApplicationElementTest { public class UIItemTester extends EventTester { UIItemTester(IEventBroker eventBroker) { - super("UIItem", UILabel.TOPIC, new String[] { UILabel.LABEL, + super("UIItem", UILabel.TOPIC_ALL, new String[] { UILabel.LABEL, UILabel.ICONURI, UILabel.TOOLTIP }, eventBroker); } } public class WindowTester extends EventTester { WindowTester(IEventBroker eventBroker) { - super("Window", Window.TOPIC, new String[] { Window.MAINMENU, + super("Window", Window.TOPIC_ALL, new String[] { Window.MAINMENU, Window.X, Window.Y, Window.WIDTH, Window.HEIGHT }, eventBroker); } |
