Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFanch BONNABESSE2016-09-28 09:26:17 +0000
committerRemi Schnekenburger2016-12-07 10:04:15 +0000
commit059540788510a906aefe36b56aed5c2acc3eca14 (patch)
treeb84de930bc3c1de5d1d28edb169b0332d7872df0
parente63478d762d8005f4b01d52e50b0a7051d402217 (diff)
downloadorg.eclipse.papyrus-059540788510a906aefe36b56aed5c2acc3eca14.tar.gz
org.eclipse.papyrus-059540788510a906aefe36b56aed5c2acc3eca14.tar.xz
org.eclipse.papyrus-059540788510a906aefe36b56aed5c2acc3eca14.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. Conflicts: plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml Change-Id: I796770ba48a1d5c80b0608983575d8ef4cca84e3 Signed-off-by: Fanch BONNABESSE <fanch.bonnabesse@all4tec.net>
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/Activator.java138
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/preferences/DiagramDirectEditorPreferenceInitializer.java53
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml6
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/Activator.java114
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/preferences/TableDirectEditorPreferenceInitializer.java53
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml6
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/Activator.java148
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/preferences/NamedElementDirectEditorPreferenceInitializer.java53
9 files changed, 383 insertions, 194 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml
index 7473baa7b6e..b6d6c4cc640 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml
@@ -97,5 +97,11 @@
</Priority>
</DirectEditor>
</extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.preferences.DiagramDirectEditorPreferenceInitializer">
+ </initializer>
+ </extension>
</plugin>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/Activator.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/Activator.java
index 93a5866b1b9..901a42b1686 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/Activator.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/Activator.java
@@ -1,67 +1,71 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.modelexplorer;
-
-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.gmfdiag.modelexplorer"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The 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;
- }
-
- /*
- * (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;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.modelexplorer;
+
+import org.eclipse.core.runtime.preferences.DefaultScope;
+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.gmfdiag.modelexplorer"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The 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;
+
+ // 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;
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/preferences/DiagramDirectEditorPreferenceInitializer.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/preferences/DiagramDirectEditorPreferenceInitializer.java
new file mode 100644
index 00000000000..6558d8c0c12
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/preferences/DiagramDirectEditorPreferenceInitializer.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.gmfdiag.modelexplorer.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+
+/**
+ *
+ * This preference initializer initializes the preferences for the direct editor of Diagram.
+ *
+ */
+public class DiagramDirectEditorPreferenceInitializer 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 'Diagram'.
+ */
+ private static final String VALUE_DIAGRAM = "Diagram Direct Editor"; //$NON-NLS-1$
+
+ /**
+ * Constructor.
+ */
+ public DiagramDirectEditorPreferenceInitializer() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ store.setDefault(PREFIX_PAPYRUS_EDITOR + Diagram.class.getName(), VALUE_DIAGRAM);
+ }
+}
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 adfa7e22409..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
@@ -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);
+ }
+}
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 9cecbd4b825..458202e69d8 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml
@@ -2463,4 +2463,10 @@
</Priority>
</DirectEditor>
</extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <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);
+ }
+}

Back to the top