Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-08-03 15:08:49 +0000
committercletavernie2012-08-03 15:08:49 +0000
commit3e7f10e7c50cae1b760b2b41034063706c05d877 (patch)
tree8afe4917616aa0b83556846e24d5df3a3da22f4c
parentcaed1ad00cf82ebe6daf4a363b896286f207e56a (diff)
downloadorg.eclipse.papyrus-3e7f10e7c50cae1b760b2b41034063706c05d877.tar.gz
org.eclipse.papyrus-3e7f10e7c50cae1b760b2b41034063706c05d877.tar.xz
org.eclipse.papyrus-3e7f10e7c50cae1b760b2b41034063706c05d877.zip
Work in progress - Table EFacet properties view
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/META-INF/MANIFEST.MF9
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/plugin.xml8
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/environment.xmi9
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/papyrustable.ctx4
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/Activator.java23
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElement.java29
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElementFactory.java37
7 files changed, 113 insertions, 6 deletions
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/META-INF/MANIFEST.MF
index 8f4b18284f1..7838ac1b597 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/META-INF/MANIFEST.MF
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/META-INF/MANIFEST.MF
@@ -1,7 +1,14 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.papyrus.views.properties
+ org.eclipse.papyrus.views.properties,
+ org.eclipse.core.databinding;bundle-version="1.4.1",
+ org.eclipse.papyrus.views.properties.model;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="0.9.0",
+ org.eclipse.emf.edit;bundle-version="2.8.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.table.efacet.metamodel;bundle-version="0.9.0"
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
Bundle-Version: 0.9.0.qualifier
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/plugin.xml
index a49bd217fe1..ab9f41f3298 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/plugin.xml
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/plugin.xml
@@ -1,3 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?eclipse version="3.4"?>
<plugin>
-<extension point="org.eclipse.papyrus.views.properties.context"><context contextModel="/propertyView/papyrustable/papyrustable.ctx"/></extension></plugin>
+<extension point="org.eclipse.papyrus.views.properties.context"><context contextModel="/propertyView/papyrustable/papyrustable.ctx"/></extension>
+<extension
+ point="org.eclipse.papyrus.views.properties.environment">
+ <environment
+ environmentModel="propertyView/environment.xmi">
+ </environment>
+</extension></plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/environment.xmi b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/environment.xmi
new file mode 100644
index 00000000000..9217016ca3b
--- /dev/null
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/environment.xmi
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment:Environment
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:environment="http://www.eclipse.org/papyrus/properties/environment/0.9">
+ <modelElementFactories
+ name="Papyrus Table ModelElementFactory"
+ factoryClass="org.eclipse.papyrus.infra.table.efacet.properties.modelelement.TableModelElementFactory"/>
+</environment:Environment>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/papyrustable.ctx b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/papyrustable.ctx
index fe44e85f477..d40b497644d 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/papyrustable.ctx
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/papyrustable.ctx
@@ -27,7 +27,7 @@
<properties name="usingContextFeature" type="Boolean" description="This attribute is true when fillingMode==Feature."/>
<properties name="usingQueries" type="Boolean" description="This attribute is true when fillingMode==Queries."/>
</elements>
- <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.views.properties/model/Environment.xmi#//@modelElementFactories.0"/>
+ <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/environment.xmi#//@modelElementFactories.0"/>
</dataContexts>
<dataContexts name="table" label="table">
<elements name="Table">
@@ -68,6 +68,6 @@
</elements>
<elements name="EObjectQueryRow" supertypes="//@dataContexts.1/@elements.6"/>
<elements name="ValueColumn" supertypes="//@dataContexts.1/@elements.2"/>
- <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.views.properties/model/Environment.xmi#//@modelElementFactories.0"/>
+ <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/environment.xmi#//@modelElementFactories.0"/>
</dataContexts>
</contexts:Context>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/Activator.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/Activator.java
index e8290082431..756795fb4d4 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/Activator.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/Activator.java
@@ -1,5 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.infra.table.efacet.properties;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -13,7 +25,9 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
-
+
+ public static LogHelper log;
+
/**
* The constructor
*/
@@ -22,17 +36,22 @@ public class Activator extends AbstractUIPlugin {
/*
* (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(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);
@@ -40,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElement.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElement.java
new file mode 100644
index 00000000000..b79b2e8e65b
--- /dev/null
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElement.java
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.efacet.properties.modelelement;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.views.properties.modelelement.EMFModelElement;
+
+
+public class TableModelElement extends EMFModelElement {
+
+ private PapyrusTable sourceTable;
+
+ public TableModelElement(PapyrusTable source, EditingDomain domain) {
+ super(source, domain);
+ this.sourceTable = source;
+ }
+
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElementFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElementFactory.java
new file mode 100644
index 00000000000..d641ab63635
--- /dev/null
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElementFactory.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.efacet.properties.modelelement;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.views.properties.Activator;
+import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
+import org.eclipse.papyrus.views.properties.modelelement.ModelElement;
+import org.eclipse.papyrus.views.properties.modelelement.ModelElementFactory;
+
+
+public class TableModelElementFactory implements ModelElementFactory {
+
+ public ModelElement createFromSource(Object sourceElement, DataContextElement context) {
+ EObject source = EMFHelper.getEObject(sourceElement);
+ if(source == null || !(source instanceof PapyrusTable)) {
+ Activator.log.warn("Unable to resolve the selected element to a Papyrus Table"); //$NON-NLS-1$
+ return null;
+ }
+
+ EditingDomain domain = EMFHelper.resolveEditingDomain(source);
+ return new TableModelElement((PapyrusTable)source, domain);
+ }
+
+}

Back to the top