Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2013-10-29 08:53:15 -0400
committervlorenzo2013-10-29 08:53:15 -0400
commit9c7c76fc006d80ea14bc63f75005e3678130ebcb (patch)
treeb32e88bb7a29ef64e965cc1b4b2e871f308ddd34 /plugins
parent2ae05533dcbfb14b5bb4699e62388d4b724a1429 (diff)
downloadorg.eclipse.papyrus-9c7c76fc006d80ea14bc63f75005e3678130ebcb.tar.gz
org.eclipse.papyrus-9c7c76fc006d80ea14bc63f75005e3678130ebcb.tar.xz
org.eclipse.papyrus-9c7c76fc006d80ea14bc63f75005e3678130ebcb.zip
417915: [Table 2] Papyrus Table must provides the API to open Xtext
Editor as CellEditor https://bugs.eclipse.org/bugs/show_bug.cgi?id=417915
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF6
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/Activator.java (renamed from plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/Activator.java)2
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java (renamed from plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java)7
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/util/XTextEditorResultWrapper.java (renamed from plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/util/XTextEditorResultWrapper.java)4
-rw-r--r--plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF4
-rw-r--r--plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/ui/Activator.java67
6 files changed, 80 insertions, 10 deletions
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF
index a7de579937f..e07344f581f 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.papyrus.uml.nattable.xtext.integration
Bundle-Version: 0.10.1.qualifier
-Bundle-Activator: org.eclipse.papyrus.infra.nattable.xtext.integration.Activator
+Bundle-Activator: org.eclipse.papyrus.uml.nattable.xtext.integration.Activator
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
@@ -21,4 +21,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.gmf.runtime.common.ui.services
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.papyrus.infra.nattable.xtext.integration.celleditor
+Export-Package: org.eclipse.papyrus.uml.nattable.xtext.integration,
+ org.eclipse.papyrus.uml.nattable.xtext.integration.celleditor,
+ org.eclipse.papyrus.uml.nattable.xtext.integration.util
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/Activator.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/Activator.java
index 33574d1f36b..65877a33d92 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/Activator.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/Activator.java
@@ -1,4 +1,4 @@
-package org.eclipse.papyrus.infra.nattable.xtext.integration;
+package org.eclipse.papyrus.uml.nattable.xtext.integration;
import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java
index d068294aa8b..963d85c3fa7 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java
@@ -11,7 +11,7 @@
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.xtext.integration.celleditor;
+package org.eclipse.papyrus.uml.nattable.xtext.integration.celleditor;
import java.util.List;
@@ -25,7 +25,7 @@ import org.eclipse.papyrus.infra.nattable.celleditor.AbstractPapyrusStyledTextCe
import org.eclipse.papyrus.infra.nattable.manager.table.ITableAxisElementProvider;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableproblem.StringResolutionProblem;
-import org.eclipse.papyrus.infra.nattable.xtext.integration.util.XTextEditorResultWrapper;
+import org.eclipse.papyrus.uml.nattable.xtext.integration.util.XTextEditorResultWrapper;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.papyrus.uml.xtext.integration.XtextFakeResourceContext;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementAdapter;
@@ -179,8 +179,7 @@ public abstract class AbstractNatTableXTextCellEditor extends AbstractPapyrusSty
if(styledText != null) {
typedString = styledText.getText();
final IParserEditStatus result = parser.isValidEditString(null, typedString);
- System.out.println(result);
- if(result.isOK()) {
+ if(result!=null && result.isOK()) {
parseCommand = parser.getParseCommand(null, typedString, 0);
}
}
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/util/XTextEditorResultWrapper.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/util/XTextEditorResultWrapper.java
index 6c866a80702..4854a6115ef 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/util/XTextEditorResultWrapper.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/util/XTextEditorResultWrapper.java
@@ -1,4 +1,4 @@
-package org.eclipse.papyrus.infra.nattable.xtext.integration.util;
+package org.eclipse.papyrus.uml.nattable.xtext.integration.util;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -30,7 +30,7 @@ public class XTextEditorResultWrapper implements IAdaptable {
* the command to do the set value according to the typed text. Could be <code>null</code> if the text can't be parsed
*/
public XTextEditorResultWrapper(String text, ICommand parseCommand) {
- this.text = text;
+ this.text = text.trim();//to remove invalid /r/n at the end of the string, see bug 420495
this.parseCommand = parseCommand;
}
diff --git a/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF
index e1347f5e498..c2c35eb38e4 100644
--- a/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF
+++ b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF
@@ -14,10 +14,12 @@ Require-Bundle: org.eclipse.gef;bundle-version="3.9.0",
org.eclipse.papyrus.uml.xtext.integration.core;bundle-version="0.10.1";visibility:=reexport,
org.eclipse.papyrus.extensionpoints.editors;bundle-version="0.10.1";visibility:=reexport,
org.eclipse.uml2.uml;bundle-version="4.1.0",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1"
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1"
Export-Package: org.eclipse.papyrus.uml.xtext.integration
Bundle-Vendor: Eclipse Modeling Project
Import-Package: org.eclipse.papyrus.infra.services.validation,
org.eclipse.papyrus.infra.services.validation.commands,
org.eclipse.papyrus.uml.extensionpoints.profile,
org.eclipse.papyrus.uml.extensionpoints.standard
+Bundle-Activator: org.eclipse.papyrus.uml.xtext.integration.ui.Activator
diff --git a/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/ui/Activator.java b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/ui/Activator.java
new file mode 100644
index 00000000000..25f3f7a7fec
--- /dev/null
+++ b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/ui/Activator.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.xtext.integration.ui;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.xtext.integration.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ 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;
+ }
+
+}

Back to the top