diff options
author | Fanch BONNABESSE | 2016-08-04 12:24:14 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-08-11 13:27:34 +0000 |
commit | f0a5f7b106f3e393bbebb8e988e0dc7850423089 (patch) | |
tree | 838a6605731e88b171627220177c74b0420d108c /plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/directeditor/TableDirectEditorConfiguration.java | |
parent | e28b5ed336c6b23e88eaf0c48cc75c95897df822 (diff) | |
download | org.eclipse.papyrus-f0a5f7b106f3e393bbebb8e988e0dc7850423089.tar.gz org.eclipse.papyrus-f0a5f7b106f3e393bbebb8e988e0dc7850423089.tar.xz org.eclipse.papyrus-f0a5f7b106f3e393bbebb8e988e0dc7850423089.zip |
Bug 497289: [Model Explorer] Renaming an element in the model explorer
should not open a modal editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=497289
Activation of the DirectEditor configuration on the ModelExplorer view
for:
- NamedElement
- Diagram
- Table
Add a Preference on "Papyrus > Papyrus Model Explorer > New Child Menu"
Change-Id: I760b84ee4b30f8f05ccb6c2f001a4e0f1e82d150
Signed-off-by: Fanch BONNABESSE <fanch.bonnabesse@all4tec.net>
Diffstat (limited to 'plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/directeditor/TableDirectEditorConfiguration.java')
-rw-r--r-- | plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/directeditor/TableDirectEditorConfiguration.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/directeditor/TableDirectEditorConfiguration.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/directeditor/TableDirectEditorConfiguration.java new file mode 100644 index 00000000000..8cd32ae3bd4 --- /dev/null +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/directeditor/TableDirectEditorConfiguration.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * 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.directeditor; + +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.papyrus.extensionpoints.editors.configuration.AbstractBasicDirectEditorConfiguration; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; + +/** + * Specific direct editor configuration to rename Table. + */ +public class TableDirectEditorConfiguration extends AbstractBasicDirectEditorConfiguration { + + /** + * {@inheritDoc} + */ + @Override + public String getTextToEdit(final Object objectToEdit) { + if (objectToEdit instanceof Table) { + return ((Table) objectToEdit).getName(); + } + + return super.getTextToEdit(objectToEdit); + } + + /** + * {@inheritDoc} + */ + @Override + public IParser createDirectEditorParser() { + return new TableDirectEditorParser(getTextToEdit(objectToEdit)); + } +} |