diff options
author | Lars Vogel | 2014-02-05 11:45:00 +0000 |
---|---|---|
committer | Lars Vogel | 2014-02-05 11:45:00 +0000 |
commit | 318206fb9d844a611a15a3f391a890da552a5786 (patch) | |
tree | 4caa6f72367b2c6862c0c0e58beffebe6fae059c | |
parent | d6a158cd6303ee2057cc2595b7cddc0cbf363db1 (diff) | |
download | org.eclipse.e4.tools-318206fb9d844a611a15a3f391a890da552a5786.tar.gz org.eclipse.e4.tools-318206fb9d844a611a15a3f391a890da552a5786.tar.xz org.eclipse.e4.tools-318206fb9d844a611a15a3f391a890da552a5786.zip |
Bug 427451 - [CSS Spy] Replace Factory usage in CSS spy with
EModelService
Change-Id: I2f04c3ba67a0520b5923b063010ac325825e5310
Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
-rw-r--r-- | bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java index acebc545..5f22f184 100644 --- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java +++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011,2012 Manumitting Technologies, Inc. + * Copyright (c) 2011,2014 Manumitting Technologies, Inc. * 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 @@ -7,6 +7,7 @@ * * Contributors: * Brian de Alwis (MT) - initial API and implementation + * Lars Vogel <lars.vogel@gmail.com> - Bug 427451 *******************************************************************************/ package org.eclipse.e4.tools.css.spy; @@ -19,9 +20,9 @@ import org.eclipse.e4.ui.bindings.EBindingService; import org.eclipse.e4.ui.model.application.MApplication; import org.eclipse.e4.ui.model.application.commands.MBindingTable; import org.eclipse.e4.ui.model.application.commands.MCommand; -import org.eclipse.e4.ui.model.application.commands.MCommandsFactory; import org.eclipse.e4.ui.model.application.commands.MHandler; import org.eclipse.e4.ui.model.application.commands.MKeyBinding; +import org.eclipse.e4.ui.workbench.modeling.EModelService; public class SpyInstaller { private static final String BUNDLE_ID = "org.eclipse.e4.tools.css.spy"; @@ -44,6 +45,9 @@ public class SpyInstaller { protected MApplication app; @Inject + EModelService modelService; + + @Inject @Optional protected Logger logger; @@ -86,7 +90,7 @@ public class SpyInstaller { } } - MCommand cmd = MCommandsFactory.INSTANCE.createCommand(); + MCommand cmd = modelService.createModelElement(MCommand.class); cmd.setCommandName(label); cmd.setElementId(commandId); cmd.setContributorURI(CONTRIBUTOR_URI); @@ -102,7 +106,7 @@ public class SpyInstaller { } } - MHandler hdlr = MCommandsFactory.INSTANCE.createHandler(); + MHandler hdlr = modelService.createModelElement(MHandler.class); hdlr.setElementId(handlerId); hdlr.setContributionURI(handlerURI); hdlr.setCommand(cmd); @@ -152,7 +156,8 @@ public class SpyInstaller { return; } - MKeyBinding binding = MCommandsFactory.INSTANCE.createKeyBinding(); + MKeyBinding binding = modelService + .createModelElement(MKeyBinding.class); binding.setCommand(cmd); binding.setKeySequence(keySeq); binding.setElementId("kb." + cmd.getElementId()); |