Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2011-05-02 14:36:59 +0000
committervlorenzo2011-05-02 14:36:59 +0000
commite3631f38ff72da0eeb4db88b2efcfe353b5575a9 (patch)
treed929a054c9bcab68871940601335cd4fabf0abf4 /incoming
parent28ae9963596e16b7e94c95fe8d61a9da71af7698 (diff)
downloadorg.eclipse.papyrus-e3631f38ff72da0eeb4db88b2efcfe353b5575a9.tar.gz
org.eclipse.papyrus-e3631f38ff72da0eeb4db88b2efcfe353b5575a9.tar.xz
org.eclipse.papyrus-e3631f38ff72da0eeb4db88b2efcfe353b5575a9.zip
NEW - bug 344461: [Table Editor] Papyrus Table Editor needs to provides Boolean and String Editors for TableInstance
https://bugs.eclipse.org/bugs/show_bug.cgi?id=344461
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.classpath7
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.project28
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/META-INF/MANIFEST.MF16
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/build.properties6
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/plugin.properties3
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/plugin.xml11
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/resources/umlCellEditors.modelcelleditors9
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/Activator.java73
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/editors/BooleanCellEditor.java74
-rw-r--r--incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/editors/StringMultiCellEditor.java68
11 files changed, 303 insertions, 0 deletions
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.classpath b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.project b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.project
new file mode 100644
index 00000000000..8e0973919b2
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.table.widgets.celleditors.uml</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.settings/org.eclipse.jdt.core.prefs b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..945dfdfa7d8
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Fri Apr 29 15:57:42 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..b24a31a7c6e
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.table.widgets.celleditors.uml;singleton:=true
+Bundle-Version: 0.8.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.widget.celleditors.uml.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.facet.widgets.celleditors,
+ org.eclipse.emf.facet.widgets.celleditors.ecore;bundle-version="0.1.0",
+ org.eclipse.emf.facet.util.core,
+ org.eclipse.papyrus.log
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/build.properties b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/build.properties
new file mode 100644
index 00000000000..8665ac2ffec
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/plugin.properties b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/plugin.properties
new file mode 100644
index 00000000000..2b58aa4a0e3
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.table.widgets.celleditors.uml
+providerName = Eclipse Modeling Project
+pluginName = Cell Editors for Papyrus Tables \ No newline at end of file
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/plugin.xml b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/plugin.xml
new file mode 100644
index 00000000000..d6997f190f0
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/plugin.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.emf.facet.widgets.celleditors.celleditors">
+ <cellEditorsModel
+ path="resources/umlCellEditors.modelcelleditors">
+ </cellEditorsModel>
+ </extension>
+
+</plugin>
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/resources/umlCellEditors.modelcelleditors b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/resources/umlCellEditors.modelcelleditors
new file mode 100644
index 00000000000..2d2ed409ebd
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/resources/umlCellEditors.modelcelleditors
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<modelCellEditor:ModelCellEditorDeclarations xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:modelCellEditor="http://www.eclipse.org/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor">
+ <modelCellEditors xsi:type="modelCellEditor:BasicCellEditor" cellId="uml_boolean_cell_papyrus" basicCellEditorImpl="org.eclipse.papyrus.widget.celleditors.uml.editors.BooleanCellEditor">
+ <cellType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/3.0.0/UML#//Boolean"/>
+ </modelCellEditors>
+ <modelCellEditors xsi:type="modelCellEditor:BasicCellEditor" cellId="uml_string_cell_papyrus" basicCellEditorImpl="org.eclipse.papyrus.widget.celleditors.uml.editors.StringMultiCellEditor">
+ <cellType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/3.0.0/UML#//String"/>
+ </modelCellEditors>
+</modelCellEditor:ModelCellEditorDeclarations>
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/Activator.java b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/Activator.java
new file mode 100644
index 00000000000..f578f19565d
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/Activator.java
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ * 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.widget.celleditors.uml;
+
+import org.eclipse.papyrus.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.widget.celleditors.uml"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /** Logging helper */
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ // register the login helper
+ log = new LogHelper(plugin);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(final 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/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/editors/BooleanCellEditor.java b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/editors/BooleanCellEditor.java
new file mode 100644
index 00000000000..cc1abfa63fa
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/editors/BooleanCellEditor.java
@@ -0,0 +1,74 @@
+/*****************************************************************************
+ * 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.widget.celleditors.uml.editors;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.facet.widgets.celleditors.IListener;
+import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
+import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor;
+import org.eclipse.emf.facet.widgets.celleditors.ecore.composite.BooleanComposite;
+import org.eclipse.papyrus.widget.celleditors.uml.Activator;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/** A cell editor for Boolean */
+public class BooleanCellEditor implements IModelCellEditor {
+
+ /**
+ * The boolean composite
+ */
+ private BooleanComposite composite = null;
+
+ /**
+ *
+ * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#activateCell(org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject)
+ *
+ * @param parent
+ * @param originalValue
+ * @param editHandler
+ * @param feature
+ * @param source
+ * @return
+ */
+ public Control activateCell(final Composite parent, final Object originalValue, final IModelCellEditHandler editHandler, final EStructuralFeature feature, final EObject source) {
+ composite = new BooleanComposite(parent);
+ if(originalValue != null) {
+ if(originalValue instanceof Boolean) {
+ composite.setValue((Boolean)originalValue);
+ } else {
+ Activator.log.info("An instance of Boolean was expected");
+ }
+ }
+ composite.addCommitListener(new IListener() {
+
+ public void handleEvent() {
+ editHandler.commit();
+ }
+ });
+ return composite;
+ }
+
+ /**
+ *
+ * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#getValue()
+ *
+ * @return
+ */
+ public Object getValue() {
+ return composite.getValue();
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/editors/StringMultiCellEditor.java b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/editors/StringMultiCellEditor.java
new file mode 100644
index 00000000000..f5a78258f0c
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.table.widgets.celleditors.uml/src/org/eclipse/papyrus/widget/celleditors/uml/editors/StringMultiCellEditor.java
@@ -0,0 +1,68 @@
+/*****************************************************************************
+ * 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.widget.celleditors.uml.editors;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.facet.widgets.celleditors.IListener;
+import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler;
+import org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor;
+import org.eclipse.emf.facet.widgets.celleditors.ecore.composite.StringMultiComposite;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * A cell editor for String
+ */
+public class StringMultiCellEditor implements IModelCellEditor {
+
+ /**
+ * The StringMultiComposite
+ */
+ private StringMultiComposite<String> composite = null;
+
+ /**
+ *
+ * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#activateCell(org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.eclipse.emf.facet.widgets.celleditors.IModelCellEditHandler, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject)
+ *
+ * @param parent
+ * @param originalValue
+ * @param editHandler
+ * @param feature
+ * @param source
+ * @return
+ */
+ public Control activateCell(final Composite parent, final Object originalValue, final IModelCellEditHandler editHandler, final EStructuralFeature feature, final EObject source) {
+ composite = new StringMultiComposite<String>(parent, originalValue);
+
+ composite.addCommitListener(new IListener() {
+
+ public void handleEvent() {
+ editHandler.commit();
+ }
+ });
+ return composite;
+ }
+
+ /**
+ *
+ * @see org.eclipse.emf.facet.widgets.celleditors.IModelCellEditor#getValue()
+ *
+ * @return
+ */
+ public Object getValue() {
+ return composite.getValue();
+ }
+}

Back to the top