diff options
author | Fanch BONNABESSE | 2016-09-28 09:26:17 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-12-06 16:50:33 +0000 |
commit | bf00ee033e80427cff7acbbf925d7cf5d78d7f8e (patch) | |
tree | 2fe26238c8f524d6ac11aae6085990532a147003 /plugins/uml/modelexplorer | |
parent | 0d41658fd32d4ef701a59f22c64c60646548291c (diff) | |
download | org.eclipse.papyrus-bf00ee033e80427cff7acbbf925d7cf5d78d7f8e.tar.gz org.eclipse.papyrus-bf00ee033e80427cff7acbbf925d7cf5d78d7f8e.tar.xz org.eclipse.papyrus-bf00ee033e80427cff7acbbf925d7cf5d78d7f8e.zip |
Bug 502269: [Model Explorer] Renaming an element in the model explorer
still open a modal editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=502269
Initialize custom Direct editor configuration.
Change-Id: I796770ba48a1d5c80b0608983575d8ef4cca84e3
Signed-off-by: Fanch BONNABESSE <fanch.bonnabesse@all4tec.net>
Diffstat (limited to 'plugins/uml/modelexplorer')
3 files changed, 133 insertions, 73 deletions
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml index bbbcaa7f0b3..deeb3d7d61e 100644 --- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml +++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml @@ -2487,7 +2487,7 @@ <extension point="org.eclipse.papyrus.extensionpoints.editors.DirectEditor"> <DirectEditor - contributor="All4Tec" + contributor="CEA LIST" language="Named Element Direct Editor" objectToEdit="org.eclipse.uml2.uml.NamedElement" superType="true"> @@ -2510,5 +2510,8 @@ <initializer class="org.eclipse.papyrus.uml.modelexplorer.preferences.CustomizableLabelPreferenceInitializer"> </initializer> + <initializer + class="org.eclipse.papyrus.uml.modelexplorer.preferences.NamedElementDirectEditorPreferenceInitializer"> + </initializer> </extension> </plugin> diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/Activator.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/Activator.java index 10f563df754..f62f5cfbd5f 100644 --- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/Activator.java +++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/Activator.java @@ -1,72 +1,76 @@ -/*
- *
- */
-package org.eclipse.papyrus.uml.modelexplorer;
-
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin implements org.eclipse.ui.IStartup {
-
- /** The plug-in ID */
- public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.modelexplorer"; //$NON-NLS-1$
-
- /** The plug-in shared instance */
- private static Activator plugin;
-
- /** The log service */
- public static LogHelper log;
-
- /** Default constructor */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
- * )
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- log = new LogHelper(plugin);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
- * )
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- *
- * @see org.eclipse.ui.IStartup#earlyStartup()
- *
- */
- public void earlyStartup() {
-
- }
-}
+/* + * + */ +package org.eclipse.papyrus.uml.modelexplorer; + +import org.eclipse.core.runtime.preferences.DefaultScope; +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin implements org.eclipse.ui.IStartup { + + /** The plug-in ID */ + public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.modelexplorer"; //$NON-NLS-1$ + + /** The plug-in shared instance */ + private static Activator plugin; + + /** The log service */ + public static LogHelper log; + + /** Default constructor */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext + * ) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(plugin); + + // Activation of the preferences of this plug-in to initialize this. + DefaultScope.INSTANCE.getNode(PLUGIN_ID); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext + * ) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * + * @see org.eclipse.ui.IStartup#earlyStartup() + * + */ + public void earlyStartup() { + + } +} diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/preferences/NamedElementDirectEditorPreferenceInitializer.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/preferences/NamedElementDirectEditorPreferenceInitializer.java new file mode 100644 index 00000000000..d40e7922f04 --- /dev/null +++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/preferences/NamedElementDirectEditorPreferenceInitializer.java @@ -0,0 +1,53 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST 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: + * Fanch BONNABESSE (ALL4TEC) fanch.bonnabesse@all4tec.net - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.uml.modelexplorer.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.uml2.uml.NamedElement; + +/** + * + * This preference initializer initializes the preferences for the direct editor of NamedElement. + * + */ +public class NamedElementDirectEditorPreferenceInitializer extends AbstractPreferenceInitializer { + + /** + * Prefix 'papyrus.editors' to store preferences. + */ + private static final String PREFIX_PAPYRUS_EDITOR = "papyrus.directeditor."; //$NON-NLS-1$ + + /** + * The Value for the objects 'NamedElement'. + */ + private static final String VALUE_NAMED_ELEMENT = "Named Element Direct Editor"; //$NON-NLS-1$ + + /** + * Constructor. + */ + public NamedElementDirectEditorPreferenceInitializer() { + super(); + } + + /** + * {@inheritDoc} + */ + @Override + public void initializeDefaultPreferences() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + store.setDefault(PREFIX_PAPYRUS_EDITOR + NamedElement.class.getName(), VALUE_NAMED_ELEMENT); + } +} |