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/infra/nattable/org.eclipse.papyrus.infra.nattable.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/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer')
3 files changed, 119 insertions, 56 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml index 647b0add2cf..bc10dd24524 100644 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml @@ -120,7 +120,7 @@ <extension point="org.eclipse.papyrus.extensionpoints.editors.DirectEditor"> <DirectEditor - contributor="All4Tec" + contributor="CEA LIST" language="Table Direct Editor" objectToEdit="org.eclipse.papyrus.infra.nattable.model.nattable.Table"> <popupeditor @@ -131,4 +131,10 @@ </Priority> </DirectEditor> </extension> + <extension + point="org.eclipse.core.runtime.preferences"> + <initializer + class="org.eclipse.papyrus.infra.nattable.modelexplorer.preferences.TableDirectEditorPreferenceInitializer"> + </initializer> + </extension> </plugin> diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/Activator.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/Activator.java index 481742a05c7..cbe04cf138e 100644 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/Activator.java +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/Activator.java @@ -1,55 +1,59 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * 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:
- * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.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 {
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.nattable.modelexplorer"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The plug-in's logger
- */
- public static LogHelper log;
-
- @Override
- public void start(final BundleContext context) throws Exception {
- super.start(context);
- Activator.plugin = this;
- }
-
-
- @Override
- public void stop(final BundleContext context) throws Exception {
- Activator.plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return Activator.plugin;
- }
-}
+/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * 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: + * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.infra.nattable.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 { + + /** + * The plug-in ID + */ + public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.nattable.modelexplorer"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The plug-in's logger + */ + public static LogHelper log; + + @Override + public void start(final BundleContext context) throws Exception { + super.start(context); + Activator.plugin = this; + + // Activation of the preferences of this plug-in to initialize this. + DefaultScope.INSTANCE.getNode(PLUGIN_ID); + } + + + @Override + public void stop(final BundleContext context) throws Exception { + Activator.plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return Activator.plugin; + } +} diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/preferences/TableDirectEditorPreferenceInitializer.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/preferences/TableDirectEditorPreferenceInitializer.java new file mode 100644 index 00000000000..8791ab40b95 --- /dev/null +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/preferences/TableDirectEditorPreferenceInitializer.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.infra.nattable.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.papyrus.infra.nattable.model.nattable.Table; + +/** + * + * This preference initializer initializes the preferences for the direct editor of Table. + * + */ +public class TableDirectEditorPreferenceInitializer 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 'Table'. + */ + private static final String VALUE_TABLE = "Table Direct Editor"; //$NON-NLS-1$ + + /** + * Constructor. + */ + public TableDirectEditorPreferenceInitializer() { + super(); + } + + /** + * {@inheritDoc} + */ + @Override + public void initializeDefaultPreferences() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + store.setDefault(PREFIX_PAPYRUS_EDITOR + Table.class.getName(), VALUE_TABLE); + } +} |