Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Knauer2017-05-15 19:40:09 +0000
committerMarkus Knauer2017-05-15 21:45:28 +0000
commit7b90c930f90ebbe9e038d5fa13c13f9ebfbd1cf5 (patch)
treec4084a0ccb5be9ebed35fd3d6ab31de3b39a03bd
parent93c10cc438a9d9940d217f6c83a47fcdf3a8ee98 (diff)
downloadorg.eclipse.rap-7b90c930f90ebbe9e038d5fa13c13f9ebfbd1cf5.tar.gz
org.eclipse.rap-7b90c930f90ebbe9e038d5fa13c13f9ebfbd1cf5.tar.xz
org.eclipse.rap-7b90c930f90ebbe9e038d5fa13c13f9ebfbd1cf5.zip
[e4] Move RAP e4 incubator project to main RAP Runtime project
Use commit 594b007f1f564cdcf7b77b947affea8f58999c94 from the RAP e4 Incubator Git repository [1] and move the bundles, features, and demo/example projects into the matching directories of the main RAP Runtime repository. The tooling projects remain in the incubator Git repository for the time being. The releng projects won't be migrated as they will be replaced with new ones during the migration process. [1] https://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.e4.git/ Change-Id: Id2290c781dfc81dcb2f72f1e375eb1e45197a445 Signed-off-by: Markus Knauer <mknauer@eclipsesource.com>
-rw-r--r--bundles/org.eclipse.e4.core.commands/.classpath8
-rw-r--r--bundles/org.eclipse.e4.core.commands/.project39
-rw-r--r--bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.core.runtime.prefs2
-rwxr-xr-xbundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.core.prefs418
-rwxr-xr-xbundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.ui.prefs124
-rw-r--r--bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.pde.prefs35
-rw-r--r--bundles/org.eclipse.e4.core.commands/META-INF/MANIFEST.MF30
-rw-r--r--bundles/org.eclipse.e4.core.commands/META-INF/p2.inf13
-rw-r--r--bundles/org.eclipse.e4.core.commands/OSGI-INF/commands.xml9
-rw-r--r--bundles/org.eclipse.e4.core.commands/OSGI-INF/handlers.xml9
-rw-r--r--bundles/org.eclipse.e4.core.commands/about.html28
-rw-r--r--bundles/org.eclipse.e4.core.commands/build.properties20
-rw-r--r--bundles/org.eclipse.e4.core.commands/forceQualifierUpdate.txt2
-rw-r--r--bundles/org.eclipse.e4.core.commands/plugin.properties12
-rw-r--r--bundles/org.eclipse.e4.core.commands/pom.xml37
-rw-r--r--bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/CommandServiceAddon.java87
-rw-r--r--bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java76
-rw-r--r--bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/HandlerServiceHandler.java176
-rw-r--r--bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java246
-rw-r--r--bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ECommandService.java49
-rw-r--r--bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/EHandlerService.java52
-rw-r--r--bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ExpressionContext.java107
-rw-r--r--bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/Activator.java46
-rw-r--r--bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceCreationFunction.java65
-rw-r--r--bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceCreationFunction.java24
-rw-r--r--bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/ICommandHelpService.java42
-rw-r--r--bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/SetEnabled.java36
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/.classpath8
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/.project39
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.jdt.core.prefs419
-rwxr-xr-xbundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.jdt.ui.prefs125
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.pde.api.tools.prefs97
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.pde.prefs32
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/META-INF/MANIFEST.MF32
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/META-INF/p2.inf13
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/OSGI-INF/bindings.xml8
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/about.html28
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/build.properties20
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/forceQualifierUpdate.txt2
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/plugin.properties12
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/pom.xml37
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/internal/KeyAssistDialog.java589
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/KeyBindingDispatcher.java617
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/OutOfOrderListener.java106
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/OutOfOrderVerifyListener.java100
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/BindingServiceAddon.java40
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/EBindingService.java61
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingServiceCreationFunction.java28
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingServiceImpl.java185
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingTable.java347
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingTableManager.java266
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/ContextSet.java99
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/Util.java669
-rw-r--r--bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/keys/CancelOnModifyListener.java53
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/.classpath8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/.project34
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.jdt.core.prefs419
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.jdt.ui.prefs124
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.pde.api.tools.prefs97
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.pde.prefs32
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF32
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/p2.inf13
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/about.html28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/build.properties22
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/forceQualifierUpdate.txt3
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/icons/full/etool16/fastview_restore.gifbin0 -> 90 bytes
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/icons/full/obj16/layout_co.gifbin0 -> 589 bytes
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/plugin.properties14
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/plugin.xml26
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/pom.xml37
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src-rap/org/eclipse/e4/ui/workbench/addons/minmax/TrimPaneLayout.java303
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java345
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDAddon.java19
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/README.txt1
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/Messages.java36
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java1026
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java1305
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/messages.properties20
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java135
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitterAddon.java153
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/CleanupProcessor.java42
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/DnDProcessor.java40
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/MinMaxProcessor.java41
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/SplitterProcessor.java43
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/.classpath7
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/.project34
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.jdt.core.prefs418
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.jdt.ui.prefs124
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.pde.api.tools.prefs97
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.pde.prefs32
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/MANIFEST.MF36
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/p2.inf13
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/about.html28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/build.properties20
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/forceQualifierUpdate.txt4
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/icons/full/ovr16/pinned_ovr.gifbin0 -> 117 bytes
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/icons/viewMenu.pngbin0 -> 135 bytes
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/plugin.properties12
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/pom.xml37
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/AbstractTableInformationControl.java597
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java218
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/IUpdateService.java29
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/SWTRenderersActivator.java46
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/SWTRenderersMessages.java44
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/messages.properties25
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/AreaRenderer.java238
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CSSEngineHelper.java114
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java668
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CompositeRenderer.java72
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ContributedPartRenderer.java293
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ContributionRecord.java367
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/DirectContributionItem.java575
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/DirectMenuItemRenderer.java104
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/DynamicContributionContributionItem.java83
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ElementReferenceRenderer.java185
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java895
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledMenuItemRenderer.java191
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LayoutModifierToolControl.java40
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java317
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuItemRenderer.java220
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerHideProcessor.java154
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java1195
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRendererFilter.java300
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerServiceFilter.java191
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerShowProcessor.java239
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/Messages.java30
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/PerspectiveRenderer.java74
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/PerspectiveStackRenderer.java119
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SWTPartRenderer.java395
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java429
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java196
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SeparatorRenderer.java64
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java1865
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java311
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java981
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarRenderer.java274
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolControlContribution.java92
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolControlRenderer.java262
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemRenderer.java497
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolItemUpdater.java47
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/TrimBarLayout.java337
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/TrimBarRenderer.java219
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/TrimUtil.java59
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/TrimmedPartLayout.java321
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java898
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WorkbenchRendererFactory.java156
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/messages.properties13
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/.classpath7
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/.options7
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/.project39
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/.settings/.api_filters11
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/.settings/org.eclipse.jdt.core.prefs386
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/.settings/org.eclipse.jdt.ui.prefs66
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/.settings/org.eclipse.pde.api.tools.prefs97
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/.settings/org.eclipse.pde.prefs32
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF51
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/META-INF/p2.inf13
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/menuservice.xml8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/statusreporter.xml8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/OSGI-INF/testableobject.xml7
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/about.html28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/build.properties23
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/forceQualifierUpdate.txt6
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/icons/full/dtool16/clear_co.gifbin0 -> 314 bytes
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/icons/full/etool16/clear_co.gifbin0 -> 322 bytes
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/icons/full/obj16/fldr_obj.gifbin0 -> 216 bytes
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/plugin.properties15
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/plugin.xml54
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/pom.xml37
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/AbstractPartRenderer.java153
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/AnimationEngine.java230
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/AnimationFeedbackBase.java114
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/CSSConstants.java26
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/CSSRenderingUtils.java305
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java947
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Testable.java130
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/FaderAnimationFeedback.java66
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/GenTopic.java112
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/IEventLoopAdvisor.java62
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/MenuService.java89
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/MenuServiceCreationFunction.java31
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java1496
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/Policy.java16
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/ResourceUtility.java56
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SelectionAdapterFactory.java112
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/ShellActivationListener.java188
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/StatusReporterCreationFunction.java28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/WorkbenchSWTActivator.java315
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/WorkbenchStatusReporter.java137
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/handlers/ShowViewHandler.java50
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/handlers/ThemeUtil.java32
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/factories/IRendererFactory.java20
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/BasicUIJob.java95
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/FilteredTree.java1193
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/PatternFilter.java355
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/SearchPattern.java679
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/ShowViewDialog.java460
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/StringMatcher.java495
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/ViewComparator.java63
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/ViewContentProvider.java130
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/ViewLabelProvider.java122
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/ViewPatternFilter.java56
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/WorkbenchSWTMessages.java53
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/messages.properties43
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java479
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/ISWTResourceUtilities.java32
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.classpath8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.options7
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.project39
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.settings/.api_filters432
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.settings/org.eclipse.jdt.core.prefs391
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.settings/org.eclipse.jdt.launching.prefs2
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.settings/org.eclipse.jdt.ui.prefs124
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.settings/org.eclipse.pde.api.tools.prefs97
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/.settings/org.eclipse.pde.prefs32
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF43
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/META-INF/p2.inf13
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/OSGI-INF/localechangeservice.xml8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/OSGI-INF/partService.xml8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/OSGI-INF/progress.xml8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/about.html28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/build.properties23
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/forceQualifierUpdate.txt4
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/plugin.properties16
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/plugin.xml68
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/pom.xml37
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/schema/org.eclipse.e4.workbench.model.definition.enrichment.exsd107
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/schema/org.eclipse.e4.workbench.model.exsd226
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src-rap/org/eclipse/e4/ui/internal/workbench/addons/CommandProcessingAddon.java272
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/LocaleChangeServiceContextFunction.java36
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/LocaleChangeServiceImpl.java153
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/Activator.java230
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ActiveChildLookupFunction.java39
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ActivePartLookupFunction.java43
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ApplicationPartServiceImpl.java165
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/BundleFinder.java125
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/CommandLineOptionModelProcessor.java67
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/CompositeDelta.java46
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ConfigurationElementAdapter.java85
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ContributionsAnalyzer.java770
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/DefaultLoggerProvider.java34
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java266
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4XMIResource.java195
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4XMIResourceFactory.java63
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/EMFDeltaEntrySet.java41
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/EMFDeltaMapSet.java41
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/EMFModelDeltaDelayedSet.java47
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/EMFModelDeltaSet.java36
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/EMFModelDeltaThreeWayDelayedSet.java37
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/EMFModelDeltaUnset.java36
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ExceptionHandler.java22
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ExtensionPointProxy.java85
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ExtensionsSort.java117
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/GenericMApplicationElementFactoryImpl.java315
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/IDelegateInitializer.java23
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelAssembler.java329
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelReconcilingService.java130
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java1012
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/OpaqueElementUtil.java163
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/Parameter.java244
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartActivationHistory.java358
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceCreationFunction.java58
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java1418
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceSaveHandler.java113
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PlaceholderResolver.java86
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/Policy.java26
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ProgressMonitorFunction.java29
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ReflectionContributionFactory.java162
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/RenderedElementUtil.java115
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java402
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionAggregator.java384
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionServiceImpl.java99
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/TopologicalSort.java237
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/Trackable.java25
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/UIEventPublisher.java283
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/URIHelper.java136
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/Util.java480
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/WorkbenchLogger.java164
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/XMLModelReconciler.java1996
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java124
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java152
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/handlers/ExitHandler.java21
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/handlers/SaveAllHandler.java34
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/handlers/SaveHandler.java33
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/handlers/UnimplementedHandler.java21
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IExceptionHandler.java28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IModelResourceHandler.java54
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IPresentationEngine.java274
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IResourceUtilities.java34
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IWorkbench.java117
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/Selector.java29
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/UIEvents.java1402
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/lifecycle/PostContextCreate.java28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/lifecycle/PreSave.java28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/lifecycle/ProcessAdditions.java28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/lifecycle/ProcessRemovals.java28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EModelService.java562
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EObjModelHandler.java88
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EPartService.java364
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/EPlaceholderResolver.java43
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/ESelectionService.java139
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/ElementMatcher.java86
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/IDelta.java26
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/IModelReconcilingService.java56
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/IPartListener.java32
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/ISaveHandler.java35
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/ISelectionListener.java24
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/IWindowCloseHandler.java27
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/ModelDelta.java74
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/ModelHandlerBase.java35
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/ModelReconciler.java462
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/modeling/package.html18
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/package.html17
-rw-r--r--bundles/org.eclipse.rap.e4/.classpath7
-rw-r--r--bundles/org.eclipse.rap.e4/.project33
-rw-r--r--bundles/org.eclipse.rap.e4/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--bundles/org.eclipse.rap.e4/META-INF/MANIFEST.MF28
-rw-r--r--bundles/org.eclipse.rap.e4/OSGI-INF/preferenceserviceCF.xml9
-rw-r--r--bundles/org.eclipse.rap.e4/OSGI-INF/rapeventbroker.xml9
-rw-r--r--bundles/org.eclipse.rap.e4/OSGI-INF/rapeventobjectsupplier.xml9
-rw-r--r--bundles/org.eclipse.rap.e4/OSGI-INF/rappreferenceobjectsupplier.xml9
-rw-r--r--bundles/org.eclipse.rap.e4/OSGI-INF/rapuieventobjectsupplier.xml9
-rw-r--r--bundles/org.eclipse.rap.e4/build.properties7
-rw-r--r--bundles/org.eclipse.rap.e4/pom.xml37
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/E4ApplicationConfig.java59
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/E4EntryPointFactory.java180
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/Activator.java63
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPAbstractObjectSupplierDispatcher.java78
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPEventBroker.java184
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPEventBrokerContextFunction.java17
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPEventObjectSupplier.java250
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPEventObjectSupplierDispatcher.java8
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPPreferencesObjectSupplier.java394
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPPreferencesObjectSupplierDispatcher.java8
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPTranslationSupplierDispatcher.java11
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPUIEventHandler.java53
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPUIEventObjectSupplier.java71
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/internal/RAPUIEventObjectSupplierDispatcher.java8
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/preferences/EPreference.java23
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/preferences/EPreferenceListener.java7
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/preferences/EPreferenceService.java32
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/preferences/internal/PreferenceServiceContextFunction.java13
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/preferences/internal/RAPPreferenceService.java261
-rw-r--r--examples/org.eclipse.rap.e4.demo/.classpath7
-rw-r--r--examples/org.eclipse.rap.e4.demo/.project28
-rw-r--r--examples/org.eclipse.rap.e4.demo/Application.e4xmi79
-rw-r--r--examples/org.eclipse.rap.e4.demo/META-INF/MANIFEST.MF18
-rw-r--r--examples/org.eclipse.rap.e4.demo/OSGI-INF/contribution.xml7
-rw-r--r--examples/org.eclipse.rap.e4.demo/OSGI-INF/l10n/bundle.properties17
-rw-r--r--examples/org.eclipse.rap.e4.demo/OSGI-INF/l10n/bundle_de.properties17
-rw-r--r--examples/org.eclipse.rap.e4.demo/OSGI-INF/l10n/bundle_en.properties10
-rw-r--r--examples/org.eclipse.rap.e4.demo/build.properties6
-rw-r--r--examples/org.eclipse.rap.e4.demo/dev_org.eclipse.rap.e4.demo.launch42
-rw-r--r--examples/org.eclipse.rap.e4.demo/icons/disk.pngbin0 -> 620 bytes
-rw-r--r--examples/org.eclipse.rap.e4.demo/icons/door_in.pngbin0 -> 693 bytes
-rw-r--r--examples/org.eclipse.rap.e4.demo/icons/folder_user.pngbin0 -> 730 bytes
-rw-r--r--examples/org.eclipse.rap.e4.demo/icons/report_user.pngbin0 -> 785 bytes
-rw-r--r--examples/org.eclipse.rap.e4.demo/icons/user_add.pngbin0 -> 746 bytes
-rw-r--r--examples/org.eclipse.rap.e4.demo/icons/user_delete.pngbin0 -> 767 bytes
-rw-r--r--examples/org.eclipse.rap.e4.demo/org.eclipse.rap.e4.demo.launch42
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/BasicApplication.java28
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/handlers/HelloWorldHandler.java16
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/handlers/SwitchPerspectives.java16
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/lifecycle/LoginLifcecycle.java90
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/parts/EventSamplePart.java91
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/parts/NLSMessages.java10
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/parts/NLSSamplePart.java61
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/parts/PreferenceSamplePart.java91
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/parts/SharedPart.java24
-rw-r--r--examples/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/parts/SimpleTest.java18
-rw-r--r--features/org.eclipse.rap.e4.base.feature/.project17
-rw-r--r--features/org.eclipse.rap.e4.base.feature/build.properties1
-rw-r--r--features/org.eclipse.rap.e4.base.feature/feature.xml390
-rw-r--r--features/org.eclipse.rap.e4.base.feature/pom.xml19
-rw-r--r--features/org.eclipse.rap.e4.target.feature/.project17
-rw-r--r--features/org.eclipse.rap.e4.target.feature/build.properties1
-rw-r--r--features/org.eclipse.rap.e4.target.feature/feature.xml359
-rw-r--r--features/org.eclipse.rap.e4.target.feature/pom.xml18
383 files changed, 57504 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.core.commands/.classpath b/bundles/org.eclipse.e4.core.commands/.classpath
new file mode 100644
index 0000000000..bd3096fadd
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-rap"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.e4.core.commands/.project b/bundles/org.eclipse.e4.core.commands/.project
new file mode 100644
index 0000000000..9ceac7a562
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/.project
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.e4.core.commands</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000000..c522e1f4ae
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000000..adbdd50593
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,418 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
+org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.ui.prefs
new file mode 100755
index 0000000000..f6f4c8f840
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,124 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
+formatter_settings_version=12
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment"/><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..486a796cd5
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,35 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=1
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=0
+compilers.p.discouraged-class=1
+compilers.p.illegal-att-value=0
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=0
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.p.unused-element-or-attribute=1
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.e4.core.commands/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.core.commands/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..b6f1066bd5
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.e4.core.commands;singleton:=true
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-Version: 0.11.0.qualifier
+Bundle-Activator: org.eclipse.e4.core.commands.internal.Activator
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Import-Package: javax.annotation;version="1.0.0",
+ javax.inject;version="1.0.0",
+ org.eclipse.core.commands,
+ org.eclipse.core.commands.common,
+ org.eclipse.core.expressions,
+ org.eclipse.e4.core.contexts,
+ org.eclipse.e4.core.services.log,
+ org.osgi.framework;version="1.5.0"
+Export-Package: org.eclipse.e4.core.commands;
+ x-friends:="org.eclipse.e4.ui.bindings,
+ org.eclipse.e4.ui.workbench,
+ org.eclipse.e4.ui.workbench.renderers.swt,
+ org.eclipse.ui.workbench,
+ org.eclipse.e4.ui.workbench.swt,
+ org.eclipse.e4.ui.progress,
+ org.eclipse.e4.core.commands.tests",
+ org.eclipse.e4.core.commands.internal;x-friends:="org.eclipse.e4.ui.bindings,org.eclipse.ui.workbench"
+Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.6.0,4.0.0)",
+ org.eclipse.e4.core.di;bundle-version="0.9.0"
+Require-Capability: org.eclipse.rap
diff --git a/bundles/org.eclipse.e4.core.commands/META-INF/p2.inf b/bundles/org.eclipse.e4.core.commands/META-INF/p2.inf
new file mode 100644
index 0000000000..f4e1a274dc
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/META-INF/p2.inf
@@ -0,0 +1,13 @@
+# Ensure that modified RAP e4 platform bundles are only installed in RAP environment
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=491177
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=490922
+
+# Make sure that a RAP RWT implementation is available
+requires.0.namespace = org.eclipse.rap
+requires.0.name = org.eclipse.rap.rwt
+
+# Do not allow to install this IU in case the SWT bundle is available
+requires.1.namespace = org.eclipse.equinox.p2.iu
+requires.1.name = org.eclipse.swt
+requires.1.min = 0
+requires.1.max = 0
diff --git a/bundles/org.eclipse.e4.core.commands/OSGI-INF/commands.xml b/bundles/org.eclipse.e4.core.commands/OSGI-INF/commands.xml
new file mode 100644
index 0000000000..c4505399bd
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/OSGI-INF/commands.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.core.commands">
+ <implementation class="org.eclipse.e4.core.commands.internal.CommandServiceCreationFunction"/>
+ <service>
+ <provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
+ </service>
+ <property name="service.context.key" type="String" value="org.eclipse.e4.core.commands.ECommandService"/>
+</scr:component>
+
diff --git a/bundles/org.eclipse.e4.core.commands/OSGI-INF/handlers.xml b/bundles/org.eclipse.e4.core.commands/OSGI-INF/handlers.xml
new file mode 100644
index 0000000000..649897145b
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/OSGI-INF/handlers.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.core.handlers">
+ <implementation class="org.eclipse.e4.core.commands.internal.HandlerServiceCreationFunction"/>
+ <service>
+ <provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
+ </service>
+ <property name="service.context.key" type="String" value="org.eclipse.e4.core.commands.EHandlerService"/>
+</scr:component>
+
diff --git a/bundles/org.eclipse.e4.core.commands/about.html b/bundles/org.eclipse.e4.core.commands/about.html
new file mode 100644
index 0000000000..3ce4e7e75b
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 20, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.core.commands/build.properties b/bundles/org.eclipse.e4.core.commands/build.properties
new file mode 100644
index 0000000000..849e0b755f
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2013, 2015 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/,\
+ about.html,\
+ plugin.properties
+source.. = src/,\
+ src-rap/
+src.includes = about.html
+jre.compilation.profile = JavaSE-1.7
diff --git a/bundles/org.eclipse.e4.core.commands/forceQualifierUpdate.txt b/bundles/org.eclipse.e4.core.commands/forceQualifierUpdate.txt
new file mode 100644
index 0000000000..56f1032a8a
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/forceQualifierUpdate.txt
@@ -0,0 +1,2 @@
+# To force a version qualifier update add the bug here
+Bug 403352 - Update all parent versions to match our build stream
diff --git a/bundles/org.eclipse.e4.core.commands/plugin.properties b/bundles/org.eclipse.e4.core.commands/plugin.properties
new file mode 100644
index 0000000000..85ce14d8c6
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+pluginName = Eclipse e4 core commands
+providerName = Eclipse.org
diff --git a/bundles/org.eclipse.e4.core.commands/pom.xml b/bundles/org.eclipse.e4.core.commands/pom.xml
new file mode 100644
index 0000000000..f0ba8f87c2
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.rap.e4</groupId>
+ <artifactId>org.eclipse.e4.core.commands</artifactId>
+ <version>0.11.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <parent>
+ <groupId>org.eclipse.rap.e4</groupId>
+ <artifactId>org.eclipse.rap.e4.target-releng</artifactId>
+ <relativePath>../../releng/releng-target/pom.xml</relativePath>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
+
+ <build>
+ <resources>
+ <!-- to ensure that the feature lookup of the ui test works -->
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>META-INF/</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/CommandServiceAddon.java b/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/CommandServiceAddon.java
new file mode 100644
index 0000000000..b7097cc020
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/CommandServiceAddon.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Lars Vogel <Lars.Vogel@gmail.com> - Bug 431180
+ ******************************************************************************/
+
+package org.eclipse.e4.core.commands;
+
+import java.lang.reflect.Field;
+import java.util.LinkedList;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+import org.eclipse.core.commands.CommandManager;
+import org.eclipse.e4.core.commands.internal.CommandServiceImpl;
+import org.eclipse.e4.core.commands.internal.HandlerServiceCreationFunction;
+import org.eclipse.e4.core.commands.internal.HandlerServiceImpl;
+import org.eclipse.e4.core.commands.internal.HandlerServiceImpl.ExecutionContexts;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+
+/**
+ * Provide the command and handler service as an add-on. Must be instantiated against the
+ * application level context.
+ *
+ * @noinstantiate
+ */
+public class CommandServiceAddon {
+ private IEclipseContext context;
+
+ @Inject
+ public CommandServiceAddon(IEclipseContext context) {
+ this.context = context;
+ }
+
+ @PostConstruct
+ void init(IEclipseContext context) {
+ // global command service. There can be only one ... per application :-)
+ CommandManager manager = context.get(CommandManager.class);
+ if (manager == null) {
+ manager = new CommandManager();
+ // setCommandFireEvents(manager, false);
+ context.set(CommandManager.class, manager);
+ }
+
+ CommandServiceImpl service = ContextInjectionFactory
+ .make(CommandServiceImpl.class, context);
+ context.set(ECommandService.class, service);
+
+ // handler service
+ context.set(EHandlerService.class.getName(), new HandlerServiceCreationFunction());
+ context.set("_handlerExecutionStack", new LinkedList<ExecutionContexts>()); //$NON-NLS-1$
+ // provide the initial application context, just in case.
+ HandlerServiceImpl.push(context, null);
+ }
+
+ @PreDestroy
+ void cleanup() {
+ HandlerServiceImpl.pop(context);
+ }
+
+ /**
+ * @param manager
+ * @param b
+ */
+ void setCommandFireEvents(CommandManager manager, boolean b) {
+ try {
+ Field f = CommandManager.class.getDeclaredField("shouldCommandFireEvents"); //$NON-NLS-1$
+ f.setAccessible(true);
+ f.set(manager, Boolean.valueOf(b));
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java b/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java
new file mode 100644
index 0000000000..052e71364c
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.core.commands.internal;
+
+import java.util.Map;
+import javax.inject.Inject;
+import org.eclipse.core.commands.Category;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.CommandManager;
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.e4.core.commands.ECommandService;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+
+/**
+ *
+ */
+public class CommandServiceImpl implements ECommandService {
+
+ private CommandManager commandManager;
+ private IEclipseContext context;
+
+ @Inject
+ public void setManager(CommandManager m, IEclipseContext c) {
+ commandManager = m;
+ context = c;
+ }
+
+ @Override
+ public ParameterizedCommand createCommand(String id, Map<String, Object> parameters) {
+ Command command = getCommand(id);
+ if (command == null) {
+ return null;
+ }
+ return ParameterizedCommand.generateCommand(command, parameters);
+ }
+
+ @Override
+ public Category defineCategory(String id, String name, String description) {
+ Category cat = commandManager.getCategory(id);
+ if (!cat.isDefined()) {
+ cat.define(name, description);
+ }
+ return cat;
+ }
+
+ @Override
+ public Command defineCommand(String id, String name, String description, Category category,
+ IParameter[] parameters) {
+ Command cmd = commandManager.getCommand(id);
+ if (!cmd.isDefined()) {
+ cmd.define(name, description, category, parameters);
+ cmd.setHandler(HandlerServiceImpl.getHandler(id, context));
+ }
+ return cmd;
+ }
+
+ @Override
+ public Category getCategory(String categoryId) {
+ return commandManager.getCategory(categoryId);
+ }
+
+ @Override
+ public Command getCommand(String commandId) {
+ return commandManager.getCommand(commandId);
+ }
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/HandlerServiceHandler.java b/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/HandlerServiceHandler.java
new file mode 100644
index 0000000000..60a1984a6b
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/HandlerServiceHandler.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.core.commands.internal;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.HandlerEvent;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.NotHandledException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.e4.core.commands.ExpressionContext;
+import org.eclipse.e4.core.commands.internal.HandlerServiceImpl.ExecutionContexts;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.EclipseContextFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+
+/**
+ * Provide an IHandler to delegate calls to.
+ */
+public class HandlerServiceHandler extends AbstractHandler {
+
+ private static final String FAILED_TO_FIND_HANDLER_DURING_EXECUTION = "Failed to find handler during execution"; //$NON-NLS-1$
+ private static final String HANDLER_MISSING_EXECUTE_ANNOTATION = "Handler is missing @Execute"; //$NON-NLS-1$
+ private static final Object missingExecute = new Object();
+
+ protected String commandId;
+ private IEclipseContext context;
+
+ public HandlerServiceHandler(String commandId, IEclipseContext context) {
+ this.commandId = commandId;
+ this.context = context;
+ }
+
+ @Override
+ public boolean isEnabled() {
+ ExecutionContexts contexts = HandlerServiceImpl.peek(context);
+ // setEnabled(contexts);
+ IEclipseContext executionContext = contexts != null ? contexts.context : null; // getExecutionContext(contexts);
+ if (executionContext == null) {
+ return super.isEnabled();
+ }
+ Object handler = HandlerServiceImpl.lookUpHandler(executionContext, commandId);
+ if (handler == null) {
+ setBaseEnabled(false);
+ return super.isEnabled();
+ }
+ IEclipseContext staticContext = contexts.staticContext; // getStaticContext(contexts);
+ Boolean result = (Boolean) ContextInjectionFactory.invoke(handler, CanExecute.class,
+ executionContext, staticContext, Boolean.TRUE);
+ setBaseEnabled(result.booleanValue());
+ return super.isEnabled();
+ }
+
+ @Override
+ public void setEnabled(Object evaluationContext) {
+ boolean createContext = false;
+ IEclipseContext executionContext = getExecutionContext(evaluationContext);
+ if (executionContext == null) {
+ return;
+ }
+ Object handler = HandlerServiceImpl.lookUpHandler(executionContext, commandId);
+ if (handler == null) {
+ return;
+ }
+ IEclipseContext staticContext = getStaticContext(executionContext);
+ if (staticContext == null) {
+ staticContext = EclipseContextFactory.create();
+ createContext = true;
+ }
+ ContextInjectionFactory.invoke(handler, SetEnabled.class, executionContext, staticContext,
+ Boolean.TRUE);
+ if (createContext) {
+ staticContext.dispose();
+ }
+ }
+
+ private IEclipseContext getStaticContext(IEclipseContext executionContext) {
+ final ExecutionContexts pair = HandlerServiceImpl.peek(context);
+ if (pair != null) {
+ if (pair.context != executionContext) {
+ // log this
+ }
+ return pair.staticContext;
+ }
+ return null;
+ }
+
+ protected IEclipseContext getExecutionContext(Object evalObj) {
+ // if (evalObj instanceof ExecutionContexts) {
+ // return ((ExecutionContexts) evalObj).context;
+ // }
+ if (evalObj instanceof IEclipseContext) {
+ return (IEclipseContext) evalObj;
+ }
+ if (evalObj instanceof ExpressionContext) {
+ return ((ExpressionContext) evalObj).eclipseContext;
+ }
+ if (evalObj instanceof IEvaluationContext) {
+ return getExecutionContext(((IEvaluationContext) evalObj).getParent());
+ }
+ final ExecutionContexts pair = HandlerServiceImpl.peek(context);
+ if (pair != null) {
+ return pair.context;
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isHandled() {
+ ExecutionContexts contexts = HandlerServiceImpl.peek(context);
+ if (contexts != null) {
+ Object handler = HandlerServiceImpl.lookUpHandler(contexts.context, commandId);
+ if (handler instanceof IHandler) {
+ return ((IHandler) handler).isHandled();
+ }
+ return handler != null;
+
+ }
+ return false;
+ }
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IEclipseContext executionContext = getExecutionContext(event.getApplicationContext());
+ if (executionContext == null) {
+ throw new ExecutionException(FAILED_TO_FIND_HANDLER_DURING_EXECUTION,
+ new NotHandledException(FAILED_TO_FIND_HANDLER_DURING_EXECUTION));
+ }
+
+ Object handler = HandlerServiceImpl.lookUpHandler(executionContext, commandId);
+ if (handler == null) {
+ return null;
+ }
+ IEclipseContext staticContext = getStaticContext(executionContext);
+ IEclipseContext localStaticContext = null;
+ try {
+ if (staticContext == null) {
+ staticContext = localStaticContext = EclipseContextFactory
+ .create(HandlerServiceImpl.TMP_STATIC_CONTEXT);
+ staticContext.set(HandlerServiceImpl.PARM_MAP, event.getParameters());
+ }
+ Object result = ContextInjectionFactory.invoke(handler, Execute.class, executionContext, staticContext,
+ missingExecute);
+ if (result == missingExecute) {
+ throw new ExecutionException(HANDLER_MISSING_EXECUTE_ANNOTATION,
+ new NotHandledException(getClass().getName()));
+ }
+ return result;
+ } finally {
+ if (localStaticContext != null) {
+ localStaticContext.dispose();
+ }
+ }
+ }
+
+ @Override
+ public void fireHandlerChanged(HandlerEvent handlerEvent) {
+ super.fireHandlerChanged(handlerEvent);
+ }
+
+ public void overrideEnabled(boolean b) {
+ setBaseEnabled(b);
+ }
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java b/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java
new file mode 100644
index 0000000000..ad283fc860
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src-rap/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java
@@ -0,0 +1,246 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.core.commands.internal;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+import javax.inject.Inject;
+import org.eclipse.core.commands.AbstractParameterValueConverter;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.NotEnabledException;
+import org.eclipse.core.commands.NotHandledException;
+import org.eclipse.core.commands.ParameterType;
+import org.eclipse.core.commands.ParameterValueConversionException;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.e4.core.commands.EHandlerService;
+import org.eclipse.e4.core.commands.ExpressionContext;
+import org.eclipse.e4.core.contexts.ContextFunction;
+import org.eclipse.e4.core.contexts.EclipseContextFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.services.log.Logger;
+
+/**
+ *
+ */
+public class HandlerServiceImpl implements EHandlerService {
+ /**
+ * The static context key under which a command 'trigger' from legacy code is stored during
+ * calls to {@link #executeHandler(ParameterizedCommand, IEclipseContext)}
+ *
+ * @see IEclipseContext
+ * @see HandlerServiceImpl#executeHandler(ParameterizedCommand, IEclipseContext)
+ */
+ private static final String SWT_TRIGGER = "org.eclipse.swt.widgets.Event"; //$NON-NLS-1$
+ static final String TMP_STATIC_CONTEXT = "tmp-staticContext"; //$NON-NLS-1$
+ public final static String H_ID = "handler::"; //$NON-NLS-1$
+ public final static String PARM_MAP = "parmMap::"; //$NON-NLS-1$
+ public final static String CAN_EXECUTE = "HandlerServiceImpl.canExecute"; //$NON-NLS-1$
+ public final static String NOT_HANDLED = "HandlerServiceImpl.notHandled"; //$NON-NLS-1$
+ public final static String STATIC_CONTEXT = "HandlerServiceImpl.staticContext"; //$NON-NLS-1$
+ public final static String HANDLER_EXCEPTION = "HandlerServiceImpl.exception"; //$NON-NLS-1$
+
+ public static ContextFunction handlerGenerator = null;
+
+ private static LinkedList<ExecutionContexts> DEFAULT_STACKLIST = new LinkedList<HandlerServiceImpl.ExecutionContexts>();
+
+ public static IHandler getHandler(String commandId, IEclipseContext context) {
+ if (handlerGenerator != null) {
+ return (IHandler) handlerGenerator.compute(null, commandId);
+ }
+ return new HandlerServiceHandler(commandId, context);
+ }
+
+ public static class ExecutionContexts {
+ public IEclipseContext context;
+ public IEclipseContext staticContext;
+
+ public ExecutionContexts(IEclipseContext ctx, IEclipseContext staticCtx) {
+ context = ctx;
+ staticContext = staticCtx;
+ }
+ }
+
+ static LinkedList<ExecutionContexts> getContextStack(IEclipseContext context) {
+ if (context == null) {
+ return DEFAULT_STACKLIST;
+ }
+ Object handlerExecutionStack = context.get("_handlerExecutionStack"); //$NON-NLS-1$
+ if (handlerExecutionStack == null) {
+ return DEFAULT_STACKLIST;
+ }
+ return (LinkedList<ExecutionContexts>) handlerExecutionStack;
+ }
+
+ public static void push(IEclipseContext ctx, IEclipseContext staticCtx) {
+ getContextStack(ctx).addFirst(new ExecutionContexts(ctx, staticCtx));
+ }
+
+ public static ExecutionContexts pop(IEclipseContext ctx) {
+ return getContextStack(ctx).poll();
+ }
+
+ static ExecutionContexts peek(IEclipseContext ctx) {
+ return getContextStack(ctx).peek();
+ }
+
+ /**
+ * @param context
+ * the context to start the lookup process
+ * @param commandId
+ * @return a handler, or <code>null</code>
+ */
+ public static Object lookUpHandler(IEclipseContext context, String commandId) {
+ return context.getActiveLeaf().get(H_ID + commandId);
+ }
+
+ /**
+ * Fill in a temporary static context for execution.
+ *
+ * @param command
+ */
+ @SuppressWarnings("rawtypes")
+ private void addParms(ParameterizedCommand command, IEclipseContext staticContext) {
+ final Map parms = command.getParameterMap();
+ Iterator i = parms.entrySet().iterator();
+ while (i.hasNext()) {
+ Map.Entry entry = (Map.Entry) i.next();
+ String parameterId = (String) entry.getKey();
+ staticContext.set(
+ parameterId,
+ convertParameterValue(command.getCommand(), parameterId,
+ (String) entry.getValue()));
+ }
+ staticContext.set(PARM_MAP, parms);
+ staticContext.set(ParameterizedCommand.class, command);
+ }
+
+ /**
+ * Convert the parameter's value according to it's type.
+ *
+ * @param command
+ * @param parameterId
+ * @param value
+ * @return converted value
+ * @see org.eclipse.e4.ui.model.application.commands.MCommandParameter#getTypeId()
+ */
+ private Object convertParameterValue(Command command, String parameterId, String value) {
+ try {
+ ParameterType parameterType = command.getParameterType(parameterId);
+
+ if (parameterType != null) {
+ AbstractParameterValueConverter valueConverter = parameterType.getValueConverter();
+ if (valueConverter != null) {
+ return valueConverter.convertToObject(value);
+ }
+ }
+ } catch (NotDefinedException e) {
+ } catch (ParameterValueConversionException e) {
+ }
+ return value;
+ }
+
+ private IEclipseContext context;
+
+ @Inject
+ @Optional
+ Logger logger;
+
+ @Override
+ public void activateHandler(String commandId, Object handler) {
+ String handlerId = H_ID + commandId;
+ context.set(handlerId, handler);
+ }
+
+ @Override
+ public boolean canExecute(ParameterizedCommand command) {
+ final IEclipseContext staticContext = EclipseContextFactory.create(TMP_STATIC_CONTEXT);
+ try {
+ return canExecute(command, staticContext);
+ } finally {
+ staticContext.dispose();
+ }
+ }
+
+ @Override
+ public boolean canExecute(ParameterizedCommand command, IEclipseContext staticContext) {
+ final IEclipseContext executionContext = getExecutionContext();
+ addParms(command, staticContext);
+ // executionContext.set(STATIC_CONTEXT, staticContext);
+ push(executionContext, staticContext);
+ try {
+ Command cmd = command.getCommand();
+ cmd.setEnabled(new ExpressionContext(peek(executionContext).context));
+ return cmd.isEnabled();
+ } finally {
+ pop(executionContext);
+ // executionContext.remove(STATIC_CONTEXT);
+ }
+ }
+
+ @Override
+ public void deactivateHandler(String commandId, Object handler) {
+ context.remove(H_ID + commandId);
+ }
+
+ @Override
+ public Object executeHandler(ParameterizedCommand command) {
+ final IEclipseContext staticContext = EclipseContextFactory.create(TMP_STATIC_CONTEXT);
+ try {
+ return executeHandler(command, staticContext);
+ } finally {
+ staticContext.dispose();
+ }
+ }
+
+ @Override
+ public Object executeHandler(ParameterizedCommand command, IEclipseContext staticContext) {
+ final IEclipseContext executionContext = getExecutionContext();
+ addParms(command, staticContext);
+ // executionContext.set(STATIC_CONTEXT, staticContext);
+ push(executionContext, staticContext);
+ try {
+ // Command cmd = command.getCommand();
+ return command.executeWithChecks(staticContext.get(SWT_TRIGGER), new ExpressionContext(
+ peek(executionContext).context));
+ } catch (ExecutionException e) {
+ staticContext.set(HANDLER_EXCEPTION, e);
+ } catch (NotDefinedException e) {
+ staticContext.set(HANDLER_EXCEPTION, e);
+ } catch (NotEnabledException e) {
+ staticContext.set(HANDLER_EXCEPTION, e);
+ } catch (NotHandledException e) {
+ staticContext.set(HANDLER_EXCEPTION, e);
+ } finally {
+ pop(executionContext);
+ // executionContext.remove(STATIC_CONTEXT);
+ }
+ return null;
+ }
+
+ @Inject
+ public void setContext(IEclipseContext c) {
+ context = c;
+ }
+
+ public IEclipseContext getContext() {
+ return context;
+ }
+
+ public IEclipseContext getExecutionContext() {
+ return context.getActiveLeaf();
+ }
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ECommandService.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ECommandService.java
new file mode 100644
index 0000000000..7aa81c641d
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ECommandService.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.core.commands;
+
+import java.util.Map;
+import org.eclipse.core.commands.Category;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.ParameterizedCommand;
+
+/**
+ * @noimplement
+ */
+public interface ECommandService {
+ public ParameterizedCommand createCommand(String id, Map<String, Object> parameters);
+
+ /**
+ * @param id
+ * @param name
+ * @param description
+ * @return
+ * @noreference
+ */
+ public Category defineCategory(String id, String name, String description);
+
+ /**
+ * @param id
+ * @param name
+ * @param description
+ * @param category
+ * @param parameters
+ * @return
+ * @noreference
+ */
+ public Command defineCommand(String id, String name, String description, Category category,
+ IParameter[] parameters);
+
+ public Category getCategory(String categoryId);
+
+ public Command getCommand(String commandId);
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/EHandlerService.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/EHandlerService.java
new file mode 100644
index 0000000000..1843b25136
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/EHandlerService.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.core.commands;
+
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+
+/**
+ * @noimplement
+ */
+public interface EHandlerService {
+
+ public void activateHandler(String commandId, Object handler);
+
+ public void deactivateHandler(String commandId, Object handler);
+
+ public Object executeHandler(ParameterizedCommand command);
+
+ public boolean canExecute(ParameterizedCommand command);
+
+ /**
+ * Execute a handler for the command.
+ *
+ * @param command
+ * Must not be <code>null</code>
+ * @param staticContext
+ * Must not be <code>null</code>. You must dispose your context
+ * when you are done.
+ * @return the command return value.
+ */
+ public Object executeHandler(ParameterizedCommand command, IEclipseContext staticContext);
+
+ /**
+ * Check if a command can be executed.
+ *
+ * @param command
+ * Must not be <code>null</code>.
+ * @param staticContext
+ * Must not be <code>null</code>. You must dispose your context
+ * when you are done.
+ * @return true if the command can be executed.
+ */
+ public boolean canExecute(ParameterizedCommand command, IEclipseContext staticContext);
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ExpressionContext.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ExpressionContext.java
new file mode 100644
index 0000000000..18dc2cf0eb
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/ExpressionContext.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.core.commands;
+
+import java.util.Collections;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.e4.core.contexts.IContextFunction;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+
+/**
+ * @noreference
+ * @since 1.0
+ */
+public class ExpressionContext implements IEvaluationContext {
+ /**
+ * See org.eclipse.e4.ui.services.IServiceConstants.ACTIVE_SELECTION
+ */
+ private static final String ORG_ECLIPSE_UI_SELECTION = "org.eclipse.ui.selection"; //$NON-NLS-1$
+
+ public static final String ALLOW_ACTIVATION = "org.eclipse.e4.core.commands.ExpressionContext.allowActivation"; //$NON-NLS-1$
+
+ public IEclipseContext eclipseContext;
+ public static IContextFunction defaultVariableConverter = null;
+
+ public ExpressionContext(IEclipseContext eclipseContext) {
+ this.eclipseContext = eclipseContext;
+ }
+
+ @Override
+ public IEvaluationContext getParent() {
+ IEclipseContext parent = eclipseContext.getParent();
+ return parent == null ? null : new ExpressionContext(parent);
+ }
+
+ @Override
+ public IEvaluationContext getRoot() {
+ IEclipseContext current = eclipseContext;
+ IEclipseContext parent = current.getParent();
+ while (parent != null) {
+ current = parent;
+ parent = current.getParent();
+ }
+ if (current == eclipseContext) {
+ return this;
+ }
+ return new ExpressionContext(current);
+ }
+
+ @Override
+ public void setAllowPluginActivation(boolean value) {
+ eclipseContext.set(ALLOW_ACTIVATION, Boolean.valueOf(value));
+ }
+
+ @Override
+ public boolean getAllowPluginActivation() {
+ Object obj = eclipseContext.get(ALLOW_ACTIVATION);
+ return obj instanceof Boolean ? ((Boolean) obj).booleanValue() : false;
+ }
+
+ @Override
+ public Object getDefaultVariable() {
+ final Object sel;
+ if (defaultVariableConverter != null) {
+ sel = defaultVariableConverter.compute(eclipseContext, null);
+ } else {
+ sel = eclipseContext.getActive(ORG_ECLIPSE_UI_SELECTION);
+ }
+ return sel == null ? Collections.EMPTY_LIST : sel;
+ }
+
+ @Override
+ public void addVariable(String name, Object value) {
+ eclipseContext.set(name, value);
+ }
+
+ @Override
+ public Object removeVariable(String name) {
+ Object obj = eclipseContext.getLocal(name);
+ eclipseContext.remove(name);
+ return obj;
+ }
+
+ @Override
+ public Object getVariable(String name) {
+ if (IEclipseContext.class.getName().equals(name)) {
+ return eclipseContext;
+ }
+ Object obj = eclipseContext.getActive(name);
+ return obj == null ? IEvaluationContext.UNDEFINED_VARIABLE : obj;
+ }
+
+ @Override
+ public Object resolveVariable(String name, Object[] args) throws CoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/Activator.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/Activator.java
new file mode 100644
index 0000000000..a31e4601b6
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/Activator.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.core.commands.internal;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator implements BundleActivator {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.e4.core.commands"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ plugin = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceCreationFunction.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceCreationFunction.java
new file mode 100644
index 0000000000..f813155df9
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceCreationFunction.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.core.commands.internal;
+
+import org.eclipse.core.commands.CommandManager;
+import org.eclipse.e4.core.contexts.ContextFunction;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+
+/**
+ *
+ */
+public class CommandServiceCreationFunction extends ContextFunction {
+ /**
+ * A context key (value "rootContext") that identifies the root of this context chain. It does
+ * not have to be the global root, but signifies the topmost context for the purposes of
+ * function management and active context chains.
+ */
+ public static final String ROOT_CONTEXT = "rootContext"; //$NON-NLS-1$
+
+ private CommandManager manager = null;
+ private CommandServiceImpl service = null;
+
+ @Override
+ public Object compute(IEclipseContext context, String contextKey) {
+ if (service == null) {
+ IEclipseContext root = getRootContext(context);
+ manager = new CommandManager();
+ root.set(CommandManager.class.getName(), manager);
+ service = ContextInjectionFactory.make(CommandServiceImpl.class, root);
+ }
+ return service;
+ }
+
+ /**
+ * @param context
+ * @return the topmost "root" context
+ */
+ private IEclipseContext getRootContext(IEclipseContext context) {
+ IEclipseContext current = (IEclipseContext) context.get(ROOT_CONTEXT);
+ if (current != null) {
+ return current;
+ }
+ current = context;
+ IEclipseContext parent = current.getParent();
+ while (parent != null) {
+ current = parent;
+ parent = current.getParent();
+ }
+ if (current != null) {
+ current.set(ROOT_CONTEXT, current);
+ }
+ return current;
+ }
+
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceCreationFunction.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceCreationFunction.java
new file mode 100644
index 0000000000..e671f00c36
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceCreationFunction.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.core.commands.internal;
+
+import org.eclipse.e4.core.contexts.ContextFunction;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+
+public class HandlerServiceCreationFunction extends ContextFunction {
+
+ @Override
+ public Object compute(IEclipseContext context, String contextKey) {
+ return ContextInjectionFactory.make(HandlerServiceImpl.class, context);
+ }
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/ICommandHelpService.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/ICommandHelpService.java
new file mode 100644
index 0000000000..a19132f654
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/ICommandHelpService.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.core.commands.internal;
+
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+
+/**
+ * Provides services related to the command context help.
+ */
+public interface ICommandHelpService {
+
+ /**
+ * Calculates the active help context for the command and returns the ID of the help context.
+ *
+ * @param commandId
+ * the ID of the command for which the help context ID is calculated
+ * @param context
+ * the Eclipse context in which handlers of the command will be sought
+ * @return the ID of help context which is active for the command
+ */
+ public String getHelpContextId(String commandId, IEclipseContext context);
+
+ /**
+ * Assigns the help context ID to the command handler.
+ *
+ * @param handler
+ * the command handler to which the help context ID will be assigned
+ * @param contextId
+ * the help context ID to assign
+ */
+ public void setHelpContextId(IHandler handler, String contextId);
+}
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/SetEnabled.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/SetEnabled.java
new file mode 100644
index 0000000000..593e97d3f6
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/SetEnabled.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.core.commands.internal;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Use this annotation to tag a method to call the handler setEnabled method.
+ * <p>
+ * This annotation must not be applied to more than one method per class. If
+ * several class methods are tagged with this annotation, only one of them will
+ * be called.
+ * </p>
+ *
+ * @since 1.3
+ * @noreference
+ */
+@Documented
+@Target({ ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface SetEnabled {
+ // intentionally left empty
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/.classpath b/bundles/org.eclipse.e4.ui.bindings/.classpath
new file mode 100644
index 0000000000..bd3096fadd
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-rap"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.e4.ui.bindings/.project b/bundles/org.eclipse.e4.ui.bindings/.project
new file mode 100644
index 0000000000..093b5d2a45
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/.project
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.e4.ui.bindings</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000000..c522e1f4ae
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..bd457c11c2
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,419 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
+org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.jdt.ui.prefs
new file mode 100755
index 0000000000..b058cded38
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,125 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
+formatter_settings_version=12
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment"/><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 0000000000..a09ec9c2c7
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,97 @@
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Warning
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
diff --git a/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..2ce50474bb
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=1
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.e4.ui.bindings/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.bindings/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..2d5f844a9c
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/META-INF/MANIFEST.MF
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.e4.ui.bindings;singleton:=true
+Bundle-Version: 0.11.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Import-Package: javax.annotation;version="1.0.0",
+ javax.inject;version="1.0.0",
+ org.eclipse.e4.core.commands,
+ org.eclipse.e4.core.commands.internal,
+ org.eclipse.e4.core.services.log,
+ org.eclipse.jface.bindings,
+ org.eclipse.jface.bindings.keys,
+ org.eclipse.jface.bindings.keys.formatting,
+ org.eclipse.jface.dialogs,
+ org.eclipse.jface.window,
+ org.osgi.framework;version="1.5.0"
+Require-Bundle: org.eclipse.core.commands;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.e4.core.contexts;bundle-version="1.0.0",
+ org.eclipse.e4.core.di;bundle-version="1.1.0",
+ org.eclipse.rap.rwt
+Require-Capability: org.eclipse.rap
+Export-Package: org.eclipse.e4.ui.bindings;
+ x-friends:="org.eclipse.e4.ui.workbench,
+ org.eclipse.e4.ui.workbench.renderers.swt,
+ org.eclipse.e4.ui.workbench.swt,
+ org.eclipse.ui.workbench",
+ org.eclipse.e4.ui.bindings.internal;x-friends:="org.eclipse.e4.ui.workbench,org.eclipse.e4.ui.workbench.swt,org.eclipse.ui.workbench",
+ org.eclipse.e4.ui.bindings.keys;x-friends:="org.eclipse.e4.ui.workbench.swt,org.eclipse.ui.workbench"
diff --git a/bundles/org.eclipse.e4.ui.bindings/META-INF/p2.inf b/bundles/org.eclipse.e4.ui.bindings/META-INF/p2.inf
new file mode 100644
index 0000000000..f4e1a274dc
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/META-INF/p2.inf
@@ -0,0 +1,13 @@
+# Ensure that modified RAP e4 platform bundles are only installed in RAP environment
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=491177
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=490922
+
+# Make sure that a RAP RWT implementation is available
+requires.0.namespace = org.eclipse.rap
+requires.0.name = org.eclipse.rap.rwt
+
+# Do not allow to install this IU in case the SWT bundle is available
+requires.1.namespace = org.eclipse.equinox.p2.iu
+requires.1.name = org.eclipse.swt
+requires.1.min = 0
+requires.1.max = 0
diff --git a/bundles/org.eclipse.e4.ui.bindings/OSGI-INF/bindings.xml b/bundles/org.eclipse.e4.ui.bindings/OSGI-INF/bindings.xml
new file mode 100644
index 0000000000..0f3796f60f
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/OSGI-INF/bindings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.ui.bindings">
+ <implementation class="org.eclipse.e4.ui.bindings.internal.BindingServiceCreationFunction"/>
+ <service>
+ <provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
+ </service>
+ <property name="service.context.key" type="String" value="org.eclipse.e4.ui.bindings.EBindingService"/>
+</scr:component> \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.bindings/about.html b/bundles/org.eclipse.e4.ui.bindings/about.html
new file mode 100644
index 0000000000..3ce4e7e75b
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 20, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.bindings/build.properties b/bundles/org.eclipse.e4.ui.bindings/build.properties
new file mode 100644
index 0000000000..4ad436eb43
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2013, 2015 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/,\
+ plugin.properties,\
+ about.html
+source.. = src/,\
+ src-rap/
+src.includes = about.html
+jre.compilation.profile = JavaSE-1.7
diff --git a/bundles/org.eclipse.e4.ui.bindings/forceQualifierUpdate.txt b/bundles/org.eclipse.e4.ui.bindings/forceQualifierUpdate.txt
new file mode 100644
index 0000000000..56f1032a8a
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/forceQualifierUpdate.txt
@@ -0,0 +1,2 @@
+# To force a version qualifier update add the bug here
+Bug 403352 - Update all parent versions to match our build stream
diff --git a/bundles/org.eclipse.e4.ui.bindings/plugin.properties b/bundles/org.eclipse.e4.ui.bindings/plugin.properties
new file mode 100644
index 0000000000..76a2694805
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+pluginName = Eclipse Bindings Support
+providerName = Eclipse.org
diff --git a/bundles/org.eclipse.e4.ui.bindings/pom.xml b/bundles/org.eclipse.e4.ui.bindings/pom.xml
new file mode 100644
index 0000000000..ecbdc088f2
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.rap.e4</groupId>
+ <artifactId>org.eclipse.e4.ui.bindings</artifactId>
+ <version>0.11.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <parent>
+ <groupId>org.eclipse.rap.e4</groupId>
+ <artifactId>org.eclipse.rap.e4.target-releng</artifactId>
+ <relativePath>../../releng/releng-target/pom.xml</relativePath>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
+
+ <build>
+ <resources>
+ <!-- to ensure that the feature lookup of the ui test works -->
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>META-INF/</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/internal/KeyAssistDialog.java b/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/internal/KeyAssistDialog.java
new file mode 100644
index 0000000000..9a295abc6c
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/internal/KeyAssistDialog.java
@@ -0,0 +1,589 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.bindings.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.TreeSet;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.CommandException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.ui.bindings.EBindingService;
+import org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher;
+import org.eclipse.jface.bindings.Binding;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.PopupDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+
+/**
+ * <p>
+ * A dialog displaying a list of key bindings. The dialog will execute a command
+ * if it is selected.
+ * </p>
+ * <p>
+ * The methods on this class are not thread-safe and must be run from the UI
+ * thread.
+ * </p>
+ *
+ * @since 3.1
+ */
+public class KeyAssistDialog extends PopupDialog {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The data key for the binding stored on an SWT widget. The key is a
+ * fully-qualified name, but in reverse order. This is so that the equals
+ * method will detect misses faster.
+ */
+ private static final String BINDING_KEY = "Binding.bindings.jface.eclipse.org"; //$NON-NLS-1$
+
+ /**
+ * The value of <code>previousWidth</code> to set if there is no remembered
+ * width.
+ */
+ private static final int NO_REMEMBERED_WIDTH = -1;
+
+ /**
+ * The ordered list of command identifiers corresponding to the table.
+ */
+ private List<Binding> bindings = new ArrayList<Binding>();
+
+ /**
+ * The table containing of the possible completions. This value is
+ * <code>null</code> until the dialog is created.
+ */
+ private Table completionsTable = null;
+
+ /**
+ * The width of the shell when it was previously open. This is only
+ * remembered until <code>clearRememberedState()</code> is called.
+ */
+ private int previousWidth = NO_REMEMBERED_WIDTH;
+
+ /**
+ * The key binding listener for the associated workbench.
+ */
+ private KeyBindingDispatcher workbenchKeyboard;
+
+ /**
+ * A sorted map of conflicts or partial matches to be used when the dialog
+ * pops up.
+ *
+ * @since 3.3
+ */
+ private Collection<Binding> matches;
+
+ private IEclipseContext context;
+
+ /**
+ * Constructs a new instance of <code>KeyAssistDialog</code>. When the
+ * dialog is first constructed, it contains no widgets. The dialog is first
+ * created with no parent. If a parent is required, call
+ * <code>setParentShell()</code>. Also, between uses, it might be necessary
+ * to call <code>setParentShell()</code> as well.
+ *
+ * @param context
+ * The context in which this dialog is created; must not be
+ * <code>null</code>.
+ * @param associatedKeyboard
+ * The key binding listener for the workbench; must not be
+ * <code>null</code>.
+ */
+ public KeyAssistDialog(IEclipseContext context, KeyBindingDispatcher associatedKeyboard) {
+ super((Shell) null, PopupDialog.INFOPOPUP_SHELLSTYLE, true, false, false, false, null, null);
+ // super(null, PopupDialog.INFOPOPUP_SHELLSTYLE, true, false, false,
+ // false, false, DIALOG_TITLE, getKeySequenceString()); //$NON-NLS-1$
+
+ this.context = context;
+ this.workbenchKeyboard = associatedKeyboard;
+ }
+
+ /**
+ * Clears out the remembered state of the key assist dialog. This includes
+ * its width, as well as the selected binding.
+ */
+ public void clearRememberedState() {
+ previousWidth = NO_REMEMBERED_WIDTH;
+ }
+
+ /**
+ * Closes this shell, but first remembers some state of the dialog. This way
+ * it will have a response if asked to open the dialog again or if asked to
+ * open the keys preference page. This does not remember the internal state.
+ *
+ * @return Whether the shell was already closed.
+ */
+ @Override
+ public boolean close() {
+ return close(false);
+ }
+
+ /**
+ * Closes this shell, but first remembers some state of the dialog. This way
+ * it will have a response if asked to open the dialog again or if asked to
+ * open the keys preference page.
+ *
+ * @param rememberState
+ * Whether the internal state should be remembered.
+ * @return Whether the shell was already closed.
+ */
+ public boolean close(boolean rememberState) {
+ return close(rememberState, true);
+ }
+
+ /**
+ * Closes this shell, but first remembers some state of the dialog. This way
+ * it will have a response if asked to open the dialog again or if asked to
+ * open the keys preference page.
+ *
+ * @param rememberState
+ * Whether the internal state should be remembered.
+ * @param resetState
+ * Whether the state should be reset.
+ * @return Whether the shell was already closed.
+ */
+ private boolean close(boolean rememberState, boolean resetState) {
+ Shell shell = getShell();
+ if (rememberState) {
+
+ // Remember the previous width.
+ int widthToRemember;
+ if ((shell != null) && (!shell.isDisposed())) {
+ widthToRemember = getShell().getSize().x;
+ } else {
+ widthToRemember = NO_REMEMBERED_WIDTH;
+ }
+
+ this.previousWidth = widthToRemember;
+ completionsTable = null;
+ }
+ matches = null;
+ boolean popupClosed = super.close();
+ if (resetState) {
+ workbenchKeyboard.resetState();
+ }
+ return popupClosed;
+ }
+
+ /**
+ * Sets the position for the dialog based on the position of the workbench
+ * window. The dialog is flush with the bottom right corner of the workbench
+ * window. However, the dialog will not appear outside of the display's
+ * client area.
+ *
+ * @param size
+ * The final size of the dialog; must not be <code>null</code>.
+ */
+ private void configureLocation(Point size) {
+ Shell shell = getShell();
+
+ Shell workbenchWindowShell = (Shell) shell.getParent();
+ int xCoord;
+ int yCoord;
+ if (workbenchWindowShell != null) {
+ /*
+ * Position the shell at the bottom right corner of the workbench
+ * window
+ */
+ Rectangle workbenchWindowBounds = workbenchWindowShell.getBounds();
+ xCoord = workbenchWindowBounds.x + workbenchWindowBounds.width - size.x - 10;
+ yCoord = workbenchWindowBounds.y + workbenchWindowBounds.height - size.y - 10;
+
+ } else {
+ xCoord = 0;
+ yCoord = 0;
+
+ }
+ Rectangle bounds = new Rectangle(xCoord, yCoord, size.x, size.y);
+ shell.setBounds(getConstrainedShellBounds(bounds));
+ }
+
+ /**
+ * Sets the size for the dialog based on its previous size. The width of the
+ * dialog is its previous width, if it exists. Otherwise, it is simply the
+ * packed width of the dialog. The maximum width is 40% of the workbench
+ * window's width. The dialog's height is the packed height of the dialog to
+ * a maximum of half the height of the workbench window.
+ *
+ * @return The size of the dialog
+ */
+ private Point configureSize() {
+ Shell shell = getShell();
+
+ // Get the packed size of the shell.
+ shell.pack();
+ Point size = shell.getSize();
+
+ // Use the previous width if appropriate.
+ if ((previousWidth != NO_REMEMBERED_WIDTH) && (previousWidth > size.x)) {
+ size.x = previousWidth;
+ }
+
+ // Enforce maximum sizing.
+ Shell workbenchWindowShell = (Shell) shell.getParent();
+ if (workbenchWindowShell != null) {
+ Point workbenchWindowSize = workbenchWindowShell.getSize();
+ int maxWidth = workbenchWindowSize.x * 2 / 5;
+ int maxHeight = workbenchWindowSize.y / 2;
+ if (size.x > maxWidth) {
+ size.x = maxWidth;
+ }
+ if (size.y > maxHeight) {
+ size.y = maxHeight;
+ }
+ }
+
+ // Set the size for the shell.
+ shell.setSize(size);
+ return size;
+ }
+
+ /**
+ * Creates the content area for the key assistant. This creates a table and
+ * places it inside the composite. The composite will contain a list of all
+ * the key bindings.
+ *
+ * @param parent
+ * The parent composite to contain the dialog area; must not be
+ * <code>null</code>.
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+
+ // Create a composite for the dialog area.
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout compositeLayout = new GridLayout();
+ compositeLayout.marginHeight = 0;
+ compositeLayout.marginWidth = 0;
+ composite.setLayout(compositeLayout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ composite.setBackground(parent.getBackground());
+
+ // Layout the partial matches.
+ Collection<Binding> bindings;
+ // if we're going to display a list of conflicts or partial matches...
+ if (matches != null) {
+ bindings = matches;
+ }
+ // else just grab the entire list of active bindings
+ else {
+ bindings = getActiveBindings();
+ }
+
+ if (bindings == null || bindings.isEmpty()) {
+ createEmptyDialogArea(composite);
+ } else {
+ createTableDialogArea(composite, bindings);
+ }
+ return composite;
+ }
+
+ /**
+ * Creates an empty dialog area with a simple message saying there were no
+ * matches. This is used if no partial matches could be found. This should
+ * not really ever happen, but might be possible if the commands are
+ * changing while waiting for this dialog to open.
+ *
+ * @param parent
+ * The parent composite for the dialog area; must not be
+ * <code>null</code>.
+ */
+ private void createEmptyDialogArea(Composite parent) {
+ Label noMatchesLabel = new Label(parent, SWT.NULL);
+ noMatchesLabel.setText("No matches"); //$NON-NLS-1$
+ noMatchesLabel.setLayoutData(new GridData(GridData.FILL_BOTH));
+ noMatchesLabel.setBackground(parent.getBackground());
+ }
+
+ /**
+ * Creates a dialog area with a table of the partial matches for the current
+ * key binding state. The table will be either the minimum width, or
+ * <code>previousWidth</code> if it is not <code>NO_REMEMBERED_WIDTH</code>.
+ *
+ * @param parent
+ * The parent composite for the dialog area; must not be
+ * <code>null</code>.
+ * @param partialMatches
+ * The lexicographically sorted map of partial matches for the
+ * current state; must not be <code>null</code> or empty.
+ */
+ private void createTableDialogArea(Composite parent, Collection<Binding> partialMatches) {
+ // Layout the table.
+ completionsTable = new Table(parent, SWT.FULL_SELECTION | SWT.SINGLE);
+ GridData gridData = new GridData(GridData.FILL_BOTH);
+ completionsTable.setLayoutData(gridData);
+ completionsTable.setBackground(parent.getBackground());
+ completionsTable.setLinesVisible(true);
+
+ // Initialize the columns and rows.
+ bindings.clear();
+ TableColumn columnCommandName = new TableColumn(completionsTable, SWT.LEFT, 0);
+ TableColumn columnKeySequence = new TableColumn(completionsTable, SWT.LEFT, 1);
+ Iterator<Binding> itemsItr = partialMatches.iterator();
+ while (itemsItr.hasNext()) {
+ Binding binding = itemsItr.next();
+ String sequence = binding.getTriggerSequence().format();
+ ParameterizedCommand command = binding.getParameterizedCommand();
+ try {
+ String[] text = { command.getName(), sequence };
+ TableItem item = new TableItem(completionsTable, SWT.NULL);
+ item.setText(text);
+ item.setData(BINDING_KEY, binding);
+ bindings.add(binding);
+ } catch (NotDefinedException e) {
+ // Not much to do, but this shouldn't really happen.
+ }
+ }
+
+ Dialog.applyDialogFont(parent);
+ columnKeySequence.pack();
+ if (previousWidth != NO_REMEMBERED_WIDTH) {
+ columnKeySequence.setWidth(previousWidth);
+ }
+ columnCommandName.pack();
+ if (completionsTable.getItems().length > 0) {
+ completionsTable.setSelection(0);
+ }
+
+ /*
+ * If you double-click on the table, it should execute the selected
+ * command.
+ */
+ completionsTable.addListener(SWT.DefaultSelection, new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ executeKeyBinding(event);
+ }
+ });
+ }
+
+ /**
+ * Handles the default selection event on the table of possible completions.
+ * This attempts to execute the given command.
+ */
+ private void executeKeyBinding(Event trigger) {
+ int selectionIndex = completionsTable.getSelectionIndex();
+ // Try to execute the corresponding command.
+ if (selectionIndex >= 0) {
+ close();
+ Binding binding = bindings.get(selectionIndex);
+ try {
+ // workbenchKeyboard.updateShellKludge(null);
+ workbenchKeyboard.executeCommand(binding.getParameterizedCommand(), trigger);
+ } catch (CommandException e) {
+ // WorkbenchPlugin.log(binding.getParameterizedCommand().toString(),
+ // e);
+ // TODO we probably need to log something here.
+ System.err.println(binding.getParameterizedCommand().toString() + " : " + e); //$NON-NLS-1$
+ }
+ }
+ }
+
+ private Collection<Binding> getActiveBindings() {
+
+ EBindingService bindingService = context.getActiveLeaf().get(EBindingService.class);
+
+ Iterator<Binding> iter, matchesIter;
+ Binding binding, bindingToAdd;
+ Collection<Binding> matchesForCommand;
+ Collection<Binding> activeBindings = bindingService.getActiveBindings();
+ Collection<Binding> conflictBindings = bindingService.getAllConflicts();
+ Collection<Binding> sortedMatches = new TreeSet<Binding>(new Comparator<Binding>() {
+ @Override
+ public int compare(Binding binding1, Binding binding2) {
+ ParameterizedCommand cmdA = binding1.getParameterizedCommand();
+ ParameterizedCommand cmdB = binding2.getParameterizedCommand();
+ int result = 0;
+ try {
+ result = cmdA.getName().compareTo(cmdB.getName());
+ } catch (NotDefinedException e) {
+ // whaaa?
+ }
+ return result;
+ }
+ });
+
+ // if the active scheme is not the default scheme then we should clean
+ // up the active
+ // bindings list... if we find multiple bindings for the same command
+ // and they are for
+ // different schemes, then we need to handle which one should be
+ // displayed in the dialog
+ if (activeBindings != null) {
+ iter = activeBindings.iterator();
+ while (iter.hasNext()) {
+ binding = iter.next();
+ matchesForCommand = bindingService.getBindingsFor(binding.getParameterizedCommand());
+ // if there is more than one match, then look for a binding that
+ // does not belong to
+ // the default scheme. If they all belong to the default scheme
+ // or they all do NOT
+ // belong to the default scheme, then arbitrarily choose one
+ if (matchesForCommand != null && matchesForCommand.size() > 1) {
+ bindingToAdd = null;
+
+ matchesIter = matchesForCommand.iterator();
+ while (matchesIter.hasNext()) {
+ bindingToAdd = matchesIter.next();
+ if (!bindingToAdd.getSchemeId().equals(EBindingService.DEFAULT_SCHEME_ID)) {
+ sortedMatches.add(bindingToAdd);
+ break;
+ }
+ }
+ // if they're all the same, arbitrarily choose one
+ if (bindingToAdd != null) {
+ sortedMatches.add(bindingToAdd);
+ }
+ }
+ // if there is only one match, then just add it
+ else if (matchesForCommand != null && matchesForCommand.size() == 1) {
+ sortedMatches.addAll(matchesForCommand);
+ }
+ }
+ }
+ if (conflictBindings != null) {
+ iter = conflictBindings.iterator();
+ while (iter.hasNext()) {
+ binding = iter.next();
+ sortedMatches.add(binding);
+ }
+ }
+ return sortedMatches;
+ }
+
+ /**
+ * Opens this dialog. This method can be called multiple times on the same
+ * dialog. This only opens the dialog if there is no remembered state; if
+ * there is remembered state, then it tries to open the preference page
+ * instead.
+ *
+ * @return The return code from this dialog.
+ */
+ @Override
+ public int open() {
+ // If the dialog is already open, dispose the shell and recreate it.
+ Shell shell = getShell();
+ if (shell != null) {
+ close(false, false);
+ return Window.OK;
+ }
+ create();
+ // Bug 412001. Stop ShellActivationListener from creating a context for
+ // this.
+ getShell().setData("org.eclipse.e4.ui.ignoreDialog", Boolean.TRUE); //$NON-NLS-1$
+
+ // Configure the size and location.
+ Point size = configureSize();
+ configureLocation(size);
+
+ // Call the super method.
+ return super.open();
+ }
+
+ /**
+ * Opens this dialog with the list of bindings for the user to select from.
+ *
+ * @return The return code from this dialog.
+ * @since 3.3
+ */
+ public int open(Collection<Binding> bindings) {
+ matches = new TreeSet<Binding>(new Comparator<Binding>() {
+ @Override
+ public int compare(Binding a, Binding b) {
+ Binding bindingA = a;
+ Binding bindingB = b;
+ ParameterizedCommand commandA = bindingA.getParameterizedCommand();
+ ParameterizedCommand commandB = bindingB.getParameterizedCommand();
+ try {
+ return commandA.getName().compareTo(commandB.getName());
+ } catch (NotDefinedException e) {
+ // should not happen
+ return 0;
+ }
+ }
+ });
+ matches.addAll(bindings);
+
+ // If the dialog is already open, dispose the shell and recreate it.
+ Shell shell = getShell();
+ if (shell != null) {
+ close(false, false);
+ return Window.OK;
+ }
+ create();
+ // Bug 369860. Stop ShellActivationListener from creating a context for
+ // this.
+ getShell().setData("org.eclipse.e4.ui.ignoreDialog", Boolean.TRUE); //$NON-NLS-1$
+ // Configure the size and location.
+ Point size = configureSize();
+ configureLocation(size);
+
+ // Call the super method.
+ return super.open();
+ }
+
+ /**
+ * Exposing this within the keys package.
+ *
+ * @param newParentShell
+ * The new parent shell; this value may be <code>null</code> if
+ * there is to be no parent.
+ */
+ @Override
+ public void setParentShell(Shell newParentShell) {
+ super.setParentShell(newParentShell);
+ }
+
+ /**
+ * Returns the currently selected binding from the table if the table is not
+ * disposed
+ *
+ * @return the currently selected binding or <code>null</code>
+ */
+ protected Binding getSelectedBinding() {
+ if ((completionsTable != null) && (!completionsTable.isDisposed())) {
+ int selectedIndex = completionsTable.getSelectionIndex();
+ if (selectedIndex != -1) {
+ TableItem selectedItem = completionsTable.getItem(selectedIndex);
+ return (Binding) selectedItem.getData(BINDING_KEY);
+ }
+ }
+ return null;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/KeyBindingDispatcher.java b/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/KeyBindingDispatcher.java
new file mode 100644
index 0000000000..beaa383e86
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/KeyBindingDispatcher.java
@@ -0,0 +1,617 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.bindings.keys;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import javax.inject.Inject;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.CommandException;
+import org.eclipse.e4.core.commands.EHandlerService;
+import org.eclipse.e4.core.commands.internal.HandlerServiceImpl;
+import org.eclipse.e4.core.contexts.EclipseContextFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.services.log.Logger;
+import org.eclipse.e4.ui.bindings.EBindingService;
+import org.eclipse.e4.ui.bindings.internal.KeyAssistDialog;
+import org.eclipse.jface.bindings.Binding;
+import org.eclipse.jface.bindings.keys.KeySequence;
+import org.eclipse.jface.bindings.keys.KeyStroke;
+import org.eclipse.jface.bindings.keys.ParseException;
+import org.eclipse.jface.bindings.keys.SWTKeySupport;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.custom.CCombo;
+//TODO RAP unsupported import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * <p>
+ * Controls the keyboard input into the workbench key binding architecture. This allows key events
+ * to be programmatically pushed into the key binding architecture -- potentially triggering the
+ * execution of commands. It is used by the <code>e4 Workbench</code> to listen for events on the
+ * <code>Display</code>.
+ * </p>
+ */
+public class KeyBindingDispatcher {
+
+ private KeyAssistDialog keyAssistDialog = null;
+
+ /**
+ * A display filter for handling key bindings. This filter can either be enabled or disabled. If
+ * disabled, the filter does not process incoming events. The filter starts enabled.
+ *
+ * @since 3.1
+ */
+ public final class KeyDownFilter implements Listener {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ /**
+ * Whether the filter is enabled.
+ */
+ private transient boolean enabled = true;
+
+ /**
+ * Handles an incoming traverse or key down event.
+ *
+ * @param event
+ * The event to process; must not be <code>null</code>.
+ */
+ @Override
+ public final void handleEvent(final Event event) {
+ if (!enabled) {
+ return;
+ }
+
+ filterKeySequenceBindings(event);
+ }
+
+ /**
+ * Returns whether the key binding filter is enabled.
+ *
+ * @return Whether the key filter is enabled.
+ */
+ public final boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * Sets whether this filter should be enabled or disabled.
+ *
+ * @param enabled
+ * Whether key binding filter should be enabled.
+ */
+ public final void setEnabled(final boolean enabled) {
+ this.enabled = enabled;
+ }
+ }
+
+ /** The collection of keys that are to be processed out-of-order. */
+ static KeySequence outOfOrderKeys;
+
+ static {
+
+ try {
+ outOfOrderKeys = KeySequence.getInstance("ESC DEL"); //$NON-NLS-1$
+ } catch (ParseException e) {
+ outOfOrderKeys = KeySequence.getInstance();
+ // String message = "Could not parse out-of-order keys definition: 'ESC DEL'. Continuing with no out-of-order keys."; //$NON-NLS-1$
+ // TODO we need to do some logging here
+ }
+ }
+
+ /**
+ * Generates any key strokes that are near matches to the given event. The first such key stroke
+ * is always the exactly matching key stroke.
+ *
+ * @param event
+ * The event from which the key strokes should be generated; must not be
+ * <code>null</code>.
+ * @return The set of nearly matching key strokes. It is never <code>null</code>, but may be
+ * empty.
+ */
+ public static List<KeyStroke> generatePossibleKeyStrokes(Event event) {
+ final List<KeyStroke> keyStrokes = new ArrayList<KeyStroke>(3);
+
+ /*
+ * If this is not a keyboard event, then there are no key strokes. This can happen if we are
+ * listening to focus traversal events.
+ */
+ if ((event.stateMask == 0) && (event.keyCode == 0) && (event.character == 0)) {
+ return keyStrokes;
+ }
+
+ // Add each unique key stroke to the list for consideration.
+ final int firstAccelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(event);
+ keyStrokes.add(SWTKeySupport.convertAcceleratorToKeyStroke(firstAccelerator));
+
+ // We shouldn't allow delete to undergo shift resolution.
+ if (event.character == SWT.DEL) {
+ return keyStrokes;
+ }
+
+ final int secondAccelerator = SWTKeySupport
+ .convertEventToUnshiftedModifiedAccelerator(event);
+ if (secondAccelerator != firstAccelerator) {
+ keyStrokes.add(SWTKeySupport.convertAcceleratorToKeyStroke(secondAccelerator));
+ }
+
+ final int thirdAccelerator = SWTKeySupport.convertEventToModifiedAccelerator(event);
+ if ((thirdAccelerator != secondAccelerator) && (thirdAccelerator != firstAccelerator)) {
+ keyStrokes.add(SWTKeySupport.convertAcceleratorToKeyStroke(thirdAccelerator));
+ }
+
+ return keyStrokes;
+ }
+
+ /**
+ * <p>
+ * Determines whether the given event represents a key press that should be handled as an
+ * out-of-order event. An out-of-order key press is one that is passed to the focus control
+ * first. Only if the focus control fails to respond will the regular key bindings get applied.
+ * </p>
+ * <p>
+ * Care must be taken in choosing which keys are chosen as out-of-order keys. This method has
+ * only been designed and test to work with the unmodified "Escape" key stroke.
+ * </p>
+ *
+ * @param keyStrokes
+ * The key stroke in which to look for out-of-order keys; must not be
+ * <code>null</code>.
+ * @return <code>true</code> if the key is an out-of-order key; <code>false</code> otherwise.
+ */
+ private static boolean isOutOfOrderKey(List<KeyStroke> keyStrokes) {
+ // Compare to see if one of the possible key strokes is out of order.
+ final KeyStroke[] outOfOrderKeyStrokes = outOfOrderKeys.getKeyStrokes();
+ final int outOfOrderKeyStrokesLength = outOfOrderKeyStrokes.length;
+ for (int i = 0; i < outOfOrderKeyStrokesLength; i++) {
+ if (keyStrokes.contains(outOfOrderKeyStrokes[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * The time in milliseconds to wait after pressing a key before displaying the key assist
+ * dialog.
+ */
+ private static final int DELAY = 1000;
+
+ private EBindingService bindingService;
+
+ private IEclipseContext context;
+
+ private EHandlerService handlerService;
+
+ /**
+ * The listener that runs key events past the global key bindings.
+ */
+ private final KeyDownFilter keyDownFilter = new KeyDownFilter();
+
+ /**
+ * The single out-of-order listener used by the workbench. This listener is attached to one
+ * widget at a time, and is used to catch key down events after all processing is done. This
+ * technique is used so that some keys will have their native behaviour happen first.
+ *
+ * @since 3.1
+ */
+ private final OutOfOrderListener outOfOrderListener = new OutOfOrderListener(this);
+
+ // TODO RAP unsupported
+ // /**
+ // * The single out-of-order verify listener used by the workbench. This listener is attached to
+ // * one</code> StyledText</code> at a time, and is used to catch verify events after all
+ // * processing is done. This technique is used so that some keys will have their native
+ // behaviour
+ // * happen first.
+ // *
+ // * @since 3.1
+ // */
+ // private final OutOfOrderVerifyListener outOfOrderVerifyListener = new
+ // OutOfOrderVerifyListener(
+ // outOfOrderListener);
+
+ /**
+ * The mode is the current state of the key binding architecture. In the case of multi-stroke
+ * key bindings, this can be a partially complete key binding.
+ */
+ private KeySequence state = KeySequence.getInstance();
+
+ private long startTime;
+
+ @Inject
+ @Optional
+ private Logger logger;
+
+ /**
+ * Performs the actual execution of the command by looking up the current handler from the
+ * command manager. If there is a handler and it is enabled, then it tries the actual execution.
+ * Execution failures are logged. When this method completes, the key binding state is reset.
+ *
+ * @param parameterizedCommand
+ * The command that should be executed; should not be <code>null</code>.
+ * @param trigger
+ * The triggering event; may be <code>null</code>.
+ * @return <code>true</code> if there was a handler; <code>false</code> otherwise.
+ * @throws CommandException
+ * if the handler does not complete execution for some reason. It is up to the
+ * caller of this method to decide whether to log the message, display a dialog, or
+ * ignore this exception entirely.
+ */
+ public final boolean executeCommand(final ParameterizedCommand parameterizedCommand,
+ final Event trigger) throws CommandException {
+
+ // Reset the key binding state (close window, clear status line, etc.)
+ resetState(false);
+
+ final EHandlerService handlerService = getHandlerService();
+ final Command command = parameterizedCommand.getCommand();
+
+ final IEclipseContext staticContext = EclipseContextFactory.create("keys-staticContext"); //$NON-NLS-1$
+ staticContext.set(Event.class, trigger);
+
+ final boolean commandDefined = command.isDefined();
+ // boolean commandEnabled;
+ boolean commandHandled = false;
+
+ try {
+ // commandEnabled = handlerService.canExecute(parameterizedCommand, staticContext);
+ Object obj = HandlerServiceImpl.lookUpHandler(context, command.getId());
+ if (obj != null) {
+ if (obj instanceof IHandler) {
+ commandHandled = ((IHandler) obj).isHandled();
+ } else {
+ commandHandled = true;
+ }
+ }
+
+ handlerService.executeHandler(parameterizedCommand, staticContext);
+ final Object commandException = staticContext.get(HandlerServiceImpl.HANDLER_EXCEPTION);
+ if (commandException instanceof CommandException) {
+ commandHandled = false;
+ if (logger != null && commandException instanceof ExecutionException) {
+ logger.error((Throwable) commandException);
+ }
+ }
+ /*
+ * Now that the command has executed (and had the opportunity to use the remembered
+ * state of the dialog), it is safe to delete that information.
+ */
+ if (keyAssistDialog != null) {
+ keyAssistDialog.clearRememberedState();
+ }
+ } finally {
+ staticContext.dispose();
+ }
+ return (commandDefined && commandHandled);
+ }
+
+ /**
+ * <p>
+ * Launches the command matching a the typed key. This filter an incoming
+ * <code>SWT.KeyDown</code> or <code>SWT.Traverse</code> event at the level of the display
+ * (i.e., before it reaches the widgets). It does not allow processing in a dialog or if the key
+ * strokes does not contain a natural key.
+ * </p>
+ * <p>
+ * Some key strokes (defined as a property) are declared as out-of-order keys. This means that
+ * they are processed by the widget <em>first</em>. Only if the other widget listeners do no
+ * useful work does it try to process key bindings. For example, "ESC" can cancel the current
+ * widget action, if there is one, without triggering key bindings.
+ * </p>
+ *
+ * @param event
+ * The incoming event; must not be <code>null</code>.
+ */
+ private void filterKeySequenceBindings(Event event) {
+ /*
+ * Only process key strokes containing natural keys to trigger key bindings.
+ */
+ if ((event.keyCode & SWT.MODIFIER_MASK) != 0) {
+ return;
+ }
+
+ // Allow special key out-of-order processing.
+ List<KeyStroke> keyStrokes = generatePossibleKeyStrokes(event);
+ if (isOutOfOrderKey(keyStrokes)) {
+ Widget widget = event.widget;
+ if ((event.character == SWT.DEL)
+ && ((event.stateMask & SWT.MODIFIER_MASK) == 0)
+ && ((widget instanceof Text) || (widget instanceof Combo)
+ || (widget instanceof Browser) || (widget instanceof CCombo))) {
+ /*
+ * KLUDGE. Bug 54654. The text widget relies on no listener doing any work before
+ * dispatching the native delete event. This does not work, as we are restricted to
+ * listeners. However, it can be said that pressing a delete key in a text widget
+ * will never use key bindings. This can be shown be considering how the event
+ * dispatching is expected to work in a text widget. So, we should do nothing ...
+ * ever.
+ */
+ return;
+ // TODO RAP unsupported
+ // } else if (widget instanceof StyledText) {
+ //
+ // if (event.type == SWT.KeyDown) {
+ // /*
+ // * KLUDGE. Some people try to do useful work in verify listeners. The way verify
+ // * listeners work in SWT, we need to verify the key as well; otherwise, we can't
+ // * detect that useful work has been done.
+ // */
+ // if (!outOfOrderVerifyListener.isActive(event.time)) {
+ // ((StyledText) widget).addVerifyKeyListener(outOfOrderVerifyListener);
+ // outOfOrderVerifyListener.setActive(event.time);
+ // }
+ // }
+ //
+ } else {
+ if (!outOfOrderListener.isActive(event.time)) {
+ widget.addListener(SWT.KeyDown, outOfOrderListener);
+ outOfOrderListener.setActive(event.time);
+ }
+ }
+
+ /*
+ * Otherwise, we count on a key down arriving eventually. Expecting out of order
+ * handling on Ctrl+Tab, for example, is a bad idea (stick to keys that are not window
+ * traversal keys).
+ */
+
+ } else {
+ processKeyEvent(keyStrokes, event);
+ }
+ }
+
+ private EBindingService getBindingService() {
+ if (bindingService == null) {
+ bindingService = (EBindingService) context.get(EBindingService.class.getName());
+ }
+ return bindingService;
+ }
+
+ private EHandlerService getHandlerService() {
+ if (handlerService == null) {
+ handlerService = (EHandlerService) context.get(EHandlerService.class.getName());
+ }
+ return handlerService;
+ }
+
+ private Display getDisplay() {
+ return Display.getCurrent();
+ }
+
+ /**
+ * An accessor for the filter that processes key down and traverse events on the display.
+ *
+ * @return The global key down and traverse filter; never <code>null</code>.
+ */
+ public KeyDownFilter getKeyDownFilter() {
+ return keyDownFilter;
+ }
+
+ /**
+ * Determines whether the key sequence is a perfect match for any command. If there is a match,
+ * then the corresponding command identifier is returned.
+ *
+ * @param keySequence
+ * The key sequence to check for a match; must never be <code>null</code>.
+ * @return The perfectly matching command; <code>null</code> if no command matches.
+ */
+ private ParameterizedCommand getPerfectMatch(KeySequence keySequence) {
+ Binding perfectMatch = getBindingService().getPerfectMatch(keySequence);
+ return perfectMatch == null ? null : perfectMatch.getParameterizedCommand();
+ }
+
+ /**
+ * Changes the key binding state to the given value. This should be an incremental change, but
+ * there are no checks to guarantee this is so. It also sets up a <code>Shell</code> to be
+ * displayed after one second has elapsed. This shell will show the user the possible
+ * completions for what they have typed.
+ *
+ * @param sequence
+ * The new key sequence for the state; should not be <code>null</code>.
+ */
+ private void incrementState(final KeySequence sequence) {
+ state = sequence;
+ // Record the starting time.
+ startTime = System.currentTimeMillis();
+ final long myStartTime = startTime;
+ final Display display = getDisplay();
+ display.timerExec(DELAY, new Runnable() {
+ @Override
+ public void run() {
+ if ((System.currentTimeMillis() > (myStartTime - DELAY))
+ && (startTime == myStartTime)) {
+ Collection<Binding> partialMatches = bindingService.getPartialMatches(sequence);
+ openKeyAssistShell(partialMatches);
+ }
+ }
+ });
+
+ }
+
+ /**
+ * Opens a <code>KeyAssistDialog</code> to assist the user in completing a multi-stroke key
+ * binding. This method lazily creates a <code>keyAssistDialog</code> and shares it between
+ * executions.
+ */
+ private final void openKeyAssistShell(final Collection<Binding> bindings) {
+ if (keyAssistDialog == null) {
+ keyAssistDialog = new KeyAssistDialog(context, this);
+ }
+ if (keyAssistDialog.getShell() == null) {
+ keyAssistDialog.setParentShell(getDisplay().getActiveShell());
+ }
+ keyAssistDialog.open(bindings);
+ }
+
+ /**
+ * Determines whether the key sequence partially matches on of the active key bindings.
+ *
+ * @param keySequence
+ * The key sequence to check for a partial match; must never be <code>null</code>.
+ * @return <code>true</code> if there is a partial match; <code>false</code> otherwise.
+ */
+ private boolean isPartialMatch(KeySequence keySequence) {
+ return getBindingService().isPartialMatch(keySequence);
+ }
+
+ /**
+ * Determines whether the key sequence perfectly matches on of the active key bindings.
+ *
+ * @param keySequence
+ * The key sequence to check for a perfect match; must never be <code>null</code>.
+ * @return <code>true</code> if there is a perfect match; <code>false</code> otherwise.
+ */
+ private boolean isPerfectMatch(KeySequence keySequence) {
+ return getBindingService().isPerfectMatch(keySequence);
+ }
+
+ /**
+ * @param potentialKeyStrokes
+ * @param event
+ * @return
+ */
+ public boolean press(List<KeyStroke> potentialKeyStrokes, Event event) {
+ KeySequence errorSequence = null;
+ Collection<Binding> errorMatch = null;
+
+ KeySequence sequenceBeforeKeyStroke = state;
+ for (Iterator<KeyStroke> iterator = potentialKeyStrokes.iterator(); iterator.hasNext();) {
+ KeySequence sequenceAfterKeyStroke = KeySequence.getInstance(sequenceBeforeKeyStroke,
+ iterator.next());
+ if (isPartialMatch(sequenceAfterKeyStroke)) {
+ incrementState(sequenceAfterKeyStroke);
+ return true;
+
+ } else if (isPerfectMatch(sequenceAfterKeyStroke)) {
+ final ParameterizedCommand cmd = getPerfectMatch(sequenceAfterKeyStroke);
+ try {
+ return executeCommand(cmd, event) || !sequenceBeforeKeyStroke.isEmpty();
+ } catch (final CommandException e) {
+ return true;
+ }
+
+ } else if ((keyAssistDialog != null)
+ && (keyAssistDialog.getShell() != null)
+ && ((event.keyCode == SWT.ARROW_DOWN) || (event.keyCode == SWT.ARROW_UP)
+ || (event.keyCode == SWT.ARROW_LEFT)
+ || (event.keyCode == SWT.ARROW_RIGHT) || (event.keyCode == SWT.CR)
+ || (event.keyCode == SWT.PAGE_UP) || (event.keyCode == SWT.PAGE_DOWN))) {
+ // We don't want to swallow keyboard navigation keys.
+ return false;
+
+ } else {
+ Collection<Binding> matches = getBindingService().getConflictsFor(
+ sequenceAfterKeyStroke);
+ if (matches != null && !matches.isEmpty()) {
+ errorSequence = sequenceAfterKeyStroke;
+ errorMatch = matches;
+ }
+ }
+ }
+ resetState(true);
+ if (sequenceBeforeKeyStroke.isEmpty() && errorSequence != null) {
+ openKeyAssistShell(errorMatch);
+ }
+ return !sequenceBeforeKeyStroke.isEmpty();
+ }
+
+ /**
+ * <p>
+ * Actually performs the processing of the key event by interacting with the
+ * <code>ICommandManager</code>. If work is carried out, then the event is stopped here (i.e.,
+ * <code>event.doit = false</code>). It does not do any processing if there are no matching key
+ * strokes.
+ * </p>
+ * <p>
+ * If the active <code>Shell</code> is not the same as the one to which the state is associated,
+ * then a reset occurs.
+ * </p>
+ *
+ * @param keyStrokes
+ * The set of all possible matching key strokes; must not be <code>null</code>.
+ * @param event
+ * The event to process; must not be <code>null</code>.
+ */
+ void processKeyEvent(List<KeyStroke> keyStrokes, Event event) {
+ // Dispatch the keyboard shortcut, if any.
+ boolean eatKey = false;
+ if (!keyStrokes.isEmpty()) {
+ eatKey = press(keyStrokes, event);
+ }
+
+ if (eatKey) {
+ switch (event.type) {
+ case SWT.KeyDown:
+ event.doit = false;
+ break;
+ case SWT.Traverse:
+ event.detail = SWT.TRAVERSE_NONE;
+ event.doit = true;
+ break;
+ default:
+ }
+ event.type = SWT.NONE;
+ }
+ }
+
+ public void resetState() {
+ resetState(true);
+ }
+
+ private void resetState(boolean clearRememberedState) {
+ startTime = Long.MAX_VALUE;
+ state = KeySequence.getInstance();
+ closeMultiKeyAssistShell();
+ if (keyAssistDialog != null && clearRememberedState) {
+ keyAssistDialog.clearRememberedState();
+ }
+ }
+
+ final public KeySequence getBuffer() {
+ return state;
+ }
+
+ @Inject
+ public void setContext(IEclipseContext context) {
+ this.context = context;
+ }
+
+ /**
+ * Closes the multi-stroke key binding assistant shell, if it exists and isn't already disposed.
+ */
+ private void closeMultiKeyAssistShell() {
+ if (keyAssistDialog != null) {
+ final Shell shell = keyAssistDialog.getShell();
+ if ((shell != null) && (!shell.isDisposed()) && (shell.isVisible())) {
+ keyAssistDialog.close(true);
+ }
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/OutOfOrderListener.java b/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/OutOfOrderListener.java
new file mode 100644
index 0000000000..b24f427f7f
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/OutOfOrderListener.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.ui.bindings.keys;
+
+import java.util.List;
+import org.eclipse.jface.bindings.keys.KeyStroke;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * A listener that makes sure that global key bindings are processed if no other listeners do any
+ * useful work.
+ *
+ * @since 3.0
+ */
+final class OutOfOrderListener implements Listener {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The time at which this listener was last registered to an event. This is the
+ * <code>event.time</code> value.
+ *
+ * @since 3.1
+ */
+ private int active = Integer.MIN_VALUE;
+
+ /**
+ * The keyboard interface to which the event should be passed if it is not eaten.
+ */
+ private final KeyBindingDispatcher keyboard;
+
+ /**
+ * Constructs a new instance of <code>OutOfOrderListener</code> with a reference to the keyboard
+ * interface which should be allowed to process uneaten events.
+ *
+ * @param workbenchKeyboard
+ * The keyboard interface for the workbench capable of processing key bindings; must
+ * not be <code>null</code>.
+ */
+ public OutOfOrderListener(KeyBindingDispatcher workbenchKeyboard) {
+ keyboard = workbenchKeyboard;
+ }
+
+ /**
+ * Handles the key down event on a widget by passing uneaten events to the key binding
+ * architecture. This is used to allow special keys to reach the widget first -- before being
+ * processed by the key binding architecture.
+ *
+ * @param event
+ * The event to process; must not be <code>null</code>
+ */
+ @Override
+ public void handleEvent(Event event) {
+ // Always remove myself as a listener.
+ final Widget widget = event.widget;
+ if ((widget != null) && (!widget.isDisposed())) {
+ widget.removeListener(event.type, this);
+ }
+
+ /*
+ * If the event is still up for grabs, then re-route through the global key filter.
+ */
+ if (event.doit) {
+ List<KeyStroke> keyStrokes = KeyBindingDispatcher.generatePossibleKeyStrokes(event);
+ keyboard.processKeyEvent(keyStrokes, event);
+ }
+ }
+
+ /**
+ * Returns whether this listener has been hooked by this event already.
+ *
+ * @param timeRegistered
+ * The <code>event.time</code> for the current event.
+ * @return <code>true</code> if this listener is registered for a different event;
+ * <code>false</code> otherwise.
+ *
+ * @since 3.1
+ */
+ final boolean isActive(final int timeRegistered) {
+ return (active == timeRegistered);
+ }
+
+ /**
+ * Sets the event time at which this listener was last registered with a widget.
+ *
+ * @param timeRegistered
+ * The time at which this listener was last registered with a widget.
+ *
+ * @since 3.1
+ */
+ final void setActive(final int timeRegistered) {
+ active = timeRegistered;
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/OutOfOrderVerifyListener.java b/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/OutOfOrderVerifyListener.java
new file mode 100644
index 0000000000..5c7d397c35
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src-rap/org/eclipse/e4/ui/bindings/keys/OutOfOrderVerifyListener.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.ui.bindings.keys;
+
+//TODO RAP unsupported
+//import org.eclipse.swt.custom.StyledText;
+//import org.eclipse.swt.custom.VerifyKeyListener;
+
+/**
+ * A listener that makes sure that out-of-order processing occurs if no other verify listeners do
+ * any work.
+ *
+ * @since 3.0
+ */
+// TODO RAP unsupported
+final class OutOfOrderVerifyListener /* implements VerifyKeyListener */{
+ //
+ // /**
+ // * The time at which this listener was last registered to an event. This is the
+ // * <code>event.time</code> value.
+ // *
+ // * @since 3.1
+ // */
+ // private int active = Integer.MIN_VALUE;
+ //
+ // /**
+ // * The listener that will be chained in if the verify event has not been eaten yet.
+ // */
+ // private OutOfOrderListener chainedListener;
+ //
+ // /**
+ // * Constructs a new instance of <code>OutOfOrderVerifyListener</code> with the listener that
+ // * will be chained in.
+ // *
+ // * @param outOfOrderListener
+ // * The listener that should be attached to the widget if the verify event is not
+ // * eaten; must not be <code>null</code>.
+ // */
+ // OutOfOrderVerifyListener(OutOfOrderListener outOfOrderListener) {
+ // chainedListener = outOfOrderListener;
+ // }
+ //
+ // /**
+ // * Returns whether this listener has been hooked by this event already.
+ // *
+ // * @param timeRegistered
+ // * The <code>event.time</code> for the current event.
+ // * @return <code>true</code> if this listener is registered for a different event;
+ // * <code>false</code> otherwise.
+ // *
+ // * @since 3.1
+ // */
+ // final boolean isActive(final int timeRegistered) {
+ // return (active == timeRegistered);
+ // }
+ //
+ // /**
+ // * Sets the event time at which this listener was last registered with a widget.
+ // *
+ // * @param timeRegistered
+ // * The time at which this listener was last registered with a widget.
+ // *
+ // * @since 3.1
+ // */
+ // final void setActive(final int timeRegistered) {
+ // active = timeRegistered;
+ // }
+ //
+ // /**
+ // * Checks whether any other verify listeners have triggered. If not, then it sets up the
+ // * top-level out-of-order listener.
+ // *
+ // * @param event
+ // * The verify event after it has been processed by all other verify listeners; must
+ // * not be <code>null</code>.
+ // */
+ // public void verifyKey(VerifyEvent event) {
+ // // Always remove the listener.
+ // final Widget widget = event.widget;
+ // if ((widget instanceof StyledText) && (!widget.isDisposed())) {
+ // ((StyledText) widget).removeVerifyKeyListener(this);
+ // }
+ //
+ // /*
+ // * If the event is still up for grabs, then re-route through the global key filter.
+ // */
+ // if (event.doit) {
+ // widget.addListener(SWT.Modify, new CancelOnModifyListener(chainedListener));
+ // widget.addListener(SWT.KeyDown, chainedListener);
+ // }
+ // }
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/BindingServiceAddon.java b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/BindingServiceAddon.java
new file mode 100644
index 0000000000..f182376f4b
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/BindingServiceAddon.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.bindings;
+
+import javax.annotation.PostConstruct;
+import org.eclipse.core.commands.contexts.ContextManager;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.ui.bindings.internal.BindingServiceCreationFunction;
+import org.eclipse.e4.ui.bindings.internal.BindingTableManager;
+import org.eclipse.e4.ui.bindings.internal.ContextSet;
+
+/**
+ * Provide the binding and context id services as an add-on. Must be instantiated against the
+ * application level context.
+ */
+public final class BindingServiceAddon {
+ /**
+ * @param context
+ */
+ @PostConstruct
+ public void init(IEclipseContext context) {
+ ContextManager contextManager = context.get(ContextManager.class);
+ ContextSet.setComparator(new ContextSet.CComp(contextManager));
+
+ context.set(BindingTableManager.class,
+ ContextInjectionFactory.make(BindingTableManager.class, context));
+
+ context.set(EBindingService.class.getName(), new BindingServiceCreationFunction());
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/EBindingService.java b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/EBindingService.java
new file mode 100644
index 0000000000..0440713c58
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/EBindingService.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.ui.bindings;
+
+import java.util.Collection;
+import java.util.Map;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.jface.bindings.Binding;
+import org.eclipse.jface.bindings.TriggerSequence;
+
+/**
+ */
+public interface EBindingService {
+
+ public static final String DIALOG_CONTEXT_ID = "org.eclipse.ui.contexts.dialog"; //$NON-NLS-1$
+ public static final String DEFAULT_SCHEME_ID = "org.eclipse.ui.defaultAcceleratorConfiguration"; //$NON-NLS-1$
+ public static final String MODEL_TO_BINDING_KEY = "binding"; //$NON-NLS-1$
+ public static final String ACTIVE_SCHEME_TAG = "activeSchemeId"; //$NON-NLS-1$
+ public static final String SCHEME_ID_ATTR_TAG = "schemeId"; //$NON-NLS-1$
+ public static final String LOCALE_ATTR_TAG = "locale"; //$NON-NLS-1$
+ public static final String PLATFORM_ATTR_TAG = "platform"; //$NON-NLS-1$
+ public static final String TYPE_ATTR_TAG = "type"; //$NON-NLS-1$
+ public static final String DELETED_BINDING_TAG = "deleted"; //$NON-NLS-1$
+
+ Binding createBinding(TriggerSequence sequence, ParameterizedCommand command, String contextId,
+ Map<String, String> attributes);
+
+ void activateBinding(Binding binding);
+
+ void deactivateBinding(Binding binding);
+
+ TriggerSequence createSequence(String sequence);
+
+ Collection<Binding> getConflictsFor(TriggerSequence sequence);
+
+ Collection<Binding> getAllConflicts();
+
+ Binding getPerfectMatch(TriggerSequence trigger);
+
+ boolean isPartialMatch(TriggerSequence keySequence);
+
+ boolean isPerfectMatch(TriggerSequence sequence);
+
+ TriggerSequence getBestSequenceFor(ParameterizedCommand command);
+
+ Collection<TriggerSequence> getSequencesFor(ParameterizedCommand command);
+
+ Collection<Binding> getPartialMatches(TriggerSequence sequence);
+
+ Collection<Binding> getActiveBindings();
+
+ Collection<Binding> getBindingsFor(ParameterizedCommand cmd);
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingServiceCreationFunction.java b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingServiceCreationFunction.java
new file mode 100644
index 0000000000..5b59259740
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingServiceCreationFunction.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.bindings.internal;
+
+import org.eclipse.e4.core.contexts.ContextFunction;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+
+/**
+ *
+ */
+public class BindingServiceCreationFunction extends ContextFunction {
+
+ @Override
+ public Object compute(IEclipseContext context, String contextKey) {
+ return ContextInjectionFactory.make(BindingServiceImpl.class, context);
+ }
+
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingServiceImpl.java b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingServiceImpl.java
new file mode 100644
index 0000000000..2b0f7f4bc1
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingServiceImpl.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.bindings.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.contexts.Context;
+import org.eclipse.core.commands.contexts.ContextManager;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.bindings.EBindingService;
+import org.eclipse.jface.bindings.Binding;
+import org.eclipse.jface.bindings.TriggerSequence;
+import org.eclipse.jface.bindings.keys.KeyBinding;
+import org.eclipse.jface.bindings.keys.KeySequence;
+import org.eclipse.jface.bindings.keys.ParseException;
+
+/**
+ *
+ */
+public class BindingServiceImpl implements EBindingService {
+
+ final static String ACTIVE_CONTEXTS = "activeContexts"; //$NON-NLS-1$
+ final static String USER_TYPE = "user"; //$NON-NLS-1$
+
+ @Inject
+ private IEclipseContext context;
+
+ @Inject
+ private BindingTableManager manager;
+
+ @Inject
+ private ContextManager contextManager;
+
+ private ContextSet contextSet = ContextSet.EMPTY;
+
+ @Override
+ public Binding createBinding(TriggerSequence sequence, ParameterizedCommand command,
+ String contextId, Map<String, String> attributes) {
+
+ String schemeId = DEFAULT_SCHEME_ID;
+ String locale = null;
+ String platform = null;
+ int bindingType = Binding.SYSTEM;
+
+ if (sequence != null && !sequence.isEmpty() && contextId != null) {
+ if (attributes != null) {
+ String tmp = attributes.get(SCHEME_ID_ATTR_TAG);
+ if (tmp != null && tmp.length() > 0) {
+ schemeId = tmp;
+ }
+ locale = attributes.get(LOCALE_ATTR_TAG);
+ platform = attributes.get(PLATFORM_ATTR_TAG);
+ if (USER_TYPE.equals(attributes.get(TYPE_ATTR_TAG))) {
+ bindingType = Binding.USER;
+ }
+ }
+ return new KeyBinding((KeySequence) sequence, command, schemeId, contextId, locale,
+ platform, null, bindingType);
+ }
+ return null;
+ }
+
+ @Override
+ public void activateBinding(Binding binding) {
+ String contextId = binding.getContextId();
+ BindingTable table = manager.getTable(contextId);
+ if (table == null) {
+ return;
+ }
+ table.addBinding(binding);
+ }
+
+ @Override
+ public void deactivateBinding(Binding binding) {
+ String contextId = binding.getContextId();
+ BindingTable table = manager.getTable(contextId);
+ if (table == null) {
+ //System.err.println("No binding table for " + contextId); //$NON-NLS-1$
+ return;
+ }
+ table.removeBinding(binding);
+ }
+
+ @Override
+ public TriggerSequence createSequence(String sequence) {
+ try {
+ return KeySequence.getInstance(sequence);
+ } catch (ParseException e) {
+ // should probably log
+ }
+ return null;
+ }
+
+ @Override
+ public Collection<Binding> getConflictsFor(TriggerSequence sequence) {
+ return manager.getConflictsFor(contextSet, sequence);
+ }
+
+ @Override
+ public Collection<Binding> getAllConflicts() {
+ return manager.getAllConflicts();
+ }
+
+ @Override
+ public Binding getPerfectMatch(TriggerSequence trigger) {
+ return manager.getPerfectMatch(contextSet, trigger);
+ }
+
+ @Override
+ public boolean isPartialMatch(TriggerSequence keySequence) {
+ return manager.isPartialMatch(contextSet, keySequence);
+ }
+
+ @Override
+ public TriggerSequence getBestSequenceFor(ParameterizedCommand command) {
+ Binding binding = manager.getBestSequenceFor(contextSet, command);
+ return binding == null ? null : binding.getTriggerSequence();
+ }
+
+ @Override
+ public Collection<TriggerSequence> getSequencesFor(ParameterizedCommand command) {
+ Collection<Binding> bindings = manager.getSequencesFor(contextSet, command);
+ ArrayList<TriggerSequence> sequences = new ArrayList<TriggerSequence>(bindings.size());
+ for (Binding binding : bindings) {
+ sequences.add(binding.getTriggerSequence());
+ }
+ return sequences;
+ }
+
+ @Override
+ public Collection<Binding> getBindingsFor(ParameterizedCommand command) {
+ return manager.getBindingsFor(contextSet, command);
+ }
+
+ @Override
+ public boolean isPerfectMatch(TriggerSequence sequence) {
+ return getPerfectMatch(sequence) != null;
+ }
+
+ @Override
+ public Collection<Binding> getPartialMatches(TriggerSequence sequence) {
+ return manager.getPartialMatches(contextSet, sequence);
+ }
+
+ /**
+ * @return the context for this service.
+ */
+ public IEclipseContext getContext() {
+ return context;
+ }
+
+ @Inject
+ public void setContextIds(@Named(ACTIVE_CONTEXTS) @Optional Set<String> set) {
+ if (set == null || set.isEmpty() || contextManager == null) {
+ contextSet = ContextSet.EMPTY;
+ return;
+ }
+ ArrayList<Context> contexts = new ArrayList<Context>();
+ for (String id : set) {
+ contexts.add(contextManager.getContext(id));
+ }
+ contextSet = manager.createContextSet(contexts);
+ }
+
+ @Override
+ public Collection<Binding> getActiveBindings() {
+ return manager.getActiveBindings();
+ }
+
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingTable.java b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingTable.java
new file mode 100644
index 0000000000..032cca6a30
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingTable.java
@@ -0,0 +1,347 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.bindings.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.contexts.Context;
+import org.eclipse.jface.bindings.Binding;
+import org.eclipse.jface.bindings.Trigger;
+import org.eclipse.jface.bindings.TriggerSequence;
+import org.eclipse.jface.bindings.keys.IKeyLookup;
+import org.eclipse.jface.bindings.keys.KeyLookupFactory;
+import org.eclipse.jface.bindings.keys.KeyStroke;
+
+/**
+ * manage tables of bindings that can be used to look up commands from keys.
+ */
+public class BindingTable {
+ private static int compareSchemes(String[] activeSchemeIds, final String schemeId1,
+ final String schemeId2) {
+ if (activeSchemeIds == null || activeSchemeIds.length == 0) {
+ return 0;
+ }
+ if (!schemeId2.equals(schemeId1)) {
+ for (int i = 0; i < activeSchemeIds.length; i++) {
+ final String schemePointer = activeSchemeIds[i];
+ if (schemeId2.equals(schemePointer)) {
+ return 1;
+ } else if (schemeId1.equals(schemePointer)) {
+ return -1;
+ }
+ }
+ }
+ return 0;
+ }
+
+ static class BindingComparator implements Comparator<Binding> {
+ private String[] activeSchemeIds;
+
+ public void setActiveSchemes(String[] activeSchemeIds) {
+ this.activeSchemeIds = activeSchemeIds;
+ }
+
+ public String[] getActiveSchemes() {
+ return this.activeSchemeIds;
+ }
+
+ @Override
+ public int compare(Binding o1, Binding o2) {
+ int rc = compareSchemes(activeSchemeIds, o1.getSchemeId(), o2.getSchemeId());
+ if (rc != 0) {
+ return rc;
+ }
+
+ /*
+ * Check to see which has the least number of triggers in the trigger sequence.
+ */
+ final Trigger[] bestTriggers = o1.getTriggerSequence().getTriggers();
+ final Trigger[] currentTriggers = o2.getTriggerSequence().getTriggers();
+ int compareTo = bestTriggers.length - currentTriggers.length;
+ if (compareTo != 0) {
+ return compareTo;
+ }
+
+ /*
+ * Compare the number of keys pressed in each trigger sequence. Some types of keys count
+ * less than others (i.e., some types of modifiers keys are less likely to be chosen).
+ */
+ compareTo = countStrokes(bestTriggers) - countStrokes(currentTriggers);
+ if (compareTo != 0) {
+ return compareTo;
+ }
+
+ // If this is still a tie, then just chose the shortest text.
+ return o1.getTriggerSequence().format().length()
+ - o2.getTriggerSequence().format().length();
+ }
+
+ private final int countStrokes(final Trigger[] triggers) {
+ int strokeCount = triggers.length;
+ for (int i = 0; i < triggers.length; i++) {
+ final Trigger trigger = triggers[i];
+ if (trigger instanceof KeyStroke) {
+ final KeyStroke keyStroke = (KeyStroke) trigger;
+ final int modifierKeys = keyStroke.getModifierKeys();
+ final IKeyLookup lookup = KeyLookupFactory.getDefault();
+ if ((modifierKeys & lookup.getAlt()) != 0) {
+ strokeCount += 8;
+ }
+ if ((modifierKeys & lookup.getCtrl()) != 0) {
+ strokeCount += 2;
+ }
+ if ((modifierKeys & lookup.getShift()) != 0) {
+ strokeCount += 4;
+ }
+ if ((modifierKeys & lookup.getCommand()) != 0) {
+ strokeCount += 2;
+ }
+ } else {
+ strokeCount += 99;
+ }
+ }
+
+ return strokeCount;
+ }
+ }
+
+ public static final BindingComparator BEST_SEQUENCE = new BindingComparator();
+
+ private Context tableId;
+ private ArrayList<Binding> bindings = new ArrayList<Binding>();
+ private Map<TriggerSequence, Binding> bindingsByTrigger = new HashMap<TriggerSequence, Binding>();
+ private Map<ParameterizedCommand, ArrayList<Binding>> bindingsByCommand = new HashMap<ParameterizedCommand, ArrayList<Binding>>();
+ private Map<TriggerSequence, ArrayList<Binding>> bindingsByPrefix = new HashMap<TriggerSequence, ArrayList<Binding>>();
+ private Map<TriggerSequence, ArrayList<Binding>> conflicts = new HashMap<TriggerSequence, ArrayList<Binding>>();
+ private Map<TriggerSequence, ArrayList<Binding>> orderedBindingsByTrigger = new HashMap<TriggerSequence, ArrayList<Binding>>();
+
+ /**
+ * @param context
+ */
+ public BindingTable(Context context) {
+ tableId = context;
+ }
+
+ public Context getTableId() {
+ return tableId;
+ }
+
+ public String getId() {
+ return tableId.getId();
+ }
+
+ public Collection<Binding> getConflicts() {
+ Collection<Binding> conflictsList = new ArrayList<Binding>();
+ for (TriggerSequence key : conflicts.keySet()) {
+ ArrayList<Binding> conflictsForTrigger = conflicts.get(key);
+ if (conflictsForTrigger != null) {
+ conflictsList.addAll(conflictsForTrigger);
+ }
+ }
+ return conflictsList;
+ }
+
+ // checks both the active bindings and conflicts list
+ public Collection<Binding> getConflictsFor(TriggerSequence triggerSequence) {
+ return conflicts.get(triggerSequence);
+ }
+
+ public void addBinding(Binding binding) {
+ if (!getId().equals(binding.getContextId())) {
+ throw new IllegalArgumentException("Binding context " + binding.getContextId() //$NON-NLS-1$
+ + " does not match " + getId()); //$NON-NLS-1$
+ }
+ ArrayList<Binding> bindingList = orderedBindingsByTrigger.get(binding.getTriggerSequence());
+ Binding possibleConflict = bindingsByTrigger.get(binding.getTriggerSequence());
+ if (bindingList == null || bindingList.isEmpty()) {
+ if (possibleConflict != null) {
+ if (bindingList == null) {
+ bindingList = new ArrayList<Binding>();
+ orderedBindingsByTrigger.put(binding.getTriggerSequence(), bindingList);
+ }
+ bindingList.add(binding);
+ bindingList.add(possibleConflict);
+ Collections.sort(bindingList, BEST_SEQUENCE);
+ }
+ } else {
+ bindingList.add(binding);
+ Collections.sort(bindingList, BEST_SEQUENCE);
+ }
+
+ if (possibleConflict != null && bindingList != null && !bindingList.isEmpty()
+ && bindingList.get(0) != possibleConflict) {
+ removeBindingSimple(possibleConflict);
+ possibleConflict = null;
+ }
+
+ evaluateOrderedBindings(binding.getTriggerSequence(), binding);
+ }
+
+ private void addBindingSimple(Binding binding) {
+ bindings.add(binding);
+ bindingsByTrigger.put(binding.getTriggerSequence(), binding);
+
+ ArrayList<Binding> sequences = bindingsByCommand.get(binding.getParameterizedCommand());
+ if (sequences == null) {
+ sequences = new ArrayList<Binding>();
+ bindingsByCommand.put(binding.getParameterizedCommand(), sequences);
+ }
+ sequences.add(binding);
+ Collections.sort(sequences, BEST_SEQUENCE);
+
+ TriggerSequence[] prefs = binding.getTriggerSequence().getPrefixes();
+ for (int i = 1; i < prefs.length; i++) {
+ ArrayList<Binding> bindings = bindingsByPrefix.get(prefs[i]);
+ if (bindings == null) {
+ bindings = new ArrayList<Binding>();
+ bindingsByPrefix.put(prefs[i], bindings);
+ }
+ bindings.add(binding);
+ }
+ }
+
+ private void removeBindingSimple(Binding binding) {
+ bindings.remove(binding);
+ bindingsByTrigger.remove(binding.getTriggerSequence());
+ ArrayList<Binding> sequences = bindingsByCommand.get(binding.getParameterizedCommand());
+
+ if (sequences != null) {
+ sequences.remove(binding);
+ }
+ TriggerSequence[] prefs = binding.getTriggerSequence().getPrefixes();
+ for (int i = 1; i < prefs.length; i++) {
+ ArrayList<Binding> bindings = bindingsByPrefix.get(prefs[i]);
+ if (bindings != null) {
+ bindings.remove(binding);
+ }
+ }
+ }
+
+ public void removeBinding(Binding binding) {
+ if (!getId().equals(binding.getContextId())) {
+ throw new IllegalArgumentException("Binding context " + binding.getContextId() //$NON-NLS-1$
+ + " does not match " + getId()); //$NON-NLS-1$
+ }
+ ArrayList<Binding> bindingList = orderedBindingsByTrigger.get(binding.getTriggerSequence());
+ Binding possibleConflict = bindingsByTrigger.get(binding.getTriggerSequence());
+ if (possibleConflict == binding) {
+ removeBindingSimple(binding);
+ if (bindingList != null) {
+ bindingList.remove(binding);
+ if (bindingList.isEmpty()) {
+ orderedBindingsByTrigger.remove(binding.getTriggerSequence());
+ } else {
+ evaluateOrderedBindings(binding.getTriggerSequence(), null);
+ }
+ }
+ } else if (bindingList != null) {
+ bindingList.remove(binding);
+ if (bindingList.isEmpty()) {
+ orderedBindingsByTrigger.remove(binding.getTriggerSequence());
+ } else {
+ evaluateOrderedBindings(binding.getTriggerSequence(), null);
+ }
+ }
+ }
+
+ /**
+ * @param binding
+ */
+ private void evaluateOrderedBindings(TriggerSequence sequence, Binding binding) {
+ ArrayList<Binding> bindingList = orderedBindingsByTrigger.get(sequence);
+
+ // calculate binding to be used or any conflicts
+ if (bindingList != null) {
+ if (bindingList.isEmpty()) {
+ orderedBindingsByTrigger.remove(sequence);
+ } else if (bindingList.size() > 1) {
+ Binding msb = bindingList.get(0);
+ Binding lsb = bindingList.get(1);
+ int rc = compareSchemes(BEST_SEQUENCE.getActiveSchemes(), msb.getSchemeId(),
+ lsb.getSchemeId());
+ if (rc == 0) {
+ ArrayList<Binding> conflictList = conflicts.get(sequence);
+ if (conflictList == null) {
+ conflictList = new ArrayList<Binding>();
+ conflicts.put(sequence, conflictList);
+ } else {
+ conflictList.clear();
+ }
+ Iterator<Binding> i = bindingList.iterator();
+ Binding prev = i.next();
+ conflictList.add(prev);
+ while (i.hasNext() && rc == 0) {
+ Binding next = i.next();
+ rc = compareSchemes(BEST_SEQUENCE.getActiveSchemes(), prev.getSchemeId(),
+ next.getSchemeId());
+ if (rc == 0) {
+ conflictList.add(next);
+ }
+ prev = next;
+ }
+ } else {
+ conflicts.remove(sequence);
+ if (bindingsByTrigger.get(sequence) == null) {
+ addBindingSimple(msb);
+ }
+ }
+ } else {
+ if (bindingsByTrigger.get(sequence) == null) {
+ addBindingSimple(bindingList.get(0));
+ }
+ orderedBindingsByTrigger.remove(sequence);
+ }
+ } else if (binding != null) {
+ conflicts.remove(sequence);
+ if (bindingsByTrigger.get(sequence) == null) {
+ addBindingSimple(binding);
+ }
+ }
+ }
+
+ public Binding getPerfectMatch(TriggerSequence trigger) {
+ return bindingsByTrigger.get(trigger);
+ }
+
+ public Binding getBestSequenceFor(ParameterizedCommand command) {
+ ArrayList<Binding> sequences = bindingsByCommand.get(command);
+ if (sequences != null && sequences.size() > 0) {
+ return sequences.get(0);
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Collection<Binding> getSequencesFor(ParameterizedCommand command) {
+ ArrayList<Binding> triggers = bindingsByCommand.get(command);
+ return (Collection<Binding>) (triggers == null ? Collections.EMPTY_LIST : triggers.clone());
+ }
+
+ public Collection<Binding> getPartialMatches(TriggerSequence sequence) {
+ return bindingsByPrefix.get(sequence);
+ }
+
+ public boolean isPartialMatch(TriggerSequence seq) {
+ return bindingsByPrefix.get(seq) != null;
+ }
+
+ public Collection<Binding> getBindings() {
+ return Collections.unmodifiableCollection(bindings);
+ }
+
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingTableManager.java b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingTableManager.java
new file mode 100644
index 0000000000..bdb5a29659
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingTableManager.java
@@ -0,0 +1,266 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.bindings.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.ListIterator;
+import javax.inject.Inject;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.contexts.Context;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.jface.bindings.Binding;
+import org.eclipse.jface.bindings.TriggerSequence;
+
+/**
+ * manage tables of bindings that can be used to look up commands from keys.
+ */
+public class BindingTableManager {
+ private static final String BINDING_TABLE_PREFIX = "bindingTable:"; //$NON-NLS-1$
+
+ @Inject
+ private IEclipseContext eclipseContext;
+
+ private ContextSet definedTables = ContextSet.EMPTY;
+
+ private String[] activeSchemeIds;
+
+ public void addTable(BindingTable table) {
+ String contextId = getTableId(table.getId());
+ if (eclipseContext.containsKey(contextId)) {
+ return; // it's already there
+ // throw new IllegalArgumentException("Already contains table " +
+ // contextId); //$NON-NLS-1$
+ }
+ eclipseContext.set(contextId, table);
+ final List<Context> contexts = definedTables.getContexts();
+ if (!contexts.contains(table.getTableId())) {
+ // this is only valid because I'm throwing away the old
+ // definedTables contextSet
+ contexts.add(table.getTableId());
+ definedTables = createContextSet(contexts);
+ }
+ }
+
+ private String getTableId(String id) {
+ return BINDING_TABLE_PREFIX + id;
+ }
+
+ public void removeTable(BindingTable table) {
+ String contextId = getTableId(table.getId());
+ if (!eclipseContext.containsKey(contextId)) {
+ throw new IllegalArgumentException("Does not contains table " + contextId); //$NON-NLS-1$
+ }
+ eclipseContext.remove(contextId);
+ final List<Context> contexts = definedTables.getContexts();
+ if (contexts.contains(table.getTableId())) {
+ // this is only valid because I'm throwing away the old
+ // definedTables contextSet
+ contexts.remove(table.getTableId());
+ definedTables = createContextSet(contexts);
+ }
+ }
+
+ public BindingTable getTable(String id) {
+ return (BindingTable) eclipseContext.get(getTableId(id));
+ }
+
+ // we're just going through each binding table, and returning a
+ // flat list of bindings here
+ public Collection<Binding> getActiveBindings() {
+ ArrayList<Binding> bindings = new ArrayList<Binding>();
+ for (Context ctx : definedTables.getContexts()) {
+ BindingTable table = getTable(ctx.getId());
+ if (table != null) {
+ bindings.addAll(table.getBindings());
+ }
+ }
+ return bindings;
+ }
+
+ public ContextSet createContextSet(Collection<Context> contexts) {
+ return new ContextSet(contexts);
+ }
+
+ public Collection<Binding> getConflictsFor(ContextSet contextSet, TriggerSequence triggerSequence) {
+ Collection<Binding> matches = new ArrayList<Binding>();
+ for (Context ctx : contextSet.getContexts()) {
+ BindingTable table = getTable(ctx.getId());
+ if (table != null) {
+ final Collection<Binding> matchesFor = table.getConflictsFor(triggerSequence);
+ if (matchesFor != null) {
+ matches.addAll(matchesFor);
+ }
+ }
+ }
+ return matches.size() == 0 ? null : matches;
+ }
+
+ public Collection<Binding> getAllConflicts() {
+ Collection<Binding> conflictsList = new ArrayList<Binding>();
+ for (Context ctx : definedTables.getContexts()) {
+ BindingTable table = getTable(ctx.getId());
+ if (table != null) {
+ Collection<Binding> conflictsInTable = table.getConflicts();
+ if (conflictsInTable != null) {
+ conflictsList.addAll(conflictsInTable);
+ }
+ }
+ }
+ return conflictsList;
+ }
+
+ public Binding getPerfectMatch(ContextSet contextSet, TriggerSequence triggerSequence) {
+ Binding result = null;
+ Binding currentResult = null;
+ List<Context> contexts = contextSet.getContexts();
+ ListIterator<Context> it = contexts.listIterator(contexts.size());
+ while (it.hasPrevious()) {
+ Context c = it.previous();
+ BindingTable table = getTable(c.getId());
+ if (table != null) {
+ currentResult = table.getPerfectMatch(triggerSequence);
+ }
+ if (currentResult != null) {
+ if (isMostActiveScheme(currentResult)) {
+ return currentResult;
+ }
+ if (result == null) {
+ result = currentResult;
+ } else {
+ int rc = compareSchemes(result.getSchemeId(), currentResult.getSchemeId());
+ if (rc < 0) {
+ result = currentResult;
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @param currentResult
+ * @return
+ */
+ private boolean isMostActiveScheme(Binding currentResult) {
+ if (activeSchemeIds == null || activeSchemeIds.length < 2) {
+ return true;
+ }
+ final String mostActive = activeSchemeIds[0];
+ return mostActive == null ? false : mostActive.equals(currentResult.getSchemeId());
+ }
+
+ public Binding getBestSequenceFor(ContextSet contextSet, ParameterizedCommand parameterizedCommand) {
+ ArrayList<Binding> bindings = (ArrayList<Binding>) getSequencesFor(contextSet, parameterizedCommand);
+ if (bindings.size() == 0) {
+ return null;
+ }
+ return bindings.get(0);
+ }
+
+ public Collection<Binding> getSequencesFor(ContextSet contextSet, ParameterizedCommand parameterizedCommand) {
+ ArrayList<Binding> bindings = new ArrayList<Binding>();
+ List<Context> contexts = contextSet.getContexts();
+ ListIterator<Context> it = contexts.listIterator(contexts.size());
+ while (it.hasPrevious()) {
+ Context c = it.previous();
+ BindingTable table = getTable(c.getId());
+ if (table != null) {
+ Collection<Binding> sequences = table.getSequencesFor(parameterizedCommand);
+ if (sequences != null) {
+ bindings.addAll(sequences);
+ }
+ }
+ }
+ Collections.sort(bindings, BindingTable.BEST_SEQUENCE);
+ return bindings;
+ }
+
+ public Collection<Binding> getBindingsFor(ContextSet contextSet, ParameterizedCommand cmd) {
+ Collection<Binding> bindings = new ArrayList<Binding>();
+ for (Context ctx : contextSet.getContexts()) {
+ BindingTable table = getTable(ctx.getId());
+ if (table != null) {
+ Collection<Binding> matches = table.getSequencesFor(cmd);
+ if (matches != null) {
+ bindings.addAll(matches);
+ }
+ }
+ }
+ return bindings;
+ }
+
+ public boolean isPartialMatch(ContextSet contextSet, TriggerSequence sequence) {
+ List<Context> contexts = contextSet.getContexts();
+ ListIterator<Context> it = contexts.listIterator(contexts.size());
+ while (it.hasPrevious()) {
+ Context c = it.previous();
+ BindingTable table = getTable(c.getId());
+ if (table != null) {
+ if (table.isPartialMatch(sequence)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public Collection<Binding> getPartialMatches(ContextSet contextSet, TriggerSequence sequence) {
+ ArrayList<Binding> bindings = new ArrayList<Binding>();
+ List<Context> contexts = contextSet.getContexts();
+ ListIterator<Context> it = contexts.listIterator(contexts.size());
+ while (it.hasPrevious()) {
+ Context c = it.previous();
+ BindingTable table = getTable(c.getId());
+ if (table != null) {
+ Collection<Binding> partialMatches = table.getPartialMatches(sequence);
+ if (partialMatches != null) {
+ bindings.addAll(partialMatches);
+ }
+ }
+ }
+ return bindings;
+ }
+
+ /**
+ * @param activeSchemeIds
+ */
+ public void setActiveSchemes(String[] activeSchemeIds) {
+ this.activeSchemeIds = activeSchemeIds;
+ BindingTable.BEST_SEQUENCE.setActiveSchemes(activeSchemeIds);
+ }
+
+ /*
+ * Copied from
+ * org.eclipse.jface.bindings.BindingManager.compareSchemes(String, String)
+ *
+ * Returns an in based on scheme 1 < scheme 2
+ */
+ private final int compareSchemes(final String schemeId1, final String schemeId2) {
+ if (activeSchemeIds == null) {
+ return 0;
+ }
+ if (!schemeId2.equals(schemeId1)) {
+ for (int i = 0; i < activeSchemeIds.length; i++) {
+ final String schemePointer = activeSchemeIds[i];
+ if (schemeId2.equals(schemePointer)) {
+ return 1;
+ } else if (schemeId1.equals(schemePointer)) {
+ return -1;
+ }
+ }
+ }
+ return 0;
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/ContextSet.java b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/ContextSet.java
new file mode 100644
index 0000000000..7b1d7c5a38
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/ContextSet.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.bindings.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.commands.contexts.Context;
+import org.eclipse.core.commands.contexts.ContextManager;
+
+public class ContextSet {
+ public static ContextSet EMPTY = new ContextSet(Collections.EMPTY_LIST);
+
+ public static class CComp implements Comparator<Context> {
+ private ContextManager manager;
+
+ public CComp(ContextManager manager) {
+ this.manager = manager;
+ }
+
+ @Override
+ public int compare(Context o1, Context o2) {
+ if (o1.equals(o2)) {
+ return 0;
+ }
+ int l1 = getLevel(o1);
+ int l2 = getLevel(o2);
+ if (l1 != l2) {
+ return l1 - l2;
+ }
+ return o1.getId().compareTo(o2.getId());
+ }
+
+ private int getLevel(Context c) {
+ int l = 0;
+ try {
+ String parentId = c.getParentId();
+ while (parentId != null) {
+ l++;
+ Context context = manager.getContext(parentId);
+ parentId = context.getParentId();
+ }
+ } catch (NotDefinedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return l;
+ }
+ }
+
+ private static Comparator<Context> CONTEXT_COMP = null;
+
+ public static void setComparator(Comparator<Context> comp) {
+ CONTEXT_COMP = comp;
+ }
+
+ public static Comparator<Context> getComparator() {
+ return CONTEXT_COMP;
+ }
+
+ private List<Context> contexts;
+
+ public ContextSet(Collection<Context> c) {
+ contexts = new ArrayList<Context>(c);
+ Collections.sort(contexts, CONTEXT_COMP);
+ }
+
+ public List<Context> getContexts() {
+ return contexts;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ContextSet)) {
+ return false;
+ }
+ return contexts.equals(((ContextSet) o).contexts);
+ }
+
+ @Override
+ public int hashCode() {
+ return contexts.hashCode();
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/Util.java b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/Util.java
new file mode 100644
index 0000000000..f78d09b309
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/Util.java
@@ -0,0 +1,669 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.ui.bindings.internal;
+
+import java.util.List;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import org.eclipse.swt.SWT;
+
+/**
+ * <p>
+ * A static class providing utility methods to all of JFace.
+ * </p>
+ *
+ * @since 3.1
+ */
+public final class Util {
+
+ /**
+ * A common zero-length string. It avoids needing write <code>NON-NLS</code>
+ * next to code fragments. It's also a bit clearer to read.
+ */
+ public static final String ZERO_LENGTH_STRING = ""; //$NON-NLS-1$
+
+ /**
+ * Verifies that the given object is an instance of the given class.
+ *
+ * @param object
+ * The object to check; may be <code>null</code>.
+ * @param c
+ * The class which the object should be; must not be
+ * <code>null</code>.
+ */
+ public static final void assertInstance(final Object object, final Class<?> c) {
+ assertInstance(object, c, false);
+ }
+
+ /**
+ * Verifies the given object is an instance of the given class. It is
+ * possible to specify whether the object is permitted to be
+ * <code>null</code>.
+ *
+ * @param object
+ * The object to check; may be <code>null</code>.
+ * @param c
+ * The class which the object should be; must not be
+ * <code>null</code>.
+ * @param allowNull
+ * Whether the object is allowed to be <code>null</code>.
+ */
+ private static final void assertInstance(final Object object, final Class<?> c, final boolean allowNull) {
+ if (object == null && allowNull) {
+ return;
+ }
+
+ if (object == null || c == null) {
+ throw new NullPointerException();
+ } else if (!c.isInstance(object)) {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ /**
+ * Compares two boolean values. <code>false</code> is considered to be
+ * "less than" <code>true</code>.
+ *
+ * @param left
+ * The left value to compare
+ * @param right
+ * The right value to compare
+ * @return <code>-1</code> if the left is <code>false</code> and the right
+ * is <code>true</code>. <code>1</code> if the opposite is true. If
+ * they are equal, then it returns <code>0</code>.
+ */
+ public static final int compare(final boolean left, final boolean right) {
+ return left == false ? (right == true ? -1 : 0) : 1;
+ }
+
+ /**
+ * Compares two integer values.
+ *
+ * @param left
+ * The left value to compare
+ * @param right
+ * The right value to compare
+ * @return <code>left - right</code>
+ */
+ public static final int compare(final int left, final int right) {
+ return left - right;
+ }
+
+ /**
+ * Compares to comparable objects -- defending against <code>null</code>.
+ *
+ * @param <T>
+ *
+ * @param left
+ * The left object to compare; may be <code>null</code>.
+ * @param right
+ * The right object to compare; may be <code>null</code>.
+ * @return The result of the comparison. <code>null</code> is considered to
+ * be the least possible value.
+ */
+ @SuppressWarnings("unchecked")
+ public static final <T> int compare(final Comparable<T> left, final Comparable<T> right) {
+ if (left == null && right == null) {
+ return 0;
+ } else if (left == null) {
+ return -1;
+ } else if (right == null) {
+ return 1;
+ } else {
+ return left.compareTo((T) right);
+ }
+ }
+
+ /**
+ * Compares two arrays of comparable objects -- accounting for
+ * <code>null</code>.
+ *
+ * @param left
+ * The left array to be compared; may be <code>null</code>.
+ * @param right
+ * The right array to be compared; may be <code>null</code>.
+ * @return The result of the comparison. <code>null</code> is considered to
+ * be the least possible value. A shorter array is considered less
+ * than a longer array.
+ */
+ public static final <T> int compare(final Comparable<T>[] left, final Comparable<T>[] right) {
+ if (left == null && right == null) {
+ return 0;
+ } else if (left == null) {
+ return -1;
+ } else if (right == null) {
+ return 1;
+ } else {
+ int l = left.length;
+ int r = right.length;
+
+ if (l != r) {
+ return l - r;
+ }
+
+ for (int i = 0; i < l; i++) {
+ int compareTo = compare(left[i], right[i]);
+
+ if (compareTo != 0) {
+ return compareTo;
+ }
+ }
+
+ return 0;
+ }
+ }
+
+ /**
+ * Compares two lists -- account for <code>null</code>. The lists must
+ * contain comparable objects.
+ *
+ * @param left
+ * The left list to compare; may be <code>null</code>. This list
+ * must only contain instances of <code>Comparable</code>.
+ * @param right
+ * The right list to compare; may be <code>null</code>. This list
+ * must only contain instances of <code>Comparable</code>.
+ * @return The result of the comparison. <code>null</code> is considered to
+ * be the least possible value. A shorter list is considered less
+ * than a longer list.
+ */
+ public static final <T> int compare(final List<Comparable<T>> left, final List<Comparable<T>> right) {
+ if (left == null && right == null) {
+ return 0;
+ } else if (left == null) {
+ return -1;
+ } else if (right == null) {
+ return 1;
+ } else {
+ int l = left.size();
+ int r = right.size();
+
+ if (l != r) {
+ return l - r;
+ }
+
+ for (int i = 0; i < l; i++) {
+ int compareTo = compare(left.get(i), right.get(i));
+
+ if (compareTo != 0) {
+ return compareTo;
+ }
+ }
+
+ return 0;
+ }
+ }
+
+ /**
+ * Tests whether the first array ends with the second array.
+ *
+ * @param left
+ * The array to check (larger); may be <code>null</code>.
+ * @param right
+ * The array that should be a subsequence (smaller); may be
+ * <code>null</code>.
+ * @param equals
+ * Whether the two array are allowed to be equal.
+ * @return <code>true</code> if the second array is a subsequence of the
+ * array list, and they share end elements.
+ */
+ public static final boolean endsWith(final Object[] left, final Object[] right, final boolean equals) {
+ if (left == null || right == null) {
+ return false;
+ }
+
+ int l = left.length;
+ int r = right.length;
+
+ if (r > l || !equals && r == l) {
+ return false;
+ }
+
+ for (int i = 0; i < r; i++) {
+ if (!equals(left[l - i - 1], right[r - i - 1])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Checks whether the two objects are <code>null</code> -- allowing for
+ * <code>null</code>.
+ *
+ * @param left
+ * The left object to compare; may be <code>null</code>.
+ * @param right
+ * The right object to compare; may be <code>null</code>.
+ * @return <code>true</code> if the two objects are equivalent;
+ * <code>false</code> otherwise.
+ */
+ public static final boolean equals(final Object left, final Object right) {
+ return left == null ? right == null : ((right != null) && left.equals(right));
+ }
+
+ /**
+ * Tests whether two arrays of objects are equal to each other. The arrays
+ * must not be <code>null</code>, but their elements may be
+ * <code>null</code>.
+ *
+ * @param leftArray
+ * The left array to compare; may be <code>null</code>, and may
+ * be empty and may contain <code>null</code> elements.
+ * @param rightArray
+ * The right array to compare; may be <code>null</code>, and may
+ * be empty and may contain <code>null</code> elements.
+ * @return <code>true</code> if the arrays are equal length and the elements
+ * at the same position are equal; <code>false</code> otherwise.
+ */
+ public static final boolean equals(final Object[] leftArray, final Object[] rightArray) {
+ if (leftArray == rightArray) {
+ return true;
+ }
+
+ if (leftArray == null) {
+ return (rightArray == null);
+ } else if (rightArray == null) {
+ return false;
+ }
+
+ if (leftArray.length != rightArray.length) {
+ return false;
+ }
+
+ for (int i = 0; i < leftArray.length; i++) {
+ final Object left = leftArray[i];
+ final Object right = rightArray[i];
+ final boolean equal = (left == null) ? (right == null) : (left.equals(right));
+ if (!equal) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Provides a hash code based on the given integer value.
+ *
+ * @param i
+ * The integer value
+ * @return <code>i</code>
+ */
+ public static final int hashCode(final int i) {
+ return i;
+ }
+
+ /**
+ * Provides a hash code for the object -- defending against
+ * <code>null</code>.
+ *
+ * @param object
+ * The object for which a hash code is required.
+ * @return <code>object.hashCode</code> or <code>0</code> if
+ * <code>object</code> if <code>null</code>.
+ */
+ public static final int hashCode(final Object object) {
+ return object != null ? object.hashCode() : 0;
+ }
+
+ /**
+ * Computes the hash code for an array of objects, but with defense against
+ * <code>null</code>.
+ *
+ * @param objects
+ * The array of objects for which a hash code is needed; may be
+ * <code>null</code>.
+ * @return The hash code for <code>objects</code>; or <code>0</code> if
+ * <code>objects</code> is <code>null</code>.
+ */
+ public static final int hashCode(final Object[] objects) {
+ if (objects == null) {
+ return 0;
+ }
+
+ int hashCode = 89;
+ for (int i = 0; i < objects.length; i++) {
+ final Object object = objects[i];
+ if (object != null) {
+ hashCode = hashCode * 31 + object.hashCode();
+ }
+ }
+
+ return hashCode;
+ }
+
+ /**
+ * Checks whether the second array is a subsequence of the first array, and
+ * that they share common starting elements.
+ *
+ * @param left
+ * The first array to compare (large); may be <code>null</code>.
+ * @param right
+ * The second array to compare (small); may be <code>null</code>.
+ * @param equals
+ * Whether it is allowed for the two arrays to be equivalent.
+ * @return <code>true</code> if the first arrays starts with the second
+ * list; <code>false</code> otherwise.
+ */
+ public static final boolean startsWith(final Object[] left, final Object[] right, final boolean equals) {
+ if (left == null || right == null) {
+ return false;
+ }
+
+ int l = left.length;
+ int r = right.length;
+
+ if (r > l || !equals && r == l) {
+ return false;
+ }
+
+ for (int i = 0; i < r; i++) {
+ if (!equals(left[i], right[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Converts an array into a string representation that is suitable for
+ * debugging.
+ *
+ * @param array
+ * The array to convert; may be <code>null</code>.
+ * @return The string representation of the array; never <code>null</code>.
+ */
+ public static final String toString(final Object[] array) {
+ if (array == null) {
+ return "null"; //$NON-NLS-1$
+ }
+
+ final StringBuffer buffer = new StringBuffer();
+ buffer.append('[');
+
+ final int length = array.length;
+ for (int i = 0; i < length; i++) {
+ if (i != 0) {
+ buffer.append(',');
+ }
+ final Object object = array[i];
+ final String element = String.valueOf(object);
+ buffer.append(element);
+ }
+ buffer.append(']');
+
+ return buffer.toString();
+ }
+
+ /**
+ * Provides a translation of a particular key from the resource bundle.
+ *
+ * @param resourceBundle
+ * The key to look up in the resource bundle; should not be
+ * <code>null</code>.
+ * @param key
+ * The key to look up in the resource bundle; should not be
+ * <code>null</code>.
+ * @param defaultString
+ * The value to return if the resource cannot be found; may be
+ * <code>null</code>.
+ * @return The value of the translated resource at <code>key</code>. If the
+ * key cannot be found, then it is simply the
+ * <code>defaultString</code>.
+ */
+ public static final String translateString(final ResourceBundle resourceBundle, final String key,
+ final String defaultString) {
+ if (resourceBundle != null && key != null) {
+ try {
+ final String translatedString = resourceBundle.getString(key);
+
+ if (translatedString != null) {
+ return translatedString;
+ }
+ } catch (MissingResourceException eMissingResource) {
+ // Such is life. We'll return the key
+ }
+ }
+
+ return defaultString;
+ }
+
+ /**
+ * Foundation replacement for String.replaceAll(*).
+ *
+ * @param src
+ * the starting string.
+ * @param find
+ * the string to find.
+ * @param replacement
+ * the string to replace.
+ * @return The new string.
+ * @since 3.4
+ */
+ public static final String replaceAll(String src, String find, String replacement) {
+ final int len = src.length();
+ final int findLen = find.length();
+
+ int idx = src.indexOf(find);
+ if (idx < 0) {
+ return src;
+ }
+
+ StringBuffer buf = new StringBuffer();
+ int beginIndex = 0;
+ while (idx != -1 && idx < len) {
+ buf.append(src.substring(beginIndex, idx));
+ buf.append(replacement);
+
+ beginIndex = idx + findLen;
+ if (beginIndex < len) {
+ idx = src.indexOf(find, beginIndex);
+ } else {
+ idx = -1;
+ }
+ }
+ if (beginIndex < len) {
+ buf.append(src.substring(beginIndex, (idx == -1 ? len : idx)));
+ }
+ return buf.toString();
+ }
+
+ //
+ // Methods for working with the windowing system
+ //
+
+ /**
+ * Windowing system constant.
+ *
+ * @since 3.5
+ */
+ public static final String WS_WIN32 = "win32";//$NON-NLS-1$
+
+ /**
+ * Windowing system constant.
+ *
+ * @since 3.5
+ */
+ public static final String WS_MOTIF = "motif";//$NON-NLS-1$
+
+ /**
+ * Windowing system constant.
+ *
+ * @since 3.5
+ */
+ public static final String WS_GTK = "gtk";//$NON-NLS-1$
+
+ /**
+ * Windowing system constant.
+ *
+ * @since 3.5
+ */
+ public static final String WS_PHOTON = "photon";//$NON-NLS-1$
+
+ /**
+ * Windowing system constant.
+ *
+ * @since 3.5
+ */
+ public static final String WS_CARBON = "carbon";//$NON-NLS-1$
+
+ /**
+ * Windowing system constant.
+ *
+ * @since 3.5
+ */
+ public static final String WS_COCOA = "cocoa";//$NON-NLS-1$
+
+ /**
+ * Windowing system constant.
+ *
+ * @since 3.5
+ */
+ public static final String WS_WPF = "wpf";//$NON-NLS-1$
+
+ /**
+ * Windowing system constant.
+ *
+ * @since 3.5
+ */
+ public static final String WS_UNKNOWN = "unknown";//$NON-NLS-1$
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for windows platforms
+ * @since 3.5
+ */
+ public static final boolean isWindows() {
+ final String ws = SWT.getPlatform();
+ return WS_WIN32.equals(ws) || WS_WPF.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for mac platforms
+ * @since 3.5
+ */
+ public static final boolean isMac() {
+ final String ws = SWT.getPlatform();
+ return WS_CARBON.equals(ws) || WS_COCOA.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for linux platform
+ * @since 3.5
+ */
+ public static final boolean isLinux() {
+ final String ws = SWT.getPlatform();
+ return WS_GTK.equals(ws) || WS_MOTIF.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for gtk platforms
+ * @since 3.5
+ */
+ public static final boolean isGtk() {
+ final String ws = SWT.getPlatform();
+ return WS_GTK.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for motif platforms
+ * @since 3.5
+ */
+ public static final boolean isMotif() {
+ final String ws = SWT.getPlatform();
+ return WS_MOTIF.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for photon platforms
+ * @since 3.5
+ */
+ public static final boolean isPhoton() {
+ final String ws = SWT.getPlatform();
+ return WS_PHOTON.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for carbon platforms
+ * @since 3.5
+ */
+ public static final boolean isCarbon() {
+ final String ws = SWT.getPlatform();
+ return WS_CARBON.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for the cocoa platform.
+ * @since 3.5
+ */
+ public static final boolean isCocoa() {
+ final String ws = SWT.getPlatform();
+ return WS_COCOA.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for WPF
+ * @since 3.5
+ */
+ public static final boolean isWpf() {
+ final String ws = SWT.getPlatform();
+ return WS_WPF.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return <code>true</code> for win32
+ * @since 3.5
+ */
+ public static final boolean isWin32() {
+ final String ws = SWT.getPlatform();
+ return WS_WIN32.equals(ws);
+ }
+
+ /**
+ * Common WS query helper method.
+ *
+ * @return the SWT windowing platform string.
+ * @see SWT#getPlatform()
+ * @since 3.5
+ */
+ public static final String getWS() {
+ return SWT.getPlatform();
+ }
+
+ /**
+ * This class should never be constructed.
+ */
+ private Util() {
+ // Not allowed.
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/keys/CancelOnModifyListener.java b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/keys/CancelOnModifyListener.java
new file mode 100644
index 0000000000..49c4d4bead
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/keys/CancelOnModifyListener.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.ui.bindings.keys;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * A listener that removes the out-of-order listener if a modification occurs before reaching it.
+ * This is a workaround for Bug 53497.
+ *
+ * @since 3.0
+ */
+final class CancelOnModifyListener implements Listener {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ /**
+ * The listener to remove when this listener catches any event. This value should not be
+ * <code>null</code>.
+ */
+ private final Listener chainedListener;
+
+ /**
+ * Constructs a new instance of <code>CancelOnModifyListener</code>
+ *
+ * @param listener
+ * The listener which should be removed in the event of a modification event
+ * arriving; should not be <code>null</code>.
+ */
+ CancelOnModifyListener(Listener listener) {
+ chainedListener = listener;
+ }
+
+ @Override
+ public void handleEvent(Event event) {
+ Widget widget = event.widget;
+ widget.removeListener(SWT.Modify, this);
+ widget.removeListener(SWT.KeyDown, chainedListener);
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/.classpath b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.classpath
new file mode 100644
index 0000000000..bd3096fadd
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-rap"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/.project b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.project
new file mode 100644
index 0000000000..2f4fe04ffa
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.e4.ui.workbench.addons.swt</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000000..c522e1f4ae
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..2be40738f7
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,419 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
+org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..8bd6e3c589
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,124 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
+formatter_settings_version=12
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) ${year} IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * IBM Corporation - initial API and implementation\n ******************************************************************************/\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 0000000000..a09ec9c2c7
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,97 @@
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Warning
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..2ce50474bb
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=1
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..e032b52cc8
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.e4.ui.workbench.addons.swt;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.e4.ui.model.workbench;bundle-version="1.0.0",
+ org.eclipse.e4.core.contexts;bundle-version="0.9.0",
+ org.eclipse.e4.core.di;bundle-version="0.9.0",
+ org.eclipse.e4.ui.workbench;bundle-version="0.9.1",
+ org.eclipse.e4.core.services;bundle-version="0.9.1",
+ org.eclipse.osgi.services;bundle-version="[3.2.100,4.0.0)",
+ org.eclipse.e4.ui.workbench.renderers.swt;bundle-version="0.9.1",
+ org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
+ org.eclipse.e4.ui.di;bundle-version="0.10.0",
+ org.eclipse.e4.ui.services;bundle-version="1.0.0",
+ org.eclipse.emf.ecore.xmi;bundle-version="2.7.0",
+ org.eclipse.rap.rwt;bundle-version="2.3.0",
+ org.eclipse.rap.jface;bundle-version="2.3.0"
+Require-Capability: org.eclipse.rap
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Import-Package: javax.annotation;version="1.0.0",
+ javax.inject;version="1.0.0",
+ org.eclipse.e4.ui.internal.workbench.swt,
+ org.eclipse.osgi.util;version="1.1.0"
+Export-Package: org.eclipse.e4.ui.workbench.addons.cleanupaddon;x-internal:=true,
+ org.eclipse.e4.ui.workbench.addons.dndaddon;x-internal:=true,
+ org.eclipse.e4.ui.workbench.addons.minmax;x-internal:=true,
+ org.eclipse.e4.ui.workbench.addons.splitteraddon;x-internal:=true,
+ org.eclipse.e4.ui.workbench.addons.swt;x-internal:=true
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/p2.inf b/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/p2.inf
new file mode 100644
index 0000000000..f4e1a274dc
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/p2.inf
@@ -0,0 +1,13 @@
+# Ensure that modified RAP e4 platform bundles are only installed in RAP environment
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=491177
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=490922
+
+# Make sure that a RAP RWT implementation is available
+requires.0.namespace = org.eclipse.rap
+requires.0.name = org.eclipse.rap.rwt
+
+# Do not allow to install this IU in case the SWT bundle is available
+requires.1.namespace = org.eclipse.equinox.p2.iu
+requires.1.name = org.eclipse.swt
+requires.1.min = 0
+requires.1.max = 0
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/about.html b/bundles/org.eclipse.e4.ui.workbench.addons.swt/about.html
new file mode 100644
index 0000000000..3ce4e7e75b
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 20, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/build.properties b/bundles/org.eclipse.e4.ui.workbench.addons.swt/build.properties
new file mode 100644
index 0000000000..a111faf289
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/build.properties
@@ -0,0 +1,22 @@
+###############################################################################
+# opyright (c) 2013, 2015 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/,\
+ src-rap/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties,\
+ plugin.xml,\
+ icons/
+src.includes = icons/,\
+ about.html
+jre.compilation.profile = JavaSE-1.7
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/forceQualifierUpdate.txt b/bundles/org.eclipse.e4.ui.workbench.addons.swt/forceQualifierUpdate.txt
new file mode 100644
index 0000000000..81470cd7bd
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/forceQualifierUpdate.txt
@@ -0,0 +1,3 @@
+# To force a version qualifier update add the bug here
+Bug 403352 - Update all parent versions to match our build stream
+Bug 429184 - [Metadata] comparator errors in most recent I-builds
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/icons/full/etool16/fastview_restore.gif b/bundles/org.eclipse.e4.ui.workbench.addons.swt/icons/full/etool16/fastview_restore.gif
new file mode 100644
index 0000000000..e0010dfaae
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/icons/full/etool16/fastview_restore.gif
Binary files differ
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/icons/full/obj16/layout_co.gif b/bundles/org.eclipse.e4.ui.workbench.addons.swt/icons/full/obj16/layout_co.gif
new file mode 100644
index 0000000000..c98cdd4ea2
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/icons/full/obj16/layout_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/plugin.properties b/bundles/org.eclipse.e4.ui.workbench.addons.swt/plugin.properties
new file mode 100644
index 0000000000..c43a3fe6a5
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/plugin.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2010, 2012 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+pluginName = Eclipse e4 Workbench Add-ons
+providerName = Eclipse.org
+
+extension.addonsnippet.name = Addon Snippet \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/plugin.xml b/bundles/org.eclipse.e4.ui.workbench.addons.swt/plugin.xml
new file mode 100644
index 0000000000..4e5ddf6da0
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/plugin.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ id="AddonSnippet"
+ name="%extension.addonsnippet.name"
+ point="org.eclipse.e4.workbench.model">
+ <processor
+ beforefragment="true"
+ class="org.eclipse.e4.ui.workbench.addons.swt.CleanupProcessor">
+ </processor>
+ <processor
+ beforefragment="true"
+ class="org.eclipse.e4.ui.workbench.addons.swt.MinMaxProcessor">
+ </processor>
+ <!--processor
+ beforefragment="true"
+ class="org.eclipse.e4.ui.workbench.addons.swt.DnDProcessor">
+ </processor-->
+ <processor
+ beforefragment="true"
+ class="org.eclipse.e4.ui.workbench.addons.swt.SplitterProcessor">
+ </processor>
+ </extension>
+
+</plugin>
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/pom.xml b/bundles/org.eclipse.e4.ui.workbench.addons.swt/pom.xml
new file mode 100644
index 0000000000..ed2d0a3a06
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.rap.e4</groupId>
+ <artifactId>org.eclipse.e4.ui.workbench.addons.swt</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <parent>
+ <groupId>org.eclipse.rap.e4</groupId>
+ <artifactId>org.eclipse.rap.e4.target-releng</artifactId>
+ <relativePath>../../releng/releng-target/pom.xml</relativePath>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
+
+ <build>
+ <resources>
+ <!-- to ensure that the feature lookup of the ui test works -->
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>META-INF/</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src-rap/org/eclipse/e4/ui/workbench/addons/minmax/TrimPaneLayout.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src-rap/org/eclipse/e4/ui/workbench/addons/minmax/TrimPaneLayout.java
new file mode 100644
index 0000000000..3e7c367df8
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src-rap/org/eclipse/e4/ui/workbench/addons/minmax/TrimPaneLayout.java
@@ -0,0 +1,303 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.workbench.addons.minmax;
+
+import org.eclipse.e4.ui.model.application.ui.menu.MToolControl;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+
+/**
+ *
+ */
+public class TrimPaneLayout extends Layout {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private static int BORDER_WIDTH = 4;
+ private int fixedCorner;
+
+ public Rectangle hSizingRect;
+ public Rectangle vSizingRect;
+ public Rectangle cornerRect;
+ private Rectangle clientRect;
+ private boolean resizeInstalled = false;
+
+ // private static int NOT_SIZING = 0;
+ // private static int HORIZONTAL_SIZING = 1;
+ // private static int VERTICAL_SIZING = 2;
+ // private static int CORNER_SIZING = 3;
+
+ int trackState = SWT.NONE;
+ protected Point curPos;
+
+ // private MToolControl toolControl;
+
+ public TrimPaneLayout(MToolControl toolControl, int barSide) {
+ // this.toolControl = toolControl;
+ this.fixedCorner = barSide;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.swt.widgets.Layout#computeSize(org.eclipse.swt.widgets.Composite, int, int,
+ * boolean)
+ */
+ @Override
+ protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
+ return new Point(600, 400);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.swt.widgets.Layout#layout(org.eclipse.swt.widgets.Composite, boolean)
+ */
+ @Override
+ protected void layout(Composite composite, boolean flushCache) {
+ installResize(composite);
+
+ if (composite.getChildren().length != 1)
+ return;
+
+ if (fixedCorner == SWT.NONE)
+ return;
+
+ Rectangle bounds = composite.getBounds();
+
+ if (isFixed(SWT.TOP)) {
+ if (isFixed(SWT.RIGHT)) {
+ hSizingRect = new Rectangle(0, 0, BORDER_WIDTH, bounds.height - BORDER_WIDTH);
+ vSizingRect = new Rectangle(BORDER_WIDTH, bounds.height - BORDER_WIDTH,
+ bounds.width - BORDER_WIDTH, BORDER_WIDTH);
+ cornerRect = new Rectangle(0, bounds.height - BORDER_WIDTH, BORDER_WIDTH,
+ BORDER_WIDTH);
+ clientRect = new Rectangle(BORDER_WIDTH, 0, bounds.width - BORDER_WIDTH,
+ bounds.height - BORDER_WIDTH);
+ } else {
+ hSizingRect = new Rectangle(bounds.width - BORDER_WIDTH, 0, BORDER_WIDTH,
+ bounds.height - BORDER_WIDTH);
+ vSizingRect = new Rectangle(0, bounds.height - BORDER_WIDTH, bounds.width
+ - BORDER_WIDTH, BORDER_WIDTH);
+ cornerRect = new Rectangle(bounds.width - BORDER_WIDTH, bounds.height
+ - BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH);
+ clientRect = new Rectangle(0, 0, bounds.width - BORDER_WIDTH, bounds.height
+ - BORDER_WIDTH);
+ }
+ } else if (isFixed(SWT.BOTTOM)) {
+ if (isFixed(SWT.RIGHT)) {
+ hSizingRect = new Rectangle(0, BORDER_WIDTH, BORDER_WIDTH, bounds.height
+ - BORDER_WIDTH);
+ vSizingRect = new Rectangle(BORDER_WIDTH, 0, bounds.width - BORDER_WIDTH,
+ BORDER_WIDTH);
+ cornerRect = new Rectangle(0, 0, BORDER_WIDTH, BORDER_WIDTH);
+ clientRect = new Rectangle(BORDER_WIDTH, BORDER_WIDTH, bounds.width - BORDER_WIDTH,
+ bounds.height - BORDER_WIDTH);
+ } else {
+ hSizingRect = new Rectangle(bounds.width - BORDER_WIDTH, BORDER_WIDTH,
+ BORDER_WIDTH, bounds.height - BORDER_WIDTH);
+ vSizingRect = new Rectangle(0, 0, bounds.width - BORDER_WIDTH, BORDER_WIDTH);
+ cornerRect = new Rectangle(bounds.width - BORDER_WIDTH, 0, BORDER_WIDTH,
+ BORDER_WIDTH);
+ clientRect = new Rectangle(0, BORDER_WIDTH, bounds.width - BORDER_WIDTH,
+ bounds.height - BORDER_WIDTH);
+ }
+ }
+ Control child = composite.getChildren()[0];
+ child.setBounds(clientRect);
+ }
+
+ private void installResize(final Composite composite) {
+ if (resizeInstalled)
+ return;
+ // FIXME RAP Needs native support on client
+ // composite.addMouseMoveListener(new MouseMoveListener() {
+ // /**
+ // *
+ // */
+ // private static final long serialVersionUID = 1L;
+ //
+ // @Override
+ // public void mouseMove(MouseEvent e) {
+ // Point p = e.display.getCursorLocation();
+ // if (trackState == NOT_SIZING) {
+ // setCursor(composite, new Point(e.x, e.y));
+ // } else if (trackState == HORIZONTAL_SIZING) {
+ // dragHorizontal(composite, p);
+ // } else if (trackState == VERTICAL_SIZING) {
+ // dragVertical(composite, p);
+ // } else if (trackState == CORNER_SIZING) {
+ // dragCorner(composite, p);
+ // }
+ // }
+ // });
+ //
+ // composite.addMouseListener(new MouseListener() {
+ //
+ // /**
+ // *
+ // */
+ // private static final long serialVersionUID = 1L;
+ //
+ // @Override
+ // public void mouseUp(MouseEvent e) {
+ // composite.setCapture(false);
+ //
+ // // Persist the current size
+ // Point size = composite.getSize();
+ // toolControl.getPersistedState()
+ // .put(TrimStack.STATE_XSIZE, Integer.toString(size.x));
+ // toolControl.getPersistedState()
+ // .put(TrimStack.STATE_YSIZE, Integer.toString(size.y));
+ //
+ // trackState = NOT_SIZING;
+ // }
+ //
+ // @Override
+ // public void mouseDown(MouseEvent e) {
+ // Point p = new Point(e.x, e.y);
+ // if (hSizingRect.contains(p)) {
+ // curPos = e.display.getCursorLocation();
+ // trackState = HORIZONTAL_SIZING;
+ // composite.setCapture(true);
+ // } else if (vSizingRect.contains(p)) {
+ // curPos = e.display.getCursorLocation();
+ // trackState = VERTICAL_SIZING;
+ // composite.setCapture(true);
+ // } else if (cornerRect.contains(p)) {
+ // curPos = e.display.getCursorLocation();
+ // trackState = CORNER_SIZING;
+ // composite.setCapture(true);
+ // }
+ // }
+ //
+ // @Override
+ // public void mouseDoubleClick(MouseEvent e) {
+ // }
+ // });
+ //
+ // composite.addMouseTrackListener(new MouseTrackListener() {
+ // /**
+ // *
+ // */
+ // private static final long serialVersionUID = 1L;
+ //
+ // @Override
+ // public void mouseHover(MouseEvent e) {
+ // }
+ //
+ // @Override
+ // public void mouseExit(MouseEvent e) {
+ // Composite comp = (Composite) e.widget;
+ // comp.setCursor(null);
+ // }
+ //
+ // @Override
+ // public void mouseEnter(MouseEvent e) {
+ // }
+ // });
+ //
+ // resizeInstalled = true;
+ }
+
+ /**
+ * @param p
+ */
+ protected void setCursor(Composite composite, Point p) {
+ if (hSizingRect.contains(p)) {
+ composite.setCursor(composite.getDisplay().getSystemCursor(SWT.CURSOR_SIZEWE));
+ } else if (vSizingRect.contains(p)) {
+ composite.setCursor(composite.getDisplay().getSystemCursor(SWT.CURSOR_SIZENS));
+ } else if (cornerRect.contains(p)) {
+ if (isFixed(SWT.TOP)) {
+ if (isFixed(SWT.RIGHT))
+ composite.setCursor(composite.getDisplay().getSystemCursor(SWT.CURSOR_SIZESW));
+ else
+ composite.setCursor(composite.getDisplay().getSystemCursor(SWT.CURSOR_SIZESE));
+ } else if (isFixed(SWT.BOTTOM)) {
+ if (isFixed(SWT.RIGHT))
+ composite.setCursor(composite.getDisplay().getSystemCursor(SWT.CURSOR_SIZESE));
+ else
+ composite.setCursor(composite.getDisplay().getSystemCursor(SWT.CURSOR_SIZESW));
+ }
+ } else {
+ composite.setCursor(null);
+ }
+ }
+
+ protected void dragCorner(Composite composite, Point p) {
+ int dx = p.x - curPos.x;
+ int dy = p.y - curPos.y;
+ Rectangle bounds = composite.getBounds();
+
+ if (isFixed(SWT.RIGHT)) {
+ bounds.x += dx;
+ bounds.width -= dx;
+ } else {
+ bounds.width += dx;
+ }
+
+ if (isFixed(SWT.BOTTOM)) {
+ bounds.y += dy;
+ bounds.height -= dy;
+ } else {
+ bounds.height += dy;
+ }
+
+ composite.setBounds(bounds);
+ composite.getDisplay().update();
+
+ curPos = p;
+ }
+
+ protected void dragVertical(Composite composite, Point p) {
+ int dy = p.y - curPos.y;
+ Rectangle bounds = composite.getBounds();
+ if (isFixed(SWT.BOTTOM)) {
+ bounds.y += dy;
+ bounds.height -= dy;
+ } else {
+ bounds.height += dy;
+ }
+
+ composite.setBounds(bounds);
+ composite.getDisplay().update();
+
+ curPos = p;
+ }
+
+ protected void dragHorizontal(Composite composite, Point p) {
+ int dx = p.x - curPos.x;
+ Rectangle bounds = composite.getBounds();
+ if (isFixed(SWT.RIGHT)) {
+ bounds.x += dx;
+ bounds.width -= dx;
+ } else {
+ bounds.width += dx;
+ }
+
+ composite.setBounds(bounds);
+ composite.getDisplay().update();
+
+ curPos = p;
+ }
+
+ private boolean isFixed(int swtSide) {
+ return (fixedCorner & swtSide) != 0;
+ }
+}
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
new file mode 100644
index 0000000000..29ba353329
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java
@@ -0,0 +1,345 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.workbench.addons.cleanupaddon;
+
+import javax.inject.Inject;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.services.events.IEventBroker;
+import org.eclipse.e4.ui.di.UIEventTopic;
+import org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.model.application.ui.MElementContainer;
+import org.eclipse.e4.ui.model.application.ui.MUIElement;
+import org.eclipse.e4.ui.model.application.ui.advanced.MArea;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspectiveStack;
+import org.eclipse.e4.ui.model.application.ui.basic.MCompositePart;
+import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer;
+import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
+import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
+import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
+import org.eclipse.e4.ui.model.application.ui.menu.MMenuElement;
+import org.eclipse.e4.ui.model.application.ui.menu.MToolBar;
+import org.eclipse.e4.ui.workbench.IPresentationEngine;
+import org.eclipse.e4.ui.workbench.UIEvents;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.e4.ui.workbench.renderers.swt.SashLayout;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.osgi.service.event.Event;
+
+public class CleanupAddon {
+ @Inject
+ IEventBroker eventBroker;
+
+ @Inject
+ EModelService modelService;
+
+ @Inject
+ MApplication app;
+
+ @Inject
+ @Optional
+ private void subscribeTopicChildren(
+ @UIEventTopic(UIEvents.ElementContainer.TOPIC_CHILDREN) Event event) {
+ Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);
+ if (UIEvents.isREMOVE(event)) {
+ final MElementContainer<?> container = (MElementContainer<?>) changedObj;
+ MUIElement containerParent = container.getParent();
+
+ // Determine the elements that should *not* ever be auto-destroyed
+ if (container instanceof MApplication || container instanceof MPerspectiveStack
+ || container instanceof MMenuElement || container instanceof MTrimBar
+ || container instanceof MToolBar || container instanceof MArea
+ || container.getTags().contains(IPresentationEngine.NO_AUTO_COLLAPSE)) {
+ return;
+ }
+
+ if (container instanceof MWindow && containerParent instanceof MApplication) {
+ return;
+ }
+
+ Display display = Display.getCurrent();
+
+ // Stall the removal to handle cases where the container is only transiently empty
+ if (display != null) {
+ Display.getCurrent().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ // Remove it from the display if no visible children
+ int tbrCount = modelService.toBeRenderedCount(container);
+
+ // Cache the value since setting the TBR may change the result
+ boolean lastStack = isLastEditorStack(container);
+ if (tbrCount == 0 && !lastStack) {
+ container.setToBeRendered(false);
+ }
+
+ // Remove it from the model if it has no children at all
+ MElementContainer<?> lclContainer = container;
+ if (lclContainer.getChildren().size() == 0) {
+ MElementContainer<MUIElement> parent = container.getParent();
+ if (parent != null && !lastStack) {
+ container.setToBeRendered(false);
+ parent.getChildren().remove(container);
+ } else if (container instanceof MWindow) {
+ // Must be a Detached Window
+ MUIElement eParent = (MUIElement) ((EObject) container)
+ .eContainer();
+ if (eParent instanceof MPerspective) {
+ ((MPerspective) eParent).getWindows().remove(container);
+ } else if (eParent instanceof MWindow) {
+ ((MWindow) eParent).getWindows().remove(container);
+ }
+ }
+ } else if (container.getChildren().size() == 1
+ && container instanceof MPartSashContainer) {
+ // if a sash container has only one element then remove it and move
+ // its child up to where it used to be
+ MUIElement theChild = container.getChildren().get(0);
+ MElementContainer<MUIElement> parentContainer = container.getParent();
+ if (parentContainer != null) {
+ int index = parentContainer.getChildren().indexOf(container);
+
+ // Magic check, are we unwrapping a sash container
+ if (theChild instanceof MPartSashContainer) {
+ if (container.getWidget() instanceof Composite) {
+ Composite theComp = (Composite) container.getWidget();
+ Object tmp = theChild.getWidget();
+ theChild.setWidget(theComp);
+ theComp.setLayout(new SashLayout(theComp, theChild));
+ theComp.setData(AbstractPartRenderer.OWNING_ME, theChild);
+ container.setWidget(tmp);
+ }
+ }
+
+ theChild.setContainerData(container.getContainerData());
+ container.getChildren().remove(theChild);
+ parentContainer.getChildren().add(index, theChild);
+ container.setToBeRendered(false);
+ parentContainer.getChildren().remove(container);
+ }
+ }
+ }
+ });
+ }
+ }
+ }
+
+ /**
+ * Returns true if and only if the given element should make itself visible
+ * when its first child becomes visible and make itself invisible whenever
+ * its last child becomes invisible. Defaults to false for unknown element
+ * types
+ */
+ private static boolean shouldReactToChildVisibilityChanges(MUIElement theElement) {
+ // TODO: It may be possible to remove the instanceof checks and just use
+ // IPresentationEngine.HIDDEN_EXPLICITLY. However, that would require
+ // explicitly setting IPresentationEngine.HIDDEN_EXPLICITLY on every
+ // object where we want to keep it hidden even if it has a visible child
+ // (such as the main toolbar).
+ return (theElement instanceof MPartSashContainer || theElement instanceof MPartStack
+ || theElement instanceof MCompositePart)
+ && !theElement.getTags().contains(IPresentationEngine.HIDDEN_EXPLICITLY);
+ }
+
+ @Inject
+ @Optional
+ private void subscribeVisibilityChanged(
+ @UIEventTopic(UIEvents.UIElement.TOPIC_VISIBLE) Event event) {
+ MUIElement changedObj = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
+ if (changedObj instanceof MTrimBar || ((Object) changedObj.getParent()) instanceof MToolBar)
+ return;
+
+ if (changedObj.getWidget() instanceof Shell) {
+ ((Shell) changedObj.getWidget()).setVisible(changedObj.isVisible());
+ } else if (changedObj.getWidget() instanceof Rectangle) {
+ MElementContainer<MUIElement> parent = changedObj.getParent();
+ if (!shouldReactToChildVisibilityChanges(parent)) {
+ return;
+ }
+
+ if (changedObj.isVisible()) {
+ // Make all the parents visible
+ if (!parent.isVisible())
+ parent.setVisible(true);
+ } else {
+ // If there are no more 'visible' children then make the parent go away too
+ boolean makeInvisible = true;
+ for (MUIElement kid : parent.getChildren()) {
+ if (kid.isToBeRendered() && kid.isVisible()) {
+ makeInvisible = false;
+ break;
+ }
+ }
+ if (makeInvisible)
+ parent.setVisible(false);
+ }
+ } else if (changedObj.getWidget() instanceof Control) {
+ Control ctrl = (Control) changedObj.getWidget();
+ MElementContainer<MUIElement> parent = changedObj.getParent();
+ if (parent == null || ((Object) parent) instanceof MToolBar) {
+ return;
+ }
+
+ if (changedObj.isVisible()) {
+ if (parent.getRenderer() != null) {
+ Object myParent = ((AbstractPartRenderer) parent.getRenderer())
+ .getUIContainer(changedObj);
+ if (myParent instanceof Composite) {
+ Composite parentComp = (Composite) myParent;
+ ctrl.setParent(parentComp);
+
+ Control prevControl = null;
+ for (MUIElement childME : parent.getChildren()) {
+ if (childME == changedObj)
+ break;
+ if (childME.getWidget() instanceof Control && childME.isVisible()) {
+ prevControl = (Control) childME.getWidget();
+ }
+ }
+ if (prevControl != null)
+ ctrl.moveBelow(prevControl);
+ else
+ ctrl.moveAbove(null);
+ ctrl.getShell().layout(new Control[] { ctrl }, SWT.DEFER);
+ }
+
+ if (!shouldReactToChildVisibilityChanges(parent)) {
+ return;
+ }
+
+ // Check if the parent is visible
+ if (!parent.isVisible())
+ parent.setVisible(true);
+ }
+ } else {
+ Shell limbo = (Shell) app.getContext().get("limbo");
+
+ // Reparent the control to 'limbo'
+ Composite curParent = ctrl.getParent();
+ ctrl.setParent(limbo);
+ curParent.layout(true);
+ if (curParent.getShell() != curParent)
+ curParent.getShell().layout(new Control[] { curParent }, SWT.DEFER);
+
+ // Always leave Window's in the presentation
+ if ((Object) parent instanceof MWindow)
+ return;
+
+ // If there are no more 'visible' children then make the parent go away too
+ boolean makeParentInvisible = true;
+ for (MUIElement kid : parent.getChildren()) {
+ if (kid.isToBeRendered() && kid.isVisible()) {
+ makeParentInvisible = false;
+ break;
+ }
+ }
+
+ if (!shouldReactToChildVisibilityChanges(parent)) {
+ return;
+ }
+
+ // Special check: If a perspective goes invisibe we need to make its
+ // PerspectiveStack invisible as well...see bug 369528
+ if (makeParentInvisible)
+ parent.setVisible(false);
+ }
+ }
+ }
+
+ @Inject
+ @Optional
+ private void subscribeRenderingChanged(
+ @UIEventTopic(UIEvents.UIElement.TOPIC_TOBERENDERED) Event event) {
+ MUIElement changedObj = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
+ MElementContainer<MUIElement> container = null;
+ if (changedObj.getCurSharedRef() != null)
+ container = changedObj.getCurSharedRef().getParent();
+ else
+ container = changedObj.getParent();
+
+ // this can happen for shared parts that aren't attached to any placeholders
+ if (container == null) {
+ return;
+ }
+
+ // never hide top-level windows
+ MUIElement containerElement = container;
+ if (containerElement instanceof MWindow && containerElement.getParent() != null) {
+ return;
+ }
+
+ // These elements should neither be shown nor hidden based on their containment state
+ if (isLastEditorStack(containerElement) || containerElement instanceof MPerspective
+ || containerElement instanceof MPerspectiveStack)
+ return;
+
+ Boolean toBeRendered = (Boolean) event.getProperty(UIEvents.EventTags.NEW_VALUE);
+ if (toBeRendered) {
+ // Bring the container back if one of its children goes visible
+ if (!container.isToBeRendered())
+ container.setToBeRendered(true);
+ if (!container.isVisible()
+ && !container.getTags().contains(IPresentationEngine.MINIMIZED))
+ container.setVisible(true);
+ } else {
+ // Never hide the container marked as no_close
+ if (container.getTags().contains(IPresentationEngine.NO_AUTO_COLLAPSE)) {
+ return;
+ }
+
+ int visCount = modelService.countRenderableChildren(container);
+
+ // Remove stacks with no visible children from the display (but not the
+ // model)
+ final MElementContainer<MUIElement> theContainer = container;
+ if (visCount == 0) {
+ Display.getCurrent().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ int visCount = modelService.countRenderableChildren(theContainer);
+ if (!isLastEditorStack(theContainer) && visCount == 0)
+ theContainer.setToBeRendered(false);
+ }
+ });
+ } else {
+ // if there are rendered elements but none are 'visible' we should
+ // make the container invisible as well
+ boolean makeInvisible = true;
+
+ // OK, we have rendered children, are they 'visible' ?
+ for (MUIElement kid : container.getChildren()) {
+ if (!kid.isToBeRendered())
+ continue;
+ if (kid.isVisible()) {
+ makeInvisible = false;
+ break;
+ }
+ }
+
+ if (makeInvisible) {
+ container.setVisible(false);
+ }
+ }
+ }
+ }
+
+ boolean isLastEditorStack(MUIElement element) {
+ return modelService.isLastEditorStack(element);
+ }
+}
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
new file mode 100644
index 0000000000..3ba4f02ddc
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/DnDAddon.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.workbench.addons.dndaddon;
+
+/**
+ *
+ */
+public class DnDAddon {
+
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/README.txt b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/README.txt
new file mode 100644
index 0000000000..9e0cdbab70
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/README.txt
@@ -0,0 +1 @@
+DND is currently not supported \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/Messages.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/Messages.java
new file mode 100644
index 0000000000..0384ee5466
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/Messages.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.workbench.addons.minmax;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ */
+public class Messages extends NLS {
+
+ public static String TrimStack_EmptyStackTooltip;
+ public static String TrimStack_SharedAreaTooltip;
+ public static String TrimStack_CloseText;
+ public static String TrimStack_DefaultOrientationItem;
+ public static String TrimStack_RestoreText;
+ public static String TrimStack_Horizontal;
+ public static String TrimStack_OrientationMenu;
+ public static String TrimStack_Vertical;
+ public static String TrimStack_Show_In_Original_Location;
+
+ private static final String BUNDLE_NAME = "org.eclipse.e4.ui.workbench.addons.minmax.messages";//$NON-NLS-1$
+
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+}
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
new file mode 100644
index 0000000000..a5df2ef9eb
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java
@@ -0,0 +1,1026 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2014, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Lars Vogel (Lars.Vogel@gmail.com) - Bug 331690
+ * Dirk Fauth (dirk.fauth@googlemail.com) - Bug 459285
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.workbench.addons.minmax;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import javax.inject.Inject;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.services.events.IEventBroker;
+import org.eclipse.e4.ui.di.UIEventTopic;
+import org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer;
+import org.eclipse.e4.ui.internal.workbench.swt.AnimationEngine;
+import org.eclipse.e4.ui.internal.workbench.swt.FaderAnimationFeedback;
+import org.eclipse.e4.ui.model.application.MAddon;
+import org.eclipse.e4.ui.model.application.ui.MUIElement;
+import org.eclipse.e4.ui.model.application.ui.SideValue;
+import org.eclipse.e4.ui.model.application.ui.advanced.MArea;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspectiveStack;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder;
+import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
+import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
+import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow;
+import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
+import org.eclipse.e4.ui.model.application.ui.menu.MToolControl;
+import org.eclipse.e4.ui.model.application.ui.menu.impl.MenuFactoryImpl;
+import org.eclipse.e4.ui.workbench.IPresentationEngine;
+import org.eclipse.e4.ui.workbench.UIEvents;
+import org.eclipse.e4.ui.workbench.UIEvents.EventTags;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabFolder2Adapter;
+import org.eclipse.swt.custom.CTabFolderEvent;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.osgi.service.event.Event;
+
+/**
+ * Workbench addon that provides methods to minimize, maximize and restore parts in the window
+ */
+public class MinMaxAddon {
+
+ /**
+ * The identifier for the shared area in the Eclipse Platform. This value should be identical to
+ * the value defined in org.eclipse.ui.IPageLayout.ID_EDITOR_AREA.
+ */
+ private static final String ID_EDITOR_AREA = "org.eclipse.ui.editorss"; //$NON-NLS-1$
+
+ private static final String GLOBAL_CACHE_ID = "Global"; //$NON-NLS-1$
+
+ static String ID_SUFFIX = "(minimized)"; //$NON-NLS-1$
+
+ // tags representing the min/max state (h
+ private static String MINIMIZED = IPresentationEngine.MINIMIZED;
+ private static String MAXIMIZED = IPresentationEngine.MAXIMIZED;
+ private static String MINIMIZED_BY_ZOOM = IPresentationEngine.MINIMIZED_BY_ZOOM;
+
+ @Inject
+ IEventBroker eventBroker;
+
+ @Inject
+ EModelService modelService;
+
+ @Inject
+ private IEclipseContext context;
+
+ @Inject
+ private EPartService partService;
+
+ // Allow 'local' changes to the tags
+ private boolean ignoreTagChanges = false;
+
+ @Inject
+ MAddon minMaxAddon;
+
+ private CTabFolder2Adapter CTFButtonListener = new CTabFolder2Adapter() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private MUIElement getElementToChange(CTabFolderEvent event) {
+ CTabFolder ctf = (CTabFolder) event.widget;
+ MUIElement element = (MUIElement) ctf.getData(AbstractPartRenderer.OWNING_ME);
+ if (element instanceof MArea)
+ return element.getCurSharedRef();
+
+ MUIElement parentElement = element.getParent();
+ while (parentElement != null && !(parentElement instanceof MArea))
+ parentElement = parentElement.getParent();
+
+ return parentElement != null ? parentElement.getCurSharedRef() : element;
+ }
+
+ @Override
+ public void maximize(CTabFolderEvent event) {
+ setState(getElementToChange(event), MAXIMIZED);
+ }
+
+ @Override
+ public void minimize(CTabFolderEvent event) {
+ setState(getElementToChange(event), MINIMIZED);
+ }
+
+ @Override
+ public void restore(CTabFolderEvent event) {
+ setState(getElementToChange(event), null);
+ }
+ };
+
+ private MouseListener CTFDblClickListener = new MouseListener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ // HACK! If this is an empty stack treat it as though it was the editor area
+ // and tear down any open trim stacks (see bug 384814)
+ CTabFolder ctf = (CTabFolder) e.widget;
+ MUIElement element = (MUIElement) ctf.getData(AbstractPartRenderer.OWNING_ME);
+ if (element instanceof MPartStack && ctf.getItemCount() == 0) {
+ MWindow window = modelService.getTopLevelWindowFor(element);
+ if (window != null) {
+ List<MToolControl> tcList = modelService.findElements(window, null,
+ MToolControl.class, null);
+ for (MToolControl tc : tcList) {
+ if (tc.getObject() instanceof TrimStack) {
+ TrimStack ts = (TrimStack) tc.getObject();
+ ts.showStack(false);
+ }
+ }
+ }
+ }
+ }
+
+ private MUIElement getElementToChange(MouseEvent event) {
+ CTabFolder ctf = (CTabFolder) event.widget;
+ MUIElement element = (MUIElement) ctf.getData(AbstractPartRenderer.OWNING_ME);
+ if (element instanceof MArea) {
+ // set the state on the placeholder
+ return element.getCurSharedRef();
+ }
+
+ MUIElement parentElement = element.getParent();
+ while (parentElement != null && !(parentElement instanceof MArea))
+ parentElement = parentElement.getParent();
+
+ return parentElement != null ? parentElement.getCurSharedRef() : element;
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ // only maximize if the primary mouse button was used
+ if (e.button == 1) {
+ CTabFolder ctf = (CTabFolder) e.widget;
+ if (!ctf.getMaximizeVisible())
+ return;
+
+ // Only fire if we're in the 'tab' area
+ if (e.y > ctf.getTabHeight())
+ return;
+
+ MUIElement elementToChange = getElementToChange(e);
+ if (!elementToChange.getTags().contains(MAXIMIZED)) {
+ setState(elementToChange, MAXIMIZED);
+ } else {
+ setState(elementToChange, null);
+ }
+ }
+ }
+ };
+
+ private void setState(MUIElement element, String state) {
+ if (MINIMIZED.equals(state)) {
+ element.getTags().remove(MAXIMIZED);
+ element.getTags().add(MINIMIZED);
+ } else if (MAXIMIZED.equals(state)) {
+ element.getTags().remove(MINIMIZED);
+ element.getTags().add(MAXIMIZED);
+ } else {
+ element.getTags().remove(MINIMIZED);
+ element.getTags().remove(MAXIMIZED);
+ }
+
+ }
+
+ @Inject
+ @Optional
+ private void subscribeTopicWidget(@UIEventTopic(UIEvents.UIElement.TOPIC_WIDGET) Event event) {
+ final MUIElement changedElement = (MUIElement) event.getProperty(EventTags.ELEMENT);
+ if (!(changedElement instanceof MPartStack) && !(changedElement instanceof MArea))
+ return;
+
+ final CTabFolder ctf = getCTFFor(changedElement);
+ if (ctf == null)
+ return;
+
+ MUIElement stateElement = changedElement;
+ if (changedElement instanceof MPartStack) {
+ MPartStack stack = (MPartStack) changedElement;
+ MArea area = getAreaFor(stack);
+ if (area != null && !(area.getWidget() instanceof CTabFolder))
+ stateElement = area.getCurSharedRef();
+ } else if (changedElement instanceof MArea)
+ stateElement = changedElement.getCurSharedRef();
+
+ adjustCTFButtons(stateElement);
+
+ ctf.removeCTabFolder2Listener(CTFButtonListener); // Prevent multiple instances
+ ctf.addCTabFolder2Listener(CTFButtonListener);
+
+ ctf.removeMouseListener(CTFDblClickListener); // Prevent multiple instances
+ ctf.addMouseListener(CTFDblClickListener);
+ }
+
+ /**
+ * Handles removals from the perspective
+ *
+ * @param event
+ */
+
+ @Inject
+ @Optional
+ private void subscribeTopicChildren(
+ @UIEventTopic(UIEvents.ElementContainer.TOPIC_CHILDREN) Event event) {
+ final MUIElement changedElement = (MUIElement) event.getProperty(EventTags.ELEMENT);
+ MWindow window = modelService.getTopLevelWindowFor(changedElement);
+
+ // this method is intended to update the minimized stacks in a trim
+ // if the removed element is no perspective and the top level window
+ // is not a trimmed window, we don't need to do anything here
+ if (!(changedElement instanceof MPerspectiveStack) || window == null || !(window instanceof MTrimmedWindow)) {
+ return;
+ }
+
+ if (UIEvents.isREMOVE(event)) {
+ for (Object removedElement : UIEvents.asIterable(event, UIEvents.EventTags.OLD_VALUE)) {
+ MUIElement removed = (MUIElement) removedElement;
+ String perspectiveId = removed.getElementId();
+
+ MTrimBar bar = modelService.getTrim((MTrimmedWindow) window, SideValue.TOP);
+
+ // gather up any minimized stacks for this perspective...
+ List<MToolControl> toRemove = new ArrayList<MToolControl>();
+ for (MUIElement child : bar.getChildren()) {
+ String trimElementId = child.getElementId();
+ if (child instanceof MToolControl && trimElementId.contains(perspectiveId)) {
+ toRemove.add((MToolControl) child);
+ }
+ }
+
+ // ...and remove them
+ for (MToolControl minStack : toRemove) {
+ minStack.setToBeRendered(false);
+ bar.getChildren().remove(minStack);
+ }
+ }
+ }
+ }
+
+ /**
+ * Handles changes of the perspective
+ *
+ * @param event
+ */
+
+ @Inject
+ @Optional
+ private void subscribeTopicSelectedElement(
+ @UIEventTopic(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT) Event event) {
+ final MUIElement changedElement = (MUIElement) event.getProperty(EventTags.ELEMENT);
+ if (!(changedElement instanceof MPerspectiveStack))
+ return;
+
+ MPerspectiveStack ps = (MPerspectiveStack) changedElement;
+ MWindow window = modelService.getTopLevelWindowFor(ps);
+ List<MToolControl> tcList = modelService.findElements(window, null, MToolControl.class,
+ null);
+
+ final MPerspective curPersp = ps.getSelectedElement();
+ if (curPersp != null) {
+ List<String> tags = new ArrayList<String>();
+ tags.add(IPresentationEngine.MINIMIZED);
+
+ List<MUIElement> minimizedElements = modelService.findElements(curPersp, null,
+ MUIElement.class, tags);
+ // Show any minimized stack from the current perspective
+ String perspId = '(' + curPersp.getElementId() + ')';
+ for (MUIElement ele : minimizedElements) {
+ String fullId = ele.getElementId() + perspId;
+
+ for (MToolControl tc : tcList) {
+ if (fullId.equals(tc.getElementId())) {
+ tc.setToBeRendered(true);
+ }
+ }
+ }
+
+ // Find the editor 'area'
+ MPlaceholder eaPlaceholder = (MPlaceholder) modelService.find(ID_EDITOR_AREA, curPersp);
+ adjustCTFButtons(eaPlaceholder);
+ }
+
+ // Hide any minimized stacks from the old perspective
+ if (event.getProperty(EventTags.OLD_VALUE) instanceof MPerspective) {
+ MPerspective oldPersp = (MPerspective) event.getProperty(EventTags.OLD_VALUE);
+ String perspId = '(' + oldPersp.getElementId() + ')';
+ for (MToolControl tc : tcList) {
+ if (tc.getObject() instanceof TrimStack && tc.getElementId().contains(perspId)) {
+ TrimStack ts = (TrimStack) tc.getObject();
+ ts.showStack(false);
+ tc.setToBeRendered(false);
+ }
+ }
+ }
+
+ final Shell winShell = (Shell) window.getWidget();
+ winShell.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (!winShell.isDisposed()) {
+ winShell.layout(true, true);
+ }
+ }
+ });
+ }
+
+ /**
+ * Handles changes in tags
+ *
+ * @param event
+ */
+
+ @Inject
+ @Optional
+ private void subscribeTopicTagsChanged(
+ @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TAGS) Event event) {
+ if (ignoreTagChanges)
+ return;
+
+ Object changedObj = event.getProperty(EventTags.ELEMENT);
+
+ if (!(changedObj instanceof MUIElement))
+ return;
+
+ final MUIElement changedElement = (MUIElement) changedObj;
+
+ if (UIEvents.isADD(event)) {
+ if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE, MINIMIZED)) {
+ minimize(changedElement);
+ } else if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE, MAXIMIZED)) {
+ maximize(changedElement);
+ }
+ } else if (UIEvents.isREMOVE(event)) {
+ if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE, MINIMIZED)) {
+ restore(changedElement);
+ } else if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE, MAXIMIZED)) {
+ unzoom(changedElement);
+ }
+ }
+ }
+
+ /**
+ * Handles changes in the id of the element If a perspective ID changes fix
+ * any TrimStacks that reference the old id to point at the new id.
+ *
+ * This keeps trim stacks attached to the correct perspective when a
+ * perspective is saved with a new name.
+ *
+ * @param event
+ */
+
+ @Inject
+ @Optional
+ private void subscribeTopicElementId(
+ @UIEventTopic(UIEvents.ApplicationElement.TOPIC_ELEMENTID) Event event) {
+ Object changedObject = event.getProperty(EventTags.ELEMENT);
+
+ // Only care about MPerspective id changes
+ if (!(changedObject instanceof MPerspective))
+ return;
+
+ MPerspective perspective = (MPerspective) changedObject;
+
+ String newID = (String) event.getProperty(UIEvents.EventTags.NEW_VALUE);
+ String oldID = (String) event.getProperty(UIEvents.EventTags.OLD_VALUE);
+
+ // pattern is trimStackID(perspectiveID)
+ newID = '(' + newID + ')';
+ oldID = '(' + oldID + ')';
+
+ // Search the trim for the window containing the perspective
+ MWindow perspWin = modelService.getTopLevelWindowFor(perspective);
+ if (perspWin == null)
+ return;
+
+ List<MToolControl> trimStacks = modelService.findElements(perspWin, null,
+ MToolControl.class, null);
+ for (MToolControl trimStack : trimStacks) {
+ // Only care about MToolControls that are TrimStacks
+ if (TrimStack.CONTRIBUTION_URI.equals(trimStack.getContributionURI()))
+ trimStack.setElementId(trimStack.getElementId().replace(oldID, newID));
+ }
+ }
+
+ /**
+ * Handles the event that the perspective is saved
+ *
+ * @param event
+ */
+
+ @Inject
+ @Optional
+ private void subscribeTopicPerspSaved(
+ @UIEventTopic(UIEvents.UILifeCycle.PERSPECTIVE_SAVED) Event event) {
+ final MPerspective savedPersp = (MPerspective) event.getProperty(EventTags.ELEMENT);
+ String cache = getTrimCache(savedPersp);
+ minMaxAddon.getPersistedState().put(savedPersp.getElementId(), cache);
+ }
+
+ private String getTrimCache(MPerspective savedPersp) {
+ MWindow topWin = modelService.getTopLevelWindowFor(savedPersp);
+ String perspIdStr = '(' + savedPersp.getElementId() + ')';
+
+ String cache = getWinCache(topWin, perspIdStr);
+ for (MWindow dw : savedPersp.getWindows()) {
+ cache += getWinCache(dw, perspIdStr);
+ }
+
+ return cache;
+ }
+
+ private String getWinCache(MWindow win, String perspIdStr) {
+ String winStr = ""; //$NON-NLS-1$
+
+ List<MPartStack> stackList = modelService.findElements(win, null, MPartStack.class, null);
+ for (MPartStack stack : stackList) {
+ winStr += getStackTrimLoc(stack, perspIdStr);
+ }
+ return winStr;
+ }
+
+ private String getStackTrimLoc(MPartStack stack, String perspIdStr) {
+ MWindow stackWin = modelService.getTopLevelWindowFor(stack);// getContainingWindow(stack);
+ MUIElement tcElement = modelService.find(stack.getElementId() + perspIdStr, stackWin);
+ if (tcElement == null)
+ return ""; //$NON-NLS-1$
+
+ MTrimBar bar = (MTrimBar) ((MUIElement) tcElement.getParent());
+ int sideVal = bar.getSide().getValue();
+ int index = bar.getChildren().indexOf(tcElement);
+ return stack.getElementId() + ' ' + sideVal + ' ' + index + "#"; //$NON-NLS-1$
+ }
+
+ /**
+ * Handles the event that the perspective is reset
+ *
+ * @param event
+ */
+ @Inject
+ @Optional
+ private void subscribeTopicPerspReset(@UIEventTopic(UIEvents.UILifeCycle.PERSPECTIVE_RESET) Event event) {
+ final MPerspective resetPersp = (MPerspective) event.getProperty(EventTags.ELEMENT);
+
+ // Find any minimized stacks and show their trim
+ List<MUIElement> minimizedElements = modelService.findElements(resetPersp, null, MUIElement.class,
+ Arrays.asList(IPresentationEngine.MINIMIZED));
+ for (MUIElement element : minimizedElements) {
+ createTrim(element);
+ }
+ }
+
+ /**
+ * Handles the event that the perspective is opened
+ *
+ * @param event
+ */
+ @Inject
+ @Optional
+ private void subscribeTopicPerspOpened(
+ @UIEventTopic(UIEvents.UILifeCycle.PERSPECTIVE_OPENED) Event event) {
+ final MPerspective openedPersp = (MPerspective) event.getProperty(EventTags.ELEMENT);
+
+ // Find any minimized stacks and show their trim
+ List<MUIElement> minimizedElements = modelService.findElements(openedPersp, null,
+ MUIElement.class, Arrays.asList(IPresentationEngine.MINIMIZED));
+ for (MUIElement element : minimizedElements) {
+ createTrim(element);
+ }
+ }
+
+ private MArea getAreaFor(MPartStack stack) {
+ MUIElement parent = stack.getParent();
+ while (parent != null) {
+ if (parent instanceof MArea)
+ return (MArea) parent;
+ parent = parent.getParent();
+ }
+ return null;
+ }
+
+ private void setCTFButtons(CTabFolder ctf, MUIElement stateElement, boolean hideButtons) {
+ if (hideButtons) {
+ ctf.setMinimizeVisible(false);
+ ctf.setMaximizeVisible(false);
+ } else {
+ if (stateElement.getTags().contains(MINIMIZED)) {
+ ctf.setMinimizeVisible(false);
+ ctf.setMaximizeVisible(true);
+ ctf.setMaximized(true);
+ } else if (stateElement.getTags().contains(MAXIMIZED)) {
+ ctf.setMinimizeVisible(true);
+ ctf.setMaximizeVisible(true);
+ ctf.setMaximized(true);
+ } else {
+ ctf.setMinimizeVisible(true);
+ ctf.setMaximizeVisible(true);
+ ctf.setMinimized(false);
+ ctf.setMaximized(false);
+ ctf.layout();
+ }
+ }
+ }
+
+ /**
+ * Set the state of the min / max buttons on the CTF based on the model
+ * element's state. The input is expected to be the element that contains
+ * the min/max state info which should either be an MPartStack or an
+ * MPlaceholder for the shared area.
+ *
+ * @param element
+ * The element to test
+ */
+ private void adjustCTFButtons(MUIElement element) {
+ if (!(element instanceof MPartStack) && !(element instanceof MPlaceholder))
+ return;
+
+ CTabFolder ctf = getCTFFor(element);
+ if (ctf == null)
+ return;
+
+ if (element instanceof MPlaceholder) {
+ setCTFButtons(ctf, element, false);
+ } else {
+ MArea area = getAreaFor((MPartStack) element);
+ if (area == null) {
+ setCTFButtons(ctf, element, false);
+ }
+ }
+ }
+
+ private CTabFolder getCTFFor(MUIElement element) {
+ if (element instanceof MArea) {
+ if (element.getWidget() instanceof CTabFolder)
+ return (CTabFolder) element.getWidget();
+ List<MPartStack> stacks = modelService.findElements(element, null, MPartStack.class,
+ null);
+ for (MPartStack stack : stacks) {
+ if (stack.getWidget() instanceof CTabFolder)
+ return (CTabFolder) stack.getWidget();
+ }
+ } else if (element.getWidget() instanceof CTabFolder)
+ return (CTabFolder) element.getWidget();
+ else if (element instanceof MPlaceholder) {
+ MPlaceholder ph = (MPlaceholder) element;
+ if (ph.getRef() instanceof MArea) {
+ return getCTFFor(ph.getRef());
+ }
+ }
+ return null;
+ }
+
+ boolean isEmptyPerspectiveStack(MUIElement element) {
+ if (!(element instanceof MPerspectiveStack))
+ return false;
+ MPerspectiveStack ps = (MPerspectiveStack) element;
+ return ps.getChildren().size() == 0;
+ }
+
+ void minimize(MUIElement element) {
+ // Can't minimize a non-rendered element
+ if (!element.isToBeRendered())
+ return;
+
+ if (isEmptyPerspectiveStack(element)) {
+ element.setVisible(false);
+ return;
+ }
+
+ createTrim(element);
+ element.setVisible(false);
+ adjustCTFButtons(element);
+ // Activate a part other than the trimStack so that if the tool item is pressed
+ // immediately it will still open the stack.
+ partService.requestActivation();
+ }
+
+ void restore(MUIElement element) {
+ MWindow window = modelService.getTopLevelWindowFor(element);
+ String trimId = element.getElementId() + getMinimizedElementSuffix(element);
+ MToolControl trimStack = (MToolControl) modelService.find(trimId, window);
+ if (trimStack == null || trimStack.getObject() == null) {
+ if (element instanceof MPerspectiveStack) {
+ element.setVisible(true);
+ }
+ return;
+ }
+
+ TrimStack ts = (TrimStack) trimStack.getObject();
+ ts.restoreStack();
+
+ adjustCTFButtons(element);
+
+ List<String> maximizeTag = new ArrayList<String>();
+ maximizeTag.add(IPresentationEngine.MAXIMIZED);
+ List<MUIElement> curMax = modelService.findElements(window, null, MUIElement.class,
+ maximizeTag, EModelService.PRESENTATION);
+ if (curMax.size() > 0) {
+ MUIElement maxElement = curMax.get(0);
+ List<MUIElement> elementsLeftToRestore = getElementsToRestore(maxElement);
+
+ // Are any stacks still minimized ?
+ boolean unMax = true;
+ for (MUIElement toRestore : elementsLeftToRestore) {
+ if (!toRestore.isVisible())
+ unMax = false;
+ }
+ if (unMax) {
+ maxElement.getTags().remove(IPresentationEngine.MAXIMIZED);
+ }
+ }
+ }
+
+ void maximize(final MUIElement element) {
+ if (!element.isToBeRendered())
+ return;
+
+ List<MUIElement> elementsToMinimize = getElementsToMinimize(element);
+ Shell hostShell = (Shell) modelService.getTopLevelWindowFor(element).getWidget();
+ MWindow win = getWindowFor(element);
+
+ FaderAnimationFeedback fader = new FaderAnimationFeedback(hostShell);
+ AnimationEngine engine = new AnimationEngine(win.getContext(), fader, 300);
+ engine.schedule();
+
+ // Restore any currently maximized element
+ restoreMaximizedElement(element, win);
+
+ for (MUIElement toMinimize : elementsToMinimize) {
+ toMinimize.getTags().add(MINIMIZED);
+ toMinimize.getTags().add(MINIMIZED_BY_ZOOM);
+ }
+
+ adjustCTFButtons(element);
+ }
+
+ /**
+ * @param element
+ * @return The list of elements that need to be minimized during a maximize
+ */
+ private List<MUIElement> getElementsToMinimize(MUIElement element) {
+ MWindow win = getWindowFor(element);
+ MPerspective persp = modelService.getActivePerspective(win);
+
+ List<MUIElement> elementsToMinimize = new ArrayList<MUIElement>();
+ int loc = modelService.getElementLocation(element);
+ if ((loc & EModelService.OUTSIDE_PERSPECTIVE) != 0) {
+ // Minimize all other global stacks
+ List<MPartStack> globalStacks = modelService.findElements(win, null, MPartStack.class,
+ null, EModelService.OUTSIDE_PERSPECTIVE);
+ for (MPartStack gStack : globalStacks) {
+ if (gStack == element || !gStack.isToBeRendered())
+ continue;
+
+ if (gStack.getWidget() != null && !gStack.getTags().contains(MINIMIZED)) {
+ elementsToMinimize.add(gStack);
+ }
+ }
+
+ // Minimize the Perspective Stack
+ MUIElement perspStack = null;
+ if (persp == null) {
+ // special case for windows with no perspectives (eg bug 372614:
+ // intro part with no perspectives). We know we're outside
+ // of the perspective stack, so find it top-down
+ List<MPerspectiveStack> pStacks = modelService.findElements(win, null,
+ MPerspectiveStack.class, null);
+ perspStack = (pStacks.size() > 0) ? pStacks.get(0) : null;
+ } else {
+ perspStack = persp.getParent();
+ }
+ if (perspStack != null) {
+ if (perspStack.getElementId() == null || perspStack.getElementId().length() == 0)
+ perspStack.setElementId("PerspectiveStack"); //$NON-NLS-1$
+
+ elementsToMinimize.add(perspStack);
+ }
+ } else {
+ List<MPartStack> stacks = modelService.findElements(persp == null ? win : persp, null,
+ MPartStack.class, null, EModelService.PRESENTATION);
+ for (MPartStack theStack : stacks) {
+ if (theStack == element || !theStack.isToBeRendered())
+ continue;
+
+ // Exclude stacks in DW's
+ if (getWindowFor(theStack) != win)
+ continue;
+
+ loc = modelService.getElementLocation(theStack);
+ if (loc != EModelService.IN_SHARED_AREA && theStack.getWidget() != null
+ && theStack.isVisible() && !theStack.getTags().contains(MINIMIZED)) {
+ elementsToMinimize.add(theStack);
+ }
+ }
+
+ // Find any 'standalone' views *not* in a stack
+ List<String> standaloneTag = new ArrayList<String>();
+ standaloneTag.add(IPresentationEngine.STANDALONE);
+ List<MPlaceholder> standaloneViews = modelService.findElements(persp == null ? win
+ : persp, null, MPlaceholder.class, standaloneTag, EModelService.PRESENTATION);
+ for (MPlaceholder part : standaloneViews) {
+ if (!part.isToBeRendered())
+ continue;
+ elementsToMinimize.add(part);
+ }
+
+ // Find the editor 'area'
+ if (persp != null) {
+ MPlaceholder eaPlaceholder = (MPlaceholder) modelService
+ .find(ID_EDITOR_AREA, persp);
+ if (element != eaPlaceholder && eaPlaceholder != null
+ && eaPlaceholder.getWidget() != null && eaPlaceholder.isVisible()) {
+ elementsToMinimize.add(eaPlaceholder);
+ }
+ }
+ }
+
+ return elementsToMinimize;
+ }
+
+ /**
+ * Restore any currently maximized element (except the one we're in the
+ * process of maximizing
+ *
+ * @param element
+ * @param win
+ */
+ private void restoreMaximizedElement(final MUIElement element, MWindow win) {
+ MPerspective elePersp = modelService.getPerspectiveFor(element);
+ List<String> maxTag = new ArrayList<String>();
+ maxTag.add(MAXIMIZED);
+ List<MUIElement> curMax = modelService.findElements(win, null, MUIElement.class, maxTag);
+ if (curMax.size() > 0) {
+ for (MUIElement maxElement : curMax) {
+ // Only unmax elements in this window
+ if (getWindowFor(maxElement) != win)
+ continue;
+
+ MPerspective maxPersp = modelService.getPerspectiveFor(maxElement);
+ if (maxPersp != elePersp)
+ continue;
+ if (maxElement == element)
+ continue;
+ ignoreTagChanges = true;
+ try {
+ maxElement.getTags().remove(MAXIMIZED);
+ } finally {
+ ignoreTagChanges = false;
+ }
+ }
+ }
+ }
+
+ /**
+ * Return the MWindow containing this element (if any). This may either be a
+ * 'top level' window -or- a detached window. This allows the min.max code
+ * to only affect elements in the window containing the element.
+ *
+ * @param element
+ * The element to check
+ *
+ * @return the window containing the element.
+ */
+ private MWindow getWindowFor(MUIElement element) {
+ MUIElement parent = element.getParent();
+
+ // We rely here on the fact that a DW's 'getParent' will return
+ // null since it's not in the 'children' hierarchy
+ while (parent != null && !(parent instanceof MWindow))
+ parent = parent.getParent();
+
+ // A detached window will end up with getParent() == null
+ return (MWindow) parent;
+ }
+
+ void unzoom(final MUIElement element) {
+ MWindow win = getWindowFor(element);
+
+ Shell hostShell = (Shell) win.getWidget();
+ FaderAnimationFeedback fader = new FaderAnimationFeedback(hostShell);
+ AnimationEngine engine = new AnimationEngine(win.getContext(), fader, 300);
+ engine.schedule();
+
+ List<MUIElement> elementsToRestore = getElementsToRestore(element);
+ for (MUIElement toRestore : elementsToRestore) {
+ toRestore.getTags().remove(IPresentationEngine.MINIMIZED_BY_ZOOM);
+ toRestore.getTags().remove(IPresentationEngine.MINIMIZED);
+ }
+
+ adjustCTFButtons(element);
+
+ // There are more views available to be active...
+ partService.requestActivation();
+ }
+
+ /**
+ * @param element
+ * @return The list of elements that need to be restored by an unzoom
+ */
+ private List<MUIElement> getElementsToRestore(MUIElement element) {
+ MWindow win = getWindowFor(element);
+ MPerspective persp = modelService.getActivePerspective(win);
+
+ List<MUIElement> elementsToRestore = new ArrayList<MUIElement>();
+
+ List<String> minTag = new ArrayList<String>();
+ minTag.add(IPresentationEngine.MINIMIZED_BY_ZOOM);
+
+ // Restore any minimized stacks
+ boolean outsidePerspectives = (modelService.getElementLocation(element) & EModelService.OUTSIDE_PERSPECTIVE) != 0;
+ List<MPartStack> stacks = modelService.findElements(win, null, MPartStack.class, minTag,
+ EModelService.PRESENTATION);
+ for (MPartStack theStack : stacks) {
+ if (theStack.getWidget() != null) {
+ // Make sure we don't restore perspective-based stacks if we're
+ // unzoooming an element outside the perspectives
+ if (outsidePerspectives) {
+ int stackLoc = modelService.getElementLocation(theStack);
+ if ((stackLoc & EModelService.OUTSIDE_PERSPECTIVE) == 0)
+ continue;
+ }
+
+ // Make sure we're only working on *our* window
+ if (getWindowFor(theStack) == win) {
+ elementsToRestore.add(theStack);
+ }
+ }
+ }
+
+ // Restore any minimized standalone views
+ List<MPlaceholder> views = modelService.findElements(win, null, MPlaceholder.class, minTag,
+ EModelService.PRESENTATION);
+ for (MPlaceholder ph : views) {
+ if (ph.getWidget() != null && getWindowFor(ph) == win) {
+ elementsToRestore.add(ph);
+ }
+ }
+
+ // Find the editor 'area'
+ MPlaceholder eaPlaceholder = (MPlaceholder) modelService.find(ID_EDITOR_AREA,
+ persp == null ? win : persp);
+ if (element != eaPlaceholder && eaPlaceholder != null
+ && eaPlaceholder.getTags().contains(MINIMIZED_BY_ZOOM)) {
+ elementsToRestore.add(eaPlaceholder);
+ }
+
+ // Find the Perspective Stack
+ int loc = modelService.getElementLocation(element);
+ if ((loc & EModelService.OUTSIDE_PERSPECTIVE) != 0) {
+ List<MPerspectiveStack> psList = modelService.findElements(win, null,
+ MPerspectiveStack.class, null);
+ if (psList.size() == 1) {
+ MPerspectiveStack perspStack = psList.get(0);
+ if (element != perspStack && perspStack != null
+ && perspStack.getTags().contains(MINIMIZED_BY_ZOOM)) {
+ elementsToRestore.add(perspStack);
+ }
+ }
+ }
+
+ return elementsToRestore;
+ }
+
+ private void createTrim(MUIElement element) {
+ MWindow win = getWindowFor(element);
+ if (!(win instanceof MTrimmedWindow)) {
+ return;
+ }
+
+ MTrimmedWindow window = (MTrimmedWindow) win;
+ Shell winShell = (Shell) window.getWidget();
+
+ // Is there already a TrimControl there ?
+ String trimId = element.getElementId() + getMinimizedElementSuffix(element);
+ MToolControl trimStack = (MToolControl) modelService.find(trimId, window);
+
+ if (trimStack == null) {
+ trimStack = MenuFactoryImpl.eINSTANCE.createToolControl();
+ trimStack.setElementId(trimId);
+ trimStack.setContributionURI(TrimStack.CONTRIBUTION_URI);
+ trimStack.getTags().add("TrimStack"); //$NON-NLS-1$
+
+ // Check if we have a cached location
+ MTrimBar bar = getBarForElement(element, window);
+ int index = getCachedIndex(element);
+ if (index == -1 || index >= bar.getChildren().size())
+ bar.getChildren().add(trimStack);
+ else
+ bar.getChildren().add(index, trimStack);
+
+ bar.setVisible(true);
+
+ // get the parent trim bar, see bug 320756
+ if (bar.getWidget() == null) {
+ // ask it to be rendered
+ bar.setToBeRendered(true);
+
+ // create the widget
+ context.get(IPresentationEngine.class)
+ .createGui(bar, winShell, window.getContext());
+ }
+ } else {
+ // get the parent trim bar, see bug 320756
+ MUIElement parent = trimStack.getParent();
+ parent.setVisible(true);
+ if (parent.getWidget() == null) {
+ // ask it to be rendered
+ parent.setToBeRendered(true);
+ // create the widget
+ context.get(IPresentationEngine.class).createGui(parent, winShell,
+ window.getContext());
+ }
+ trimStack.setToBeRendered(true);
+ }
+ }
+
+ private String getCachedInfo(MUIElement element) {
+ String cacheId = GLOBAL_CACHE_ID;
+ MPerspective persp = modelService.getPerspectiveFor(element);
+ if (persp != null)
+ cacheId = persp.getElementId();
+ String cacheInfo = minMaxAddon.getPersistedState().get(cacheId);
+
+ return cacheInfo;
+ }
+
+ private int getCachedIndex(MUIElement element) {
+ String cache = getCachedInfo(element);
+ if (cache == null)
+ return -1;
+
+ String[] stacks = cache.split("#"); //$NON-NLS-1$
+ for (String stackInfo : stacks) {
+ String[] vals = stackInfo.split(" "); //$NON-NLS-1$
+ if (vals[0].equals(element.getElementId())) {
+ return Integer.parseInt(vals[2]);
+ }
+ }
+ return -1;
+ }
+
+ private SideValue getCachedBar(MUIElement element) {
+ String cache = getCachedInfo(element);
+ if (cache == null)
+ return null;
+
+ String[] stacks = cache.split("#"); //$NON-NLS-1$
+ for (String stackInfo : stacks) {
+ String[] vals = stackInfo.split(" "); //$NON-NLS-1$
+ if (vals[0].equals(element.getElementId())) {
+ int sideVal = Integer.parseInt(vals[1]);
+ return SideValue.get(sideVal);
+ }
+ }
+ return null;
+ }
+
+ private MTrimBar getBarForElement(MUIElement element, MTrimmedWindow window) {
+ SideValue side = getCachedBar(element);
+ if (side == null) {
+ Shell winShell = (Shell) window.getWidget();
+ Rectangle winBounds = winShell.getBounds();
+ int winCenterX = winBounds.width / 2;
+ Control stackCtrl = (Control) element.getWidget();
+ Rectangle stackBounds = stackCtrl.getBounds();
+ stackBounds = winShell.getDisplay().map(stackCtrl, winShell, stackBounds);
+ int stackCenterX = stackBounds.x + (stackBounds.width / 2);
+ side = stackCenterX < winCenterX ? SideValue.LEFT : SideValue.RIGHT;
+ }
+ MTrimBar bar = modelService.getTrim(window, side);
+
+ return bar;
+ }
+
+ private String getMinimizedElementSuffix(MUIElement element) {
+ String id = ID_SUFFIX;
+ MPerspective persp = modelService.getPerspectiveFor(element);
+ if (persp != null) {
+ id = '(' + persp.getElementId() + ')';
+ }
+ return id;
+ }
+}
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
new file mode 100644
index 0000000000..5b53b238e1
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
@@ -0,0 +1,1305 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2014, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Lars.Vogel@vogella.com - Bug 454712
+ * dirk.fauth@googlemail.com - Bug 446095
+ ******************************************************************************/
+package org.eclipse.e4.ui.workbench.addons.minmax;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.services.events.IEventBroker;
+import org.eclipse.e4.ui.di.UIEventTopic;
+import org.eclipse.e4.ui.internal.workbench.swt.CSSRenderingUtils;
+import org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener;
+import org.eclipse.e4.ui.model.application.ui.MElementContainer;
+import org.eclipse.e4.ui.model.application.ui.MGenericStack;
+import org.eclipse.e4.ui.model.application.ui.MUIElement;
+import org.eclipse.e4.ui.model.application.ui.MUILabel;
+import org.eclipse.e4.ui.model.application.ui.SideValue;
+import org.eclipse.e4.ui.model.application.ui.advanced.MArea;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspectiveStack;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder;
+import org.eclipse.e4.ui.model.application.ui.basic.MCompositePart;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
+import org.eclipse.e4.ui.model.application.ui.basic.MStackElement;
+import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
+import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
+import org.eclipse.e4.ui.model.application.ui.menu.MToolControl;
+import org.eclipse.e4.ui.workbench.IPresentationEngine;
+import org.eclipse.e4.ui.workbench.IResourceUtilities;
+import org.eclipse.e4.ui.workbench.UIEvents;
+import org.eclipse.e4.ui.workbench.UIEvents.EventTags;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.renderers.swt.TrimmedPartLayout;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.osgi.service.event.EventHandler;
+
+
+/**
+ * Class for representing window trim containing minimized views and shared areas
+ */
+public class TrimStack {
+
+ /**
+ * Contribution URI for this class
+ */
+ public static String CONTRIBUTION_URI = "bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.minmax.TrimStack"; //$NON-NLS-1$
+
+ private static final String LAYOUT_ICON_URI = "platform:/plugin/org.eclipse.e4.ui.workbench.addons.swt/icons/full/obj16/layout_co.gif"; //$NON-NLS-1$
+
+ private static final String RESTORE_ICON_URI = "platform:/plugin/org.eclipse.e4.ui.workbench.addons.swt/icons/full/etool16/fastview_restore.gif"; //$NON-NLS-1$
+
+ public static final String USE_OVERLAYS_KEY = "UseOverlays"; //$NON-NLS-1$
+
+ static final String STATE_XSIZE = "XSize"; //$NON-NLS-1$
+
+ static final String STATE_YSIZE = "YSize"; //$NON-NLS-1$
+
+ public static final String MINIMIZED_AND_SHOWING = "MinimizedAndShowing"; //$NON-NLS-1$
+
+ private Image layoutImage;
+
+ private Image restoreImage;
+
+ private ToolBar trimStackTB;
+
+ /**
+ * The context menu for this trim stack's items.
+ */
+ private Menu trimStackMenu;
+
+ private boolean cachedUseOverlays = true;
+ private boolean isShowing = false;
+ private MUIElement minimizedElement;
+ // private Composite clientAreaComposite;
+ private Composite hostPane;
+
+ @Inject
+ @Named("org.eclipse.e4.ui.workbench.IResourceUtilities")
+ private IResourceUtilities<ImageDescriptor> resUtils;
+
+ /**
+ * A map of created images from a part's icon URI path.
+ */
+ private Map<String, Image> imageMap = new HashMap<String, Image>();
+
+ ControlListener caResizeListener = new ControlListener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ if (hostPane != null && hostPane.isVisible())
+ setPaneLocation();
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ }
+ };
+
+ // Listens to ESC and closes the active fast view
+ private Listener escapeListener = new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ if (event.character == SWT.ESC) {
+ showStack(false);
+ partService.requestActivation();
+ }
+ }
+ };
+
+ @Inject
+ EModelService modelService;
+
+ @Inject
+ EPartService partService;
+
+ @Inject
+ MWindow window;
+
+ @Inject
+ MToolControl toolControl;
+
+ @Inject
+ protected IEventBroker eventBroker;
+
+ @Inject
+ @Optional
+ private void subscribeTopicTagsChanged(
+ @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TAGS) org.osgi.service.event.Event event) {
+ Object changedObj = event.getProperty(EventTags.ELEMENT);
+
+ if (!(changedObj instanceof MToolControl))
+ return;
+
+ final MToolControl changedElement = (MToolControl) changedObj;
+ if (changedElement.getObject() != this)
+ return;
+
+ if (UIEvents.isREMOVE(event)) {
+ if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE, MINIMIZED_AND_SHOWING)) {
+ showStack(false);
+ }
+ }
+ }
+
+ private Image getOverrideImage(MUIElement element) {
+ Image result = null;
+
+ Object imageObject = element.getTransientData().get(
+ IPresentationEngine.OVERRIDE_ICON_IMAGE_KEY);
+ if (imageObject != null && imageObject instanceof Image
+ && !((Image) imageObject).isDisposed())
+ result = (Image) imageObject;
+ return result;
+ }
+
+ private String getOverrideTitleToolTip(MUIElement element) {
+ String result = null;
+
+ Object stringObject = element.getTransientData().get(
+ IPresentationEngine.OVERRIDE_TITLE_TOOL_TIP_KEY);
+ if (stringObject != null && stringObject instanceof String)
+ result = (String) stringObject;
+
+ if (result == null || result.length() == 0)
+ return null;
+
+ if (element instanceof MUILabel) {
+ String label = ((MUILabel)element).getLocalizedLabel();
+ if (label != null && label.length() > 0) {
+ result = label + ' ' + '(' + result + ')';
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * This is the new way to handle UIEvents (as opposed to subscring and unsubscribing them with
+ * the event broker.
+ *
+ * The method is described in detail at http://wiki.eclipse.org/Eclipse4/RCP/Event_Model
+ */
+ @SuppressWarnings("unchecked")
+ @Inject
+ @Optional
+ private void handleTransientDataEvents(
+ @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TRANSIENTDATA) org.osgi.service.event.Event event) {
+ // Prevent exceptions on shutdown
+ if (trimStackTB == null || trimStackTB.isDisposed() || minimizedElement.getWidget() == null)
+ return;
+
+ Object changedElement = event.getProperty(UIEvents.EventTags.ELEMENT);
+ if (!(changedElement instanceof MUIElement)) {
+ return;
+ }
+
+ String key;
+ if (UIEvents.isREMOVE(event)) {
+ key = ((Entry<String, Object>) event.getProperty(UIEvents.EventTags.OLD_VALUE))
+ .getKey();
+ } else {
+ key = ((Entry<String, Object>) event.getProperty(UIEvents.EventTags.NEW_VALUE))
+ .getKey();
+ }
+
+ if (key.equals(IPresentationEngine.OVERRIDE_ICON_IMAGE_KEY)) {
+ ToolItem toolItem = getChangedToolItem((MUIElement) changedElement);
+ if (toolItem != null)
+ toolItem.setImage(getImage((MUILabel) toolItem.getData()));
+ } else if (key.equals(IPresentationEngine.OVERRIDE_TITLE_TOOL_TIP_KEY)) {
+ ToolItem toolItem = getChangedToolItem((MUIElement) changedElement);
+ if (toolItem != null)
+ toolItem.setToolTipText(getLabelText((MUILabel) toolItem.getData()));
+ }
+ }
+
+ private ToolItem getChangedToolItem(MUIElement changedElement) {
+ ToolItem[] toolItems = trimStackTB.getItems();
+ for (ToolItem toolItem : toolItems) {
+ if (changedElement.equals(toolItem.getData())) {
+ return toolItem;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * This is the old way to subscribe to UIEvents. You should consider using the new way as shown
+ * by handleTransientDataEvents() and described in the article at
+ * http://wiki.eclipse.org/Eclipse4/RCP/Event_Model
+ */
+ private EventHandler closeHandler = new EventHandler() {
+ @Override
+ public void handleEvent(org.osgi.service.event.Event event) {
+ if (!isShowing)
+ return;
+
+ // The only time we don't close is if I've selected my tab.
+ MUIElement changedElement = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
+
+ // Perspective changed, close the visible stacks
+ if (changedElement instanceof MPerspectiveStack) {
+ showStack(false);
+ return;
+ }
+
+ if (changedElement instanceof MCompositePart) {
+ MPart innerPart = getLeafPart(changedElement);
+ if (innerPart != null) {
+ fixToolItemSelection();
+ return;
+ }
+ }
+
+ if (changedElement == getLeafPart(minimizedElement)) {
+ fixToolItemSelection();
+ return;
+ }
+
+ showStack(false);
+ }
+ };
+
+ // Close any open stacks before shutting down
+ private EventHandler shutdownHandler = new EventHandler() {
+ @Override
+ public void handleEvent(org.osgi.service.event.Event event) {
+ showStack(false);
+ }
+ };
+
+ private void fixToolItemSelection() {
+ if (trimStackTB == null || trimStackTB.isDisposed())
+ return;
+
+ if (!isShowing) {
+ // Not open...no selection
+ for (ToolItem item : trimStackTB.getItems()) {
+ item.setSelection(false);
+ }
+ } else {
+ if (isEditorStack() || minimizedElement instanceof MPlaceholder) {
+ trimStackTB.getItem(1).setSelection(true);
+ } else if (isPerspectiveStack()) {
+ MPerspectiveStack pStack = (MPerspectiveStack) minimizedElement;
+ MUIElement selElement = pStack.getSelectedElement();
+ for (ToolItem item : trimStackTB.getItems()) {
+ item.setSelection(item.getData() == selElement);
+ }
+ } else {
+ MPartStack partStack = (MPartStack) minimizedElement;
+ MUIElement selElement = partStack.getSelectedElement();
+ if (selElement instanceof MPlaceholder)
+ selElement = ((MPlaceholder) selElement).getRef();
+
+ for (ToolItem item : trimStackTB.getItems()) {
+ boolean isSel = item.getData() == selElement;
+ item.setSelection(isSel);
+ }
+ }
+ }
+ }
+
+ private boolean isEditorStack() {
+ if (!(minimizedElement instanceof MPlaceholder))
+ return false;
+
+ MPlaceholder ph = (MPlaceholder) minimizedElement;
+ return ph.getRef() instanceof MArea;
+ }
+
+ private boolean isPerspectiveStack() {
+ return minimizedElement instanceof MPerspectiveStack;
+ }
+
+ private MPart getLeafPart(MUIElement element) {
+ if (element instanceof MPlaceholder)
+ return getLeafPart(((MPlaceholder) element).getRef());
+
+ if (element instanceof MElementContainer<?>)
+ return getLeafPart(((MElementContainer<?>) element).getSelectedElement());
+
+ if (element instanceof MPart)
+ return (MPart) element;
+
+ return null;
+ }
+
+ /**
+ * This is the old way to subscribe to UIEvents. You should consider using the new way as shown
+ * by handleTransientDataEvents() and described in the article at
+ * http://wiki.eclipse.org/Eclipse4/RCP/Event_Model
+ */
+ private EventHandler openHandler = new EventHandler() {
+ @Override
+ public void handleEvent(org.osgi.service.event.Event event) {
+ if (isShowing)
+ return;
+
+ MUIElement changedElement = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
+
+ // Open if shared area
+ if (getLeafPart(minimizedElement) == changedElement
+ && !(minimizedElement instanceof MPerspectiveStack)) {
+ showStack(true);
+ return;
+ }
+
+ MUIElement selectedElement = null;
+
+ if (minimizedElement instanceof MPlaceholder) {
+ selectedElement = ((MPlaceholder) minimizedElement).getRef();
+ } else if (minimizedElement instanceof MPartStack) {
+ selectedElement = ((MPartStack) minimizedElement).getSelectedElement();
+ }
+
+ if (selectedElement == null)
+ return;
+
+ if (selectedElement instanceof MPlaceholder)
+ selectedElement = ((MPlaceholder) selectedElement).getRef();
+
+ if (changedElement != selectedElement)
+ return;
+
+ showStack(true);
+ }
+ };
+
+ /**
+ * This is the old way to subscribe to UIEvents. You should consider using the new way as shown
+ * by handleTransientDataEvents() and described in the article at
+ * http://wiki.eclipse.org/Eclipse4/RCP/Event_Model
+ */
+ private EventHandler toBeRenderedHandler = new EventHandler() {
+ @Override
+ public void handleEvent(org.osgi.service.event.Event event) {
+ if (minimizedElement == null || trimStackTB == null)
+ return;
+
+ MUIElement changedElement = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
+
+ // if our stack is going away, so should we
+ if (changedElement == minimizedElement && !minimizedElement.isToBeRendered()) {
+ restoreStack();
+ return;
+ }
+
+ // if one of the kids changes state, re-scrape the CTF
+ MUIElement parentElement = changedElement.getParent();
+ if (parentElement == minimizedElement) {
+ trimStackTB.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ updateTrimStackItems();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This is the old way to subscribe to UIEvents. You should consider using the new way as shown
+ * by handleTransientDataEvents() and described in the article at
+ * http://wiki.eclipse.org/Eclipse4/RCP/Event_Model
+ */
+ private EventHandler childrenHandler = new EventHandler() {
+ @Override
+ public void handleEvent(org.osgi.service.event.Event event) {
+ if (minimizedElement == null || trimStackTB == null)
+ return;
+
+ Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);
+
+ // if a child has been added or removed, re-scape the CTF
+ if (changedObj == minimizedElement) {
+ trimStackTB.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ updateTrimStackItems();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This is the old way to subscribe to UIEvents. You should consider using the new way as shown
+ * by handleTransientDataEvents() and described in the article at
+ * http://wiki.eclipse.org/Eclipse4/RCP/Event_Model
+ */
+ private EventHandler widgetHandler = new EventHandler() {
+ @Override
+ public void handleEvent(org.osgi.service.event.Event event) {
+ Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);
+ if (changedObj != minimizedElement)
+ return;
+
+ if (minimizedElement.getWidget() != null) {
+ trimStackTB.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ updateTrimStackItems();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This is the old way to subscribe to UIEvents. You should consider using the new way as shown
+ * by handleTransientDataEvents() and described in the article at
+ * http://wiki.eclipse.org/Eclipse4/RCP/Event_Model
+ */
+ // Listener attached to every ToolItem in a TrimStack. Responsible for activating the
+ // appropriate part.
+ private SelectionListener toolItemSelectionListener = new SelectionListener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ ToolItem toolItem = (ToolItem) e.widget;
+ MUIElement uiElement = (MUIElement) toolItem.getData();
+
+ // Clicking on the already showing item ? NOTE: the selection will already have been
+ // turned off by the time the event arrives
+ if (!toolItem.getSelection()) {
+ partService.requestActivation();
+ showStack(false);
+ return;
+ }
+
+ if (uiElement instanceof MPart) {
+ partService.activate((MPart) uiElement);
+ } else if (uiElement instanceof MPerspective) {
+ uiElement.getParent().setSelectedElement(uiElement);
+ }
+ showStack(true);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ };
+
+ // private MTrimBar bar;
+
+ private int fixedSides;
+
+ private Composite originalParent;
+
+ /**
+ * This is the old way to subscribe to UIEvents. You should consider using the new way as shown
+ * by handleTransientDataEvents() and described in the article at
+ * http://wiki.eclipse.org/Eclipse4/RCP/Event_Model
+ */
+ @PostConstruct
+ void addListeners() {
+ 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);
+ eventBroker.subscribe(UIEvents.UILifeCycle.APP_SHUTDOWN_STARTED, shutdownHandler);
+ }
+
+ private Composite getCAComposite() {
+ if (trimStackTB == null)
+ return null;
+
+ // Get the shell's client area composite
+ Shell theShell = trimStackTB.getShell();
+ if (theShell.getLayout() instanceof TrimmedPartLayout) {
+ TrimmedPartLayout tpl = (TrimmedPartLayout) theShell.getLayout();
+ if (!tpl.clientArea.isDisposed())
+ return tpl.clientArea;
+ }
+ return null;
+ }
+
+ /**
+ * This is the old way to subscribe to UIEvents. You should consider using the new way as shown
+ * by handleTransientDataEvents() and described in the article at
+ * http://wiki.eclipse.org/Eclipse4/RCP/Event_Model
+ */
+ @PreDestroy
+ void removeListeners() {
+ eventBroker.unsubscribe(toBeRenderedHandler);
+ eventBroker.unsubscribe(childrenHandler);
+ eventBroker.unsubscribe(widgetHandler);
+ eventBroker.unsubscribe(openHandler);
+ eventBroker.unsubscribe(closeHandler);
+ }
+
+ @PostConstruct
+ void createWidget(Composite parent, MToolControl me, CSSRenderingUtils cssUtils) {
+ if (minimizedElement == null) {
+ minimizedElement = findElement();
+ }
+
+ MUIElement meParent = me.getParent();
+ int orientation = SWT.HORIZONTAL;
+ if (meParent instanceof MTrimBar) {
+ MTrimBar bar = (MTrimBar) meParent;
+ if (bar.getSide() == SideValue.RIGHT || bar.getSide() == SideValue.LEFT)
+ orientation = SWT.VERTICAL;
+ }
+ trimStackTB = new ToolBar(parent, orientation | SWT.FLAT | SWT.WRAP);
+ trimStackTB.addDisposeListener(new DisposeListener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ showStack(false);
+
+ trimStackTB = null;
+ trimStackMenu = null;
+ }
+ });
+
+ trimStackTB.addListener(SWT.MenuDetect, new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ // Clear any existing menus
+ while (trimStackMenu.getItemCount() > 0)
+ trimStackMenu.getItem(0).dispose();
+
+ // Only open the menu if a tool item is selected
+ Point point = trimStackTB.getDisplay().map(null, trimStackTB,
+ new Point(event.x, event.y));
+ ToolItem selectedToolItem = trimStackTB.getItem(point);
+ if (selectedToolItem == null) {
+ return;
+ }
+
+ // Are we hovering over a valid tool item (vs restore button)
+ Object data = selectedToolItem.getData();
+ if (data instanceof MPart) {
+ // A part on a stack or editor area
+ createPartMenu((MPart) data);
+ } else if (data instanceof MPerspective) {
+ // A perspective in a perspective stack (for now we just support restore)
+ createEmtpyEditorAreaMenu();
+ } else if (isEditorStack()) {
+ // An empty editor area
+ createEmtpyEditorAreaMenu();
+ } else {
+ createUseOverlaysMenu();
+ }
+ }
+ });
+
+ trimStackMenu = new Menu(trimStackTB);
+ trimStackTB.setMenu(trimStackMenu);
+
+ ToolItem restoreBtn = new ToolItem(trimStackTB, SWT.PUSH);
+ restoreBtn.setToolTipText(Messages.TrimStack_RestoreText);
+ restoreBtn.setImage(getRestoreImage());
+ restoreBtn.addSelectionListener(new SelectionAdapter() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ minimizedElement.getTags().remove(IPresentationEngine.MINIMIZED);
+ }
+ });
+
+ updateTrimStackItems();
+ }
+
+ /**
+ * Creates a restore menu item that removes the minimized tag from the {@link #minimizedElement}
+ */
+ private void createEmtpyEditorAreaMenu() {
+ MenuItem restoreItem = new MenuItem(trimStackMenu, SWT.NONE);
+ restoreItem.setText(Messages.TrimStack_RestoreText);
+ restoreItem.addListener(SWT.Selection, new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ minimizedElement.getTags().remove(IPresentationEngine.MINIMIZED);
+ }
+ });
+ }
+
+ /**
+ * Creates a restore menu item that removes the minimized tag from the {@link #minimizedElement}
+ */
+ private void createUseOverlaysMenu() {
+ MenuItem useOverlaysItem = new MenuItem(trimStackMenu, SWT.CHECK);
+ useOverlaysItem.setText(Messages.TrimStack_Show_In_Original_Location);
+ useOverlaysItem.setSelection(!useOverlays());
+ useOverlaysItem.addListener(SWT.Selection, new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ if (toolControl != null) {
+ toolControl.getPersistedState().put(USE_OVERLAYS_KEY,
+ Boolean.toString(!useOverlays()));
+ }
+ }
+ });
+ }
+
+ /**
+ * Creates a series of menu items when a part is selected. The orientation submenu changes the
+ * layout tags on the {@link #minimizedElement}. The restore item will remove the minimized tag.
+ * The close item is not available on the editor stack, but will ask the part service to hide
+ * the part.
+ *
+ * @param selectedPart
+ * the part from the data of the selected tool item
+ */
+ private void createPartMenu(final MPart selectedPart) {
+ MenuItem orientationItem = new MenuItem(trimStackMenu, SWT.CASCADE);
+ orientationItem.setText(Messages.TrimStack_OrientationMenu);
+ Menu orientationMenu = new Menu(orientationItem);
+ orientationItem.setMenu(orientationMenu);
+
+ MenuItem defaultItem = new MenuItem(orientationMenu, SWT.RADIO);
+ defaultItem.setText(Messages.TrimStack_DefaultOrientationItem);
+ defaultItem.addListener(SWT.Selection, new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ boolean doRefresh = minimizedElement.getTags().remove(
+ IPresentationEngine.ORIENTATION_HORIZONTAL);
+ doRefresh |= minimizedElement.getTags().remove(
+ IPresentationEngine.ORIENTATION_VERTICAL);
+ if (isShowing && doRefresh) {
+ setPaneLocation();
+ }
+ }
+ });
+
+ MenuItem horizontalItem = new MenuItem(orientationMenu, SWT.RADIO);
+ horizontalItem.setText(Messages.TrimStack_Horizontal);
+ horizontalItem.addListener(SWT.Selection, new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ if (!minimizedElement.getTags()
+ .contains(IPresentationEngine.ORIENTATION_HORIZONTAL)) {
+ minimizedElement.getTags().remove(IPresentationEngine.ORIENTATION_VERTICAL);
+ minimizedElement.getTags().add(IPresentationEngine.ORIENTATION_HORIZONTAL);
+ if (isShowing) {
+ setPaneLocation();
+ }
+ }
+ }
+ });
+
+ MenuItem verticalItem = new MenuItem(orientationMenu, SWT.RADIO);
+ verticalItem.setText(Messages.TrimStack_Vertical);
+ verticalItem.addListener(SWT.Selection, new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ if (!minimizedElement.getTags().contains(IPresentationEngine.ORIENTATION_VERTICAL)) {
+ minimizedElement.getTags().remove(IPresentationEngine.ORIENTATION_HORIZONTAL);
+ minimizedElement.getTags().add(IPresentationEngine.ORIENTATION_VERTICAL);
+ if (isShowing) {
+ setPaneLocation();
+ }
+ }
+ }
+ });
+
+ // Set initial orientation selection
+ if (minimizedElement.getTags().contains(IPresentationEngine.ORIENTATION_HORIZONTAL)) {
+ horizontalItem.setSelection(true);
+ } else if (minimizedElement.getTags().contains(IPresentationEngine.ORIENTATION_VERTICAL)) {
+ verticalItem.setSelection(true);
+ } else {
+ defaultItem.setSelection(true);
+ }
+
+ MenuItem restoreItem = new MenuItem(trimStackMenu, SWT.NONE);
+ restoreItem.setText(Messages.TrimStack_RestoreText);
+ restoreItem.addListener(SWT.Selection, new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ minimizedElement.getTags().remove(IPresentationEngine.MINIMIZED);
+ partService.activate(selectedPart);
+ }
+ });
+
+ // Do not allow the shared editor area to be closed
+ if (!isEditorStack()) {
+ MenuItem closeItem = new MenuItem(trimStackMenu, SWT.NONE);
+ closeItem.setText(Messages.TrimStack_CloseText);
+ closeItem.addListener(SWT.Selection, new Listener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void handleEvent(Event event) {
+ partService.hidePart(selectedPart);
+ }
+ });
+ }
+ }
+
+ @PreDestroy
+ void destroy() {
+ for (Image image : imageMap.values()) {
+ image.dispose();
+ }
+
+ if (layoutImage != null) {
+ layoutImage.dispose();
+ layoutImage = null;
+ }
+
+ if (restoreImage != null) {
+ restoreImage.dispose();
+ restoreImage = null;
+ }
+ }
+
+ public MUIElement getMinimizedElement() {
+ return minimizedElement;
+ }
+
+ private MUIElement findElement() {
+ MUIElement result;
+ List<MPerspectiveStack> ps = modelService.findElements(window, null,
+ MPerspectiveStack.class, null);
+ if (ps.size() == 0) {
+ String toolControlId = toolControl.getElementId();
+ int index = toolControlId.indexOf('(');
+ String stackId = toolControlId.substring(0, index);
+ result = modelService.find(stackId, window);
+ } else {
+ String toolControlId = toolControl.getElementId();
+ int index = toolControlId.indexOf('(');
+ String stackId = toolControlId.substring(0, index);
+ String perspId = toolControlId.substring(index + 1, toolControlId.length() - 1);
+
+ MPerspective persp = null;
+ List<MPerspective> perspectives = modelService.findElements(ps.get(0), perspId, MPerspective.class, null);
+ if (perspectives != null && !perspectives.isEmpty()) {
+ persp = perspectives.get(0);
+ }
+
+ if (persp != null) {
+ result = modelService.find(stackId, persp);
+ } else {
+ result = modelService.find(stackId, window);
+ }
+ }
+
+ return result;
+ }
+
+ private String getLabelText(MUILabel label) {
+ // Use override text if available
+ if (label instanceof MUIElement) {
+ String text = getOverrideTitleToolTip((MUIElement) label);
+ if (text != null && text.length() > 0)
+ return text;
+ }
+
+ String string = label.getLocalizedLabel();
+ return string == null ? "" : string; //$NON-NLS-1$
+ }
+
+ private Image getImage(MUILabel element) {
+ // Use override image if available
+ if (element instanceof MUIElement) {
+ Image image = getOverrideImage((MUIElement) element);
+ if (image != null)
+ return image;
+ }
+
+ String iconURI = element.getIconURI();
+ if (iconURI != null && iconURI.length() > 0) {
+ Image image = imageMap.get(iconURI);
+ if (image == null) {
+ image = resUtils.imageDescriptorFromURI(URI.createURI(iconURI)).createImage();
+ imageMap.put(iconURI, image);
+ }
+ return image;
+ }
+
+ return null;
+ }
+
+ private MUILabel getLabelElement(MUIElement element) {
+ if (element instanceof MPlaceholder)
+ element = ((MPlaceholder) element).getRef();
+
+ return (MUILabel) (element instanceof MUILabel ? element : null);
+ }
+
+ private void updateTrimStackItems() {
+ // Prevent exceptions on shutdown
+ if (trimStackTB == null || trimStackTB.isDisposed() || minimizedElement.getWidget() == null)
+ return;
+
+ // Remove any current items except the 'restore' button
+ while (trimStackTB.getItemCount() > 1) {
+ trimStackTB.getItem(trimStackTB.getItemCount() - 1).dispose();
+ }
+
+ if (isEditorStack() && trimStackTB.getItemCount() == 1) {
+ ToolItem ti = new ToolItem(trimStackTB, SWT.CHECK);
+ ti.setToolTipText(Messages.TrimStack_SharedAreaTooltip);
+ ti.setImage(getLayoutImage());
+ ti.addSelectionListener(toolItemSelectionListener);
+ } else if (minimizedElement instanceof MPlaceholder) {
+ MPlaceholder ph = (MPlaceholder) minimizedElement;
+ if (ph.getRef() instanceof MPart) {
+ MPart part = (MPart) ph.getRef();
+ ToolItem ti = new ToolItem(trimStackTB, SWT.CHECK);
+ ti.setData(part);
+ ti.setImage(getImage(part));
+ ti.setToolTipText(getLabelText(part));
+ ti.addSelectionListener(toolItemSelectionListener);
+ }
+ } else if (minimizedElement instanceof MGenericStack<?>) {
+ // Handle *both* PartStacks and PerspectiveStacks here...
+ MGenericStack<?> theStack = (MGenericStack<?>) minimizedElement;
+
+ // check to see if this stack has any valid elements
+ boolean hasRenderedElements = false;
+ for (MUIElement stackElement : theStack.getChildren()) {
+ if (stackElement.isToBeRendered()) {
+ hasRenderedElements = true;
+ break;
+ }
+ }
+
+ if (hasRenderedElements) {
+ for (MUIElement stackElement : theStack.getChildren()) {
+ if (!stackElement.isToBeRendered()) {
+ continue;
+ }
+
+ MUILabel labelElement = getLabelElement(stackElement);
+ ToolItem newItem = new ToolItem(trimStackTB, SWT.CHECK);
+ newItem.setData(labelElement);
+ newItem.setImage(getImage(labelElement));
+ newItem.setToolTipText(getLabelText(labelElement));
+ newItem.addSelectionListener(toolItemSelectionListener);
+ }
+ } else if (theStack.getTags().contains(IPresentationEngine.NO_AUTO_COLLAPSE)) {
+ // OK to be empty and still minimized
+ ToolItem ti = new ToolItem(trimStackTB, SWT.CHECK);
+ ti.setToolTipText(Messages.TrimStack_EmptyStackTooltip);
+ ti.setImage(getLayoutImage());
+ ti.addSelectionListener(toolItemSelectionListener);
+ } else {
+ // doesn't have any children that's showing, place it back in the presentation
+ restoreStack();
+ return;
+ }
+ }
+
+ trimStackTB.pack();
+ trimStackTB.getShell().layout(new Control[] { trimStackTB }, SWT.DEFER);
+ }
+
+ void restoreStack() {
+ showStack(false);
+
+ minimizedElement.setVisible(true);
+ minimizedElement.getTags().remove(IPresentationEngine.MINIMIZED);
+
+ // Activate the part that is being brought up...
+ if (minimizedElement instanceof MPartStack) {
+ MPartStack theStack = (MPartStack) minimizedElement;
+ MStackElement curSel = theStack.getSelectedElement();
+ Control ctrl = (Control) minimizedElement.getWidget();
+
+ // Hack for elems that are lazy initialized
+ if (ctrl instanceof CTabFolder && ((CTabFolder) ctrl).getSelection() == null) {
+ theStack.setSelectedElement(null);
+ theStack.setSelectedElement(curSel);
+ }
+ }
+
+ toolControl.setToBeRendered(false);
+
+ if (hostPane != null && !hostPane.isDisposed())
+ hostPane.dispose();
+ hostPane = null;
+ }
+
+ /**
+ * Sets whether this stack should be visible or hidden
+ *
+ * @param show
+ * whether the stack should be visible
+ */
+ public void showStack(boolean show) {
+ Control ctrl = (Control) minimizedElement.getWidget();
+ CTabFolder ctf = ctrl instanceof CTabFolder ? (CTabFolder) ctrl : null;
+
+ Composite clientAreaComposite = getCAComposite();
+ if (clientAreaComposite == null || clientAreaComposite.isDisposed())
+ return;
+
+ if (show && !isShowing) {
+ if (useOverlays()) {
+ hostPane = getHostPane();
+ originalParent = ctrl.getParent();
+ ctrl.setParent(hostPane);
+
+ // Hack ! Force a resize of the CTF to make sure the hosted
+ // view is the correct size...see bug 434062 for details
+ if (ctf != null) {
+ Rectangle bb = ctf.getBounds();
+ bb.width--;
+ ctf.setBounds(bb);
+ }
+
+ clientAreaComposite.addControlListener(caResizeListener);
+
+ // Set the initial location
+ setPaneLocation();
+
+ hostPane.addListener(SWT.Traverse, escapeListener);
+
+ hostPane.layout(true);
+ hostPane.moveAbove(null);
+ hostPane.setVisible(true);
+
+ // Cache the value to ensure that a stack is hidden using the same mode it was
+ // opened in
+ cachedUseOverlays = true;
+ } else {
+ minimizedElement.setVisible(true);
+ ctrl.addListener(SWT.Traverse, escapeListener);
+
+ // Cache the value to ensure that a stack is hidden using the same mode it was
+ // opened in
+ cachedUseOverlays = false;
+ }
+
+ isShowing = true;
+ toolControl.getTags().add(MINIMIZED_AND_SHOWING);
+
+ // Activate the part that is being brought up...
+ if (minimizedElement instanceof MPartStack) {
+ MPartStack theStack = (MPartStack) minimizedElement;
+ MStackElement curSel = theStack.getSelectedElement();
+
+ // Hack for elems that are lazy initialized
+ if (ctf != null && ctf.getSelection() == null) {
+ theStack.setSelectedElement(null);
+ theStack.setSelectedElement(curSel);
+ }
+
+ if (curSel instanceof MPart) {
+ partService.activate((MPart) curSel);
+ } else if (curSel instanceof MPlaceholder) {
+ MPlaceholder ph = (MPlaceholder) curSel;
+ if (ph.getRef() instanceof MPart) {
+ partService.activate((MPart) ph.getRef());
+ }
+ }
+ } else if (isEditorStack()) {
+ MArea area = (MArea) ((MPlaceholder) minimizedElement).getRef();
+
+ // See if we can find an element to activate...
+ MPart partToActivate = null;
+ MUIElement selectedElement = area.getSelectedElement();
+ while (partToActivate == null && selectedElement != null) {
+ if (selectedElement instanceof MPart) {
+ partToActivate = (MPart) selectedElement;
+ } else if (selectedElement instanceof MPlaceholder) {
+ MPlaceholder ph = (MPlaceholder) selectedElement;
+ if (ph.getRef() instanceof MPart) {
+ partToActivate = (MPart) ph.getRef();
+ } else {
+ selectedElement = null;
+ }
+ } else if (selectedElement instanceof MElementContainer<?>) {
+ MElementContainer<?> container = (MElementContainer<?>) selectedElement;
+ selectedElement = container.getSelectedElement();
+ }
+ }
+
+ // If we haven't found one then use the first
+ if (partToActivate == null) {
+ List<MPart> parts = modelService.findElements(area, null, MPart.class, null);
+ for (MPart part : parts) {
+ if (partService.isPartVisible(part)) {
+ partToActivate = part;
+ break;
+ }
+ }
+ }
+
+ if (partToActivate != null) {
+ partService.activate(partToActivate);
+ }
+ } else if (minimizedElement instanceof MPlaceholder) {
+ MPlaceholder ph = (MPlaceholder) minimizedElement;
+ if (ph.getRef() instanceof MPart) {
+ MPart part = (MPart) ph.getRef();
+ partService.activate(part);
+ }
+ }
+
+ fixToolItemSelection();
+ } else if (!show && isShowing) {
+ if (cachedUseOverlays) {
+ // Check to ensure that the client area is non-null since the
+ // trimstack may be currently hosted in the limbo shell
+ if (clientAreaComposite != null) {
+ clientAreaComposite.removeControlListener(caResizeListener);
+ }
+
+ ctrl.setParent(originalParent);
+
+ hostPane.dispose();
+ hostPane = null;
+ } else {
+ if (ctrl != null && !ctrl.isDisposed())
+ ctrl.removeListener(SWT.Traverse, escapeListener);
+ minimizedElement.setVisible(false);
+ }
+
+ isShowing = false;
+ toolControl.getTags().remove(MINIMIZED_AND_SHOWING);
+
+ fixToolItemSelection();
+ }
+ }
+
+ /**
+ * @return 'true' iff the minimized stack should overlay the current presentation, 'false' means
+ * to temporarily restore the stack into the current presentation.
+ */
+ private boolean useOverlays() {
+ if (toolControl == null)
+ return true;
+
+ String useOverlays = toolControl.getPersistedState().get(USE_OVERLAYS_KEY);
+ if (useOverlays == null)
+ useOverlays = "true"; //$NON-NLS-1$
+ return Boolean.parseBoolean(useOverlays);
+ }
+
+ private void setPaneLocation() {
+ Composite clientAreaComposite = getCAComposite();
+ if (clientAreaComposite == null || clientAreaComposite.isDisposed())
+ return;
+
+ Rectangle caRect = clientAreaComposite.getBounds();
+
+ // NOTE: always starts in the persisted (or default) size
+ Point paneSize = hostPane.getSize();
+
+ // Ensure it's not clipped
+ if (paneSize.x > caRect.width)
+ paneSize.x = caRect.width;
+ if (paneSize.y > caRect.height)
+ paneSize.y = caRect.height;
+
+ if (minimizedElement.getTags().contains(IPresentationEngine.ORIENTATION_HORIZONTAL))
+ paneSize.x = caRect.width;
+ if (minimizedElement.getTags().contains(IPresentationEngine.ORIENTATION_VERTICAL))
+ paneSize.y = caRect.height;
+
+ Point loc = new Point(0, 0);
+ if (isFixed(SWT.LEFT))
+ loc.x = caRect.x;
+ else
+ loc.x = (caRect.x + caRect.width) - paneSize.x;
+
+ if (isFixed(SWT.TOP))
+ loc.y = caRect.y;
+ else
+ loc.y = (caRect.y + caRect.height) - paneSize.y;
+
+ hostPane.setSize(paneSize);
+ hostPane.setLocation(loc);
+ }
+
+ private void setHostSize() {
+ if (hostPane == null || hostPane.isDisposed())
+ return;
+
+ int xSize = 600;
+ String xSizeStr = toolControl.getPersistedState().get(STATE_XSIZE);
+ if (xSizeStr != null)
+ xSize = Integer.parseInt(xSizeStr);
+ int ySize = 400;
+ String ySizeStr = toolControl.getPersistedState().get(STATE_YSIZE);
+ if (ySizeStr != null)
+ ySize = Integer.parseInt(ySizeStr);
+ hostPane.setSize(xSize, ySize);
+ }
+
+ private Composite getHostPane() {
+ // Create one
+ hostPane = new Composite(trimStackTB.getShell(), SWT.NONE);
+ hostPane.setData(ShellActivationListener.DIALOG_IGNORE_KEY, Boolean.TRUE);
+
+ hostPane.addDisposeListener(new DisposeListener() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ hostPane = null;
+ }
+ });
+
+ setHostSize();
+
+ // Set a special layout that allows resizing
+ fixedSides = getFixedSides();
+ hostPane.setLayout(new TrimPaneLayout(toolControl, fixedSides));
+
+ return hostPane;
+ }
+
+ private int getFixedSides() {
+ MUIElement tcParent = toolControl.getParent();
+ if (!(tcParent instanceof MTrimBar))
+ return 0;
+ MTrimBar bar = (MTrimBar) tcParent;
+ Composite trimComp = (Composite) bar.getWidget();
+ Rectangle trimBounds = trimComp.getBounds();
+ Point trimCenter = new Point(trimBounds.width / 2, trimBounds.height / 2); // adjusted to
+ // (0,0)
+
+ Control trimCtrl = (Control) toolControl.getWidget();
+ Rectangle ctrlBounds = trimCtrl.getBounds();
+ Point ctrlCenter = new Point(ctrlBounds.x + (ctrlBounds.width / 2), ctrlBounds.y
+ + (ctrlBounds.height / 2));
+
+ if (bar.getSide() == SideValue.LEFT) {
+ int verticalValue = ctrlCenter.y < trimCenter.y ? SWT.TOP : SWT.BOTTOM;
+ return SWT.LEFT | verticalValue;
+ } else if (bar.getSide() == SideValue.RIGHT) {
+ int verticalValue = ctrlCenter.y < trimCenter.y ? SWT.TOP : SWT.BOTTOM;
+ return SWT.RIGHT | verticalValue;
+ } else if (bar.getSide() == SideValue.TOP) {
+ int horizontalValue = ctrlCenter.x < trimCenter.x ? SWT.LEFT : SWT.RIGHT;
+ return SWT.TOP | horizontalValue;
+ } else if (bar.getSide() == SideValue.BOTTOM) {
+ int horizontalValue = ctrlCenter.x < trimCenter.x ? SWT.LEFT : SWT.RIGHT;
+ return SWT.BOTTOM | horizontalValue;
+ }
+
+ return SWT.BOTTOM | SWT.RIGHT;
+ }
+
+ private Image getLayoutImage() {
+ if (layoutImage == null) {
+ layoutImage = resUtils.imageDescriptorFromURI(URI.createURI(LAYOUT_ICON_URI))
+ .createImage();
+ }
+ return layoutImage;
+ }
+
+ private Image getRestoreImage() {
+ if (restoreImage == null) {
+ restoreImage = resUtils.imageDescriptorFromURI(URI.createURI(RESTORE_ICON_URI))
+ .createImage();
+ }
+ return restoreImage;
+ }
+
+ private boolean isFixed(int swtSide) {
+ return (fixedSides & swtSide) != 0;
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/messages.properties b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/messages.properties
new file mode 100644
index 0000000000..560e318f18
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/messages.properties
@@ -0,0 +1,20 @@
+################################################################################
+# Copyright (c) 2011, 2014 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+################################################################################
+
+TrimStack_EmptyStackTooltip = Empty Stack
+TrimStack_SharedAreaTooltip = Shared Area
+TrimStack_CloseText = &Close
+TrimStack_DefaultOrientationItem=&Default
+TrimStack_RestoreText = &Restore
+TrimStack_Horizontal = &Horizontal
+TrimStack_OrientationMenu=&Orientation
+TrimStack_Vertical = &Vertical
+TrimStack_Show_In_Original_Location = &Show in the Original Location \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java
new file mode 100644
index 0000000000..2c18f40388
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.e4.ui.workbench.addons.splitteraddon;
+
+import java.lang.annotation.Annotation;
+import java.util.List;
+import javax.inject.Inject;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.di.Focus;
+import org.eclipse.e4.ui.di.Persist;
+import org.eclipse.e4.ui.di.PersistState;
+import org.eclipse.e4.ui.di.UIEventTopic;
+import org.eclipse.e4.ui.model.application.ui.MElementContainer;
+import org.eclipse.e4.ui.model.application.ui.MUIElement;
+import org.eclipse.e4.ui.model.application.ui.basic.MCompositePart;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.UIEvents;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.swt.widgets.Control;
+import org.osgi.service.event.Event;
+
+/**
+ * Support containment of split internal parts.
+ */
+public class SplitHost {
+ @Inject
+ EModelService ms;
+ @Inject
+ EPartService ps;
+ @Inject
+ MCompositePart myPart;
+
+ List<MPart> getSubParts() {
+ List<MPart> childParts = ms.findElements(myPart, null, MPart.class, null);
+ return childParts;
+ }
+
+ MPart findInnerActive(MCompositePart outer) {
+ MPart innerActive = null;
+ MUIElement curParent = outer;
+ while (innerActive == null && curParent != null) {
+ if (curParent instanceof MElementContainer<?>) {
+ MElementContainer<?> container = (MElementContainer<?>) curParent;
+ if (container.getSelectedElement() instanceof MPart) {
+ innerActive = (MPart) container.getSelectedElement();
+ } else if (container.getSelectedElement() instanceof MElementContainer<?>) {
+ curParent = container.getSelectedElement();
+ } else {
+ curParent = null;
+ }
+ }
+ }
+
+ return innerActive;
+ }
+
+ @Inject
+ @Optional
+ void tbrHandler(@UIEventTopic(UIEvents.Dirtyable.TOPIC_DIRTY) Event eventData) {
+ MUIElement changedElement = (MUIElement) eventData.getProperty(UIEvents.EventTags.ELEMENT);
+
+ if (!isOneOfMyParts(changedElement))
+ return;
+
+ boolean isDirty = false;
+ List<MPart> kids = getSubParts();
+ kids.remove(0);
+ for (MPart subPart : kids) {
+ isDirty |= subPart.isDirty();
+ }
+ myPart.setDirty(isDirty);
+ }
+
+ private boolean isOneOfMyParts(MUIElement changedElement) {
+ MElementContainer<MUIElement> parent = changedElement.getParent();
+ Object parentObj = parent;
+ while (parent != null && parentObj != myPart) {
+ parent = parent.getParent();
+ parentObj = parent;
+ }
+
+ return parentObj == myPart;
+ }
+
+ void callingAllParts(Class<? extends Annotation> clz) {
+ List<MPart> parts = ms.findElements(myPart, null, MPart.class, null);
+ for (MPart part : parts) {
+ if (part == myPart)
+ continue;
+
+ Control ctrl = (Control) part.getWidget();
+ if (part.getObject() != null && ctrl != null && !ctrl.isDisposed())
+ ContextInjectionFactory.invoke(part.getObject(), clz, part.getContext(), null);
+ }
+ }
+
+ @Persist
+ void persist() {
+ callingAllParts(Persist.class);
+ }
+
+ @PersistState
+ void persistState() {
+ callingAllParts(PersistState.class);
+ }
+
+ @Focus
+ void setFocus() {
+ MPart ap = findInnerActive(myPart);
+ if (ap == null)
+ return;
+
+ Control ctrl = (Control) ap.getWidget();
+ if (ap.getObject() != null && ctrl != null && !ctrl.isDisposed())
+ ContextInjectionFactory.invoke(ap.getObject(), Focus.class, ap.getContext(), null);
+ }
+
+ // @PostConstruct
+ // void createWidget(Composite parent) {
+ // System.out.println("New Split Host");
+ // Composite newComp = new Composite(parent, SWT.NONE);
+ // newComp.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GREEN));
+ // newComp.setLayout(new FillLayout());
+ // }
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitterAddon.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitterAddon.java
new file mode 100644
index 0000000000..3c44060129
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitterAddon.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.workbench.addons.splitteraddon;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.di.UIEventTopic;
+import org.eclipse.e4.ui.model.application.ui.MElementContainer;
+import org.eclipse.e4.ui.model.application.ui.MUIElement;
+import org.eclipse.e4.ui.model.application.ui.basic.MCompositePart;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.IPresentationEngine;
+import org.eclipse.e4.ui.workbench.UIEvents;
+import org.eclipse.e4.ui.workbench.UIEvents.EventTags;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.osgi.service.event.Event;
+
+/**
+ * Listens for the IPresentationEngine's SPLIT_HORIZONTAL and SPLIT_VERTICAL tags being applied to
+ * an MPart and takes the appropriate steps to split / unsplit the part
+ */
+public class SplitterAddon {
+ @Inject
+ EModelService ms;
+
+ @Inject
+ EPartService ps;
+
+ /**
+ * Handles changes in tags
+ *
+ * @param event
+ */
+ @Inject
+ @Optional
+ private void subscribeTopicTagsChanged(
+ @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TAGS) Event event) {
+ Object changedObj = event.getProperty(EventTags.ELEMENT);
+
+ if (!(changedObj instanceof MPart))
+ return;
+
+ MPart part = (MPart) changedObj;
+
+ if (UIEvents.isADD(event)) {
+ if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE,
+ IPresentationEngine.SPLIT_HORIZONTAL)) {
+ splitPart(part, true);
+ } else if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE,
+ IPresentationEngine.SPLIT_VERTICAL)) {
+ splitPart(part, false);
+ }
+ } else if (UIEvents.isREMOVE(event)) {
+ MCompositePart compPart = SplitterAddon.findContainingCompositePart(part);
+ if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE,
+ IPresentationEngine.SPLIT_HORIZONTAL)) {
+ unsplitPart(compPart);
+ } else if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE,
+ IPresentationEngine.SPLIT_VERTICAL)) {
+ unsplitPart(compPart);
+ }
+ }
+ }
+
+ /**
+ * Finds the CompositePart containing the given part (if any)
+ *
+ * @param part
+ * @return The MCompositePart or 'null' if none is found
+ */
+ public static MCompositePart findContainingCompositePart(MPart part) {
+ if (part == null)
+ return null;
+
+ MUIElement curParent = part.getParent();
+ while (curParent != null && !(curParent instanceof MCompositePart))
+ curParent = curParent.getParent();
+
+ return (MCompositePart) curParent;
+ }
+
+ private void unsplitPart(MCompositePart compositePart) {
+ if (compositePart == null)
+ return;
+
+ List<MPart> innerElements = ms.findElements(compositePart, null, MPart.class, null);
+ if (innerElements.size() < 3)
+ return;
+
+ MPart originalEditor = innerElements.get(1); // '0' is the composite part
+
+ // Close the cloned editor *before* removing it from the model
+ MPart clonedEditor = innerElements.get(2);
+ clonedEditor.setToBeRendered(false);
+
+ MElementContainer<MUIElement> compParent = compositePart.getParent();
+ int index = compParent.getChildren().indexOf(compositePart);
+ compParent.getChildren().remove(compositePart);
+ originalEditor.getParent().getChildren().remove(originalEditor);
+ compParent.getChildren().add(index, originalEditor);
+
+ if (ps.getActivePart() == originalEditor)
+ ps.activate(null);
+ ps.activate(originalEditor);
+ }
+
+ private MCompositePart createCompositePart(MPart originalPart) {
+ MCompositePart compPart = ms.createModelElement(MCompositePart.class);
+ compPart.setElementId("Split Host(" + originalPart.getLabel() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ compPart.setLabel(originalPart.getLabel());
+ compPart.setTooltip(originalPart.getTooltip());
+ compPart.setIconURI(originalPart.getIconURI());
+ compPart.setCloseable(true);
+ compPart.setContributionURI("bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.splitteraddon.SplitHost"); //$NON-NLS-1$
+
+ // Always remove the composite part from the model
+ compPart.getTags().add(EPartService.REMOVE_ON_HIDE_TAG);
+
+ return compPart;
+ }
+
+ void splitPart(MPart partToSplit, boolean horizontal) {
+ MElementContainer<MUIElement> parent = partToSplit.getParent();
+ int index = parent.getChildren().indexOf(partToSplit);
+
+ MPart editorClone = (MPart) ms.cloneElement(partToSplit, null);
+
+ MCompositePart compPart = createCompositePart(partToSplit);
+
+ // Add the new composite part to the model
+ compPart.getChildren().add(editorClone);
+ compPart.setSelectedElement(editorClone);
+ parent.getChildren().add(index, compPart);
+ parent.setSelectedElement(compPart);
+
+ // Now, add the original part into the composite
+ int orientation = horizontal ? EModelService.ABOVE : EModelService.LEFT_OF;
+ ms.insert(partToSplit, editorClone, orientation, 0.5f);
+
+ ps.activate(partToSplit);
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/CleanupProcessor.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/CleanupProcessor.java
new file mode 100644
index 0000000000..6e99b50085
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/CleanupProcessor.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Lars Vogel <Lars.Vogel@gmail.com> - Bug 429421
+ *******************************************************************************/
+package org.eclipse.e4.ui.workbench.addons.swt;
+
+import java.util.List;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.MAddon;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+
+/**
+ * Model processors which adds the cleanup add-on to the application model
+ */
+public class CleanupProcessor {
+ @Execute
+ void addCleanupAddon(MApplication app, EModelService modelService) {
+ List<MAddon> addons = app.getAddons();
+
+ // prevent multiple copies
+ for (MAddon addon : addons) {
+ if (addon.getContributionURI()
+ .contains("ui.workbench.addons.cleanupaddon.CleanupAddon")) //$NON-NLS-1$
+ return;
+ }
+
+ // adds the add-on to the application model
+ MAddon cleanupAddon = modelService.createModelElement(MAddon.class);
+ cleanupAddon.setElementId("CleanupAddon"); //$NON-NLS-1$
+ cleanupAddon
+ .setContributionURI("bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.cleanupaddon.CleanupAddon"); //$NON-NLS-1$
+ app.getAddons().add(cleanupAddon);
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/DnDProcessor.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/DnDProcessor.java
new file mode 100644
index 0000000000..03f27af8e1
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/DnDProcessor.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Lars Vogel <Lars.Vogel@gmail.com> - Bug 429421
+ *******************************************************************************/
+package org.eclipse.e4.ui.workbench.addons.swt;
+
+import java.util.List;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.MAddon;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+
+/**
+ * Model processors which adds the DnD add-on to the application model
+ */
+public class DnDProcessor {
+ @Execute
+ void addDnDAddon(MApplication app, EModelService modelService) {
+ List<MAddon> addons = app.getAddons();
+
+ // prevent multiple copies
+ for (MAddon addon : addons) {
+ if (addon.getContributionURI().contains("ui.workbench.addons.dndaddon.DnDAddon")) //$NON-NLS-1$
+ return;
+ }
+
+ // adds the add-on to the application model
+ MAddon dndAddon = modelService.createModelElement(MAddon.class);
+ dndAddon.setElementId("DnDAddon"); //$NON-NLS-1$
+ dndAddon.setContributionURI("bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.dndaddon.DnDAddon"); //$NON-NLS-1$
+ app.getAddons().add(dndAddon);
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/MinMaxProcessor.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/MinMaxProcessor.java
new file mode 100644
index 0000000000..339d2656b1
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/MinMaxProcessor.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Lars Vogel <Lars.Vogel@gmail.com> - Bug 429421
+ *******************************************************************************/
+package org.eclipse.e4.ui.workbench.addons.swt;
+
+import java.util.List;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.MAddon;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+
+/**
+ * Model processors which adds the MinMax add-on to the application model
+ */
+public class MinMaxProcessor {
+ @Execute
+ void addMinMaxAddon(MApplication app, EModelService modelService) {
+ List<MAddon> addons = app.getAddons();
+
+ // prevent multiple copies
+ for (MAddon addon : addons) {
+ if (addon.getContributionURI().contains("ui.workbench.addons.minmax.MinMaxAddon")) //$NON-NLS-1$
+ return;
+ }
+
+ // add the add-on to the application model
+ MAddon minMaxAddon = modelService.createModelElement(MAddon.class);
+ minMaxAddon.setElementId("MinMaxAddon"); //$NON-NLS-1$
+ minMaxAddon
+ .setContributionURI("bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon"); //$NON-NLS-1$
+ app.getAddons().add(minMaxAddon);
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/SplitterProcessor.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/SplitterProcessor.java
new file mode 100644
index 0000000000..c0f6a24d56
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/SplitterProcessor.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Lars Vogel <Lars.Vogel@gmail.com> - Bug 429421
+ *******************************************************************************/
+package org.eclipse.e4.ui.workbench.addons.swt;
+
+import java.util.List;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.MAddon;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+
+/**
+ * Model processors which adds the Splitter add-on to the application model
+ */
+
+public class SplitterProcessor {
+ @Execute
+ void addSplitterAddon(MApplication app, EModelService modelService) {
+ List<MAddon> addons = app.getAddons();
+
+ // prevent multiple copies
+ for (MAddon addon : addons) {
+ if (addon.getContributionURI().contains(
+ "ui.workbench.addons.splitteraddon.SplitterAddon")) //$NON-NLS-1$
+ return;
+ }
+
+ // adds the add-on to the application model
+ MAddon splitterAddon = modelService.createModelElement(MAddon.class);
+ splitterAddon.setElementId("SplitterAddon"); //$NON-NLS-1$
+ splitterAddon
+ .setContributionURI("bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.splitteraddon.SplitterAddon"); //$NON-NLS-1$
+ app.getAddons().add(splitterAddon);
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.classpath b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.classpath
new file mode 100644
index 0000000000..e8ea977a69
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.project b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.project
new file mode 100644
index 0000000000..0f9d498f80
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.e4.ui.workbench.renderers.swt</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000000..c522e1f4ae
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..137c694f76
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,418 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..87b7a262a6
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,124 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
+formatter_settings_version=12
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\r\n * Copyright (c) ${year} IBM Corporation and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n ******************************************************************************/\r\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 0000000000..a09ec9c2c7
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,97 @@
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Warning
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..2ce50474bb
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=1
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..cbbdef3783
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/MANIFEST.MF
@@ -0,0 +1,36 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.e4.ui.workbench.renderers.swt;singleton:=true
+Bundle-Version: 0.13.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.eclipse.e4.ui.workbench;bundle-version="0.9.0",
+ org.eclipse.e4.core.services;bundle-version="0.9.0",
+ org.eclipse.e4.core.contexts;bundle-version="1.0.0",
+ org.eclipse.e4.core.di;bundle-version="1.1.0",
+ org.eclipse.e4.ui.services;bundle-version="0.9.0",
+ org.eclipse.e4.ui.workbench.swt;bundle-version="0.9.0",
+ org.eclipse.e4.ui.model.workbench;bundle-version="0.9.0",
+ org.eclipse.osgi.services;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.e4.core.commands;bundle-version="0.9.0",
+ org.eclipse.e4.ui.bindings;bundle-version="0.9.0",
+ org.eclipse.equinox.common;bundle-version="[3.6.0,4.0.0)",
+ org.eclipse.core.expressions;bundle-version="[3.4.200,4.0.0)",
+ org.eclipse.osgi;bundle-version="[3.6.0,4.0.0)",
+ org.eclipse.e4.ui.di;bundle-version="0.9.0",
+ org.eclipse.emf.ecore;bundle-version="2.7.0",
+ org.eclipse.rap.rwt,
+ org.eclipse.core.commands,
+ org.eclipse.rap.jface,
+ org.eclipse.e4.core.di.extensions;bundle-version="0.12.0",
+ org.eclipse.equinox.preferences;bundle-version="3.5.200"
+Require-Capability: org.eclipse.rap
+Export-Package: org.eclipse.e4.ui.internal.workbench.renderers.swt;x-friends:="org.eclipse.ui.workbench",
+ org.eclipse.e4.ui.workbench.renderers.swt;x-friends:="org.eclipse.e4.ui.workbench.addons.swt,org.eclipse.ui.workbench"
+Bundle-ActivationPolicy: lazy
+Import-Package: javax.annotation;version="1.0.0",
+ javax.inject;version="1.0.0",
+ org.w3c.dom.css;version="2.0.0"
+Bundle-Activator: org.eclipse.e4.ui.internal.workbench.renderers.swt.SWTRenderersActivator
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/p2.inf b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/p2.inf
new file mode 100644
index 0000000000..f4e1a274dc
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/META-INF/p2.inf
@@ -0,0 +1,13 @@
+# Ensure that modified RAP e4 platform bundles are only installed in RAP environment
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=491177
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=490922
+
+# Make sure that a RAP RWT implementation is available
+requires.0.namespace = org.eclipse.rap
+requires.0.name = org.eclipse.rap.rwt
+
+# Do not allow to install this IU in case the SWT bundle is available
+requires.1.namespace = org.eclipse.equinox.p2.iu
+requires.1.name = org.eclipse.swt
+requires.1.min = 0
+requires.1.max = 0
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/about.html b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/about.html
new file mode 100644
index 0000000000..3ce4e7e75b
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 20, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/build.properties b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/build.properties
new file mode 100644
index 0000000000..591b4b8872
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2013, 2015 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/,\
+ src-rap/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties,\
+ icons/
+src.includes = about.html
+jre.compilation.profile = JavaSE-1.7
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/forceQualifierUpdate.txt b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/forceQualifierUpdate.txt
new file mode 100644
index 0000000000..d01ddc17c7
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/forceQualifierUpdate.txt
@@ -0,0 +1,4 @@
+# To force a version qualifier update add the bug here
+Bug 403352 - Update all parent versions to match our build stream
+Bug 407961 - Comparator log shows special problem that will require "touches"
+
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/icons/full/ovr16/pinned_ovr.gif b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/icons/full/ovr16/pinned_ovr.gif
new file mode 100644
index 0000000000..2f3b201a63
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/icons/full/ovr16/pinned_ovr.gif
Binary files differ
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/icons/viewMenu.png b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/icons/viewMenu.png
new file mode 100644
index 0000000000..439b26c63b
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/icons/viewMenu.png
Binary files differ
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/plugin.properties b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/plugin.properties
new file mode 100644
index 0000000000..db2c7499b8
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+pluginName = Eclipse e4 Workbench SWT Renderer
+providerName = Eclipse.org
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/pom.xml b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/pom.xml
new file mode 100644
index 0000000000..7d837885bb
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.rap.e4</groupId>
+ <artifactId>org.eclipse.e4.ui.workbench.renderers.swt</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <parent>
+ <groupId>org.eclipse.rap.e4</groupId>
+ <artifactId>org.eclipse.rap.e4.target-releng</artifactId>
+ <relativePath>../../releng/releng-target/pom.xml</relativePath>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
+
+ <build>
+ <resources>
+ <!-- to ensure that the feature lookup of the ui test works -->
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>META-INF/</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/AbstractTableInformationControl.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/AbstractTableInformationControl.java
new file mode 100644
index 0000000000..89cc744b8d
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/AbstractTableInformationControl.java
@@ -0,0 +1,597 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.ui.internal.workbench.renderers.swt;
+
+import org.eclipse.e4.ui.workbench.swt.internal.copy.SearchPattern;
+import org.eclipse.e4.ui.workbench.swt.internal.copy.WorkbenchSWTMessages;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @since 3.0
+ */
+public abstract class AbstractTableInformationControl {
+
+ /**
+ * The NamePatternFilter selects the elements which match the given string
+ * patterns.
+ */
+ protected class NamePatternFilter extends ViewerFilter {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement,
+ Object element) {
+ SearchPattern matcher = getMatcher();
+ if (matcher == null || !(viewer instanceof TableViewer)) {
+ return true;
+ }
+ TableViewer tableViewer = (TableViewer) viewer;
+
+ String matchName = ((ILabelProvider) tableViewer.getLabelProvider())
+ .getText(element);
+
+ if (matchName == null) {
+ return false;
+ }
+ // A dirty editor's label will start with dirty prefix, this prefix
+ // should not be taken in consideration when matching with a pattern
+ if (matchName.startsWith("*")) { //$NON-NLS-1$
+ matchName = matchName.substring(1);
+ }
+ return matcher.matches(matchName);
+ }
+ }
+
+ /** The control's shell */
+ private Shell fShell;
+
+ /** The composite */
+ private Composite fComposite;
+
+ /** The control's text widget */
+ private Text fFilterText;
+
+ /** The control's table widget */
+ private TableViewer fTableViewer;
+
+ /** The current search pattern */
+ private SearchPattern fSearchPattern;
+
+ /**
+ * Creates an information control with the given shell as parent. The given
+ * styles are applied to the shell and the table widget.
+ *