Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2011-12-22 14:39:29 +0000
committercletavernie2011-12-22 14:39:29 +0000
commit528c01335d849caa29dc88e5bac03c06635f3ccd (patch)
treecdc4a5398b734dcd580b4d1afaa6f4c96849e592 /plugins/infra
parentce71958c25fa13b2fc28d1dce03f9b7460db0852 (diff)
downloadorg.eclipse.papyrus-528c01335d849caa29dc88e5bac03c06635f3ccd.tar.gz
org.eclipse.papyrus-528c01335d849caa29dc88e5bac03c06635f3ccd.tar.xz
org.eclipse.papyrus-528c01335d849caa29dc88e5bac03c06635f3ccd.zip
351802: [Constraints] The Property View constraints model should be more generic
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351802
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints.edit/.classpath2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints.edit/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints.edit/plugin.properties2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints.editor/.classpath2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints.editor/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints.editor/plugin.properties2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/Model/ConstraintEnvironment.xmi23
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml7
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/schema/ConstraintEnvironment.exsd102
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/Constraint.java3
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java17
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintsManager.java68
-rw-r--r--plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/Activator.java5
-rw-r--r--plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/AbstractNattableEditorFactory.java6
-rw-r--r--plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/PapyrusCommandFactory.java2
-rw-r--r--plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/handlers/AbstractCreateNattableEditorCommand.java4
-rw-r--r--plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/listener/AbstractSynchronizedTableTriggerListener.java4
-rw-r--r--plugins/infra/table/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java5
19 files changed, 241 insertions, 21 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/.classpath b/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/.classpath
index 361578420b1..cedf0d0d0b5 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/.classpath
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src-gen"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <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="output" path="bin"/>
</classpath>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/META-INF/MANIFEST.MF
index 4a1cc5277e9..5cb11c11e8e 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.infra.constraints.edit;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 0.9.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.papyrus.infra.constraints.provider.ConstraintsEditPlugin$Implementation
Bundle-Vendor: %providerName
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/plugin.properties b/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/plugin.properties
index e95838aed4c..478a71e3ef0 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/plugin.properties
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints.edit/plugin.properties
@@ -5,7 +5,7 @@
# $Id$
pluginName = Constraints Edit Support
-providerName = www.example.org
+providerName = Eclipse Modeling Project
_UI_CreateChild_text = {0}
_UI_CreateChild_text2 = {1} {0}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/.classpath b/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/.classpath
index 361578420b1..cedf0d0d0b5 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/.classpath
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src-gen"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <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="output" path="bin"/>
</classpath>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/META-INF/MANIFEST.MF
index 88ea1e15d39..805619d191e 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.infra.constraints.editor;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 0.9.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.papyrus.infra.constraints.presentation.ConstraintsEditorPlugin$Implementation
Bundle-Vendor: %providerName
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/plugin.properties b/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/plugin.properties
index 24ae3d60522..005586b3423 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/plugin.properties
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints.editor/plugin.properties
@@ -5,7 +5,7 @@
# $Id$
pluginName = Constraints Editor
-providerName = www.example.org
+providerName = Eclipse Modeling Project
_UI_ConstraintsEditor_menu = &Constraints Editor
_UI_EnvironmentEditor_menu = &Environment Editor
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF
index 9c3de1a0cd1..65d0b7263de 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF
@@ -14,6 +14,7 @@ Export-Package: org.eclipse.papyrus.infra.constraints,
org.eclipse.papyrus.infra.constraints.environment.impl,
org.eclipse.papyrus.infra.constraints.environment.util,
org.eclipse.papyrus.infra.constraints.impl,
+ org.eclipse.papyrus.infra.constraints.providers,
org.eclipse.papyrus.infra.constraints.runtime,
org.eclipse.papyrus.infra.constraints.util
Require-Bundle: org.eclipse.core.runtime,
@@ -25,6 +26,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.facet.infra.browser.custom.core;bundle-version="0.1.0",
org.eclipse.papyrus.infra.core.log;bundle-version="0.9.0",
org.eclipse.papyrus.infra.emf;bundle-version="0.9.0",
- org.eclipse.papyrus.infra.tools;bundle-version="0.9.0";visibility:=reexport
+ org.eclipse.papyrus.infra.tools;bundle-version="0.9.0";visibility:=reexport,
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.9.0"
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: dependent
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/Model/ConstraintEnvironment.xmi b/plugins/infra/org.eclipse.papyrus.infra.constraints/Model/ConstraintEnvironment.xmi
new file mode 100644
index 00000000000..aaa785691c1
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/Model/ConstraintEnvironment.xmi
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ASCII"?>
+<environment:ConstraintEnvironment
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:environment="http://www.eclipse.org/papyrus/constraints/environment/0.9"
+ xsi:schemaLocation="http://www.eclipse.org/papyrus/constraints/environment/0.9 Constraints.ecore#//environment">
+ <constraintTypes
+ label="EMF Instance Of"
+ constraintClass="org.eclipse.papyrus.infra.constraints.constraints.EMFInstanceOfConstraint"/>
+ <constraintTypes
+ label="EMF Instance Of"
+ constraintClass="org.eclipse.papyrus.infra.constraints.constraints.TrueConstraint"/>
+ <constraintTypes
+ label="EMF Query"
+ constraintClass="org.eclipse.papyrus.infra.constraints.constraints.EMFQueryConstraint"/>
+ <constraintTypes
+ label="Java Instance Of"
+ constraintClass="org.eclipse.papyrus.infra.constraints.constraints.JavaInstanceOf"/>
+ <constraintTypes
+ label="Java Query"
+ constraintClass="org.eclipse.papyrus.infra.constraints.constraints.JavaQueryConstraint"/>
+</environment:ConstraintEnvironment>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml b/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml
index 0dd0dc5b91c..430364544e1 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml
@@ -8,6 +8,7 @@
$Id$
-->
<plugin>
+ <extension-point id="ConstraintEnvironment" name="ConstraintEnvironment" schema="schema/ConstraintEnvironment.exsd"/>
<extension point="org.eclipse.emf.ecore.generated_package">
<package class="org.eclipse.papyrus.infra.constraints.ConstraintsPackage" genModel="Model/Constraints.genmodel" uri="http://www.eclipse.org/papyrus/constraints/0.9"/>
@@ -23,5 +24,11 @@
loadByDefault="true">
</browserCustomization>
</extension>
+ <extension
+ point="org.eclipse.papyrus.infra.constraints.ConstraintEnvironment">
+ <environment
+ environmentModel="Model/ConstraintEnvironment.xmi">
+ </environment>
+ </extension>
</plugin>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/schema/ConstraintEnvironment.exsd b/plugins/infra/org.eclipse.papyrus.infra.constraints/schema/ConstraintEnvironment.exsd
new file mode 100644
index 00000000000..0cee06a42c3
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/schema/ConstraintEnvironment.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.infra.constraints" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.papyrus.infra.constraints" id="ConstraintEnvironment" name="ConstraintEnvironment"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="environment" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="environment">
+ <complexType>
+ <attribute name="environmentModel" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/Constraint.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/Constraint.java
index 3907b5eac04..11c5a18fcc1 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/Constraint.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/Constraint.java
@@ -22,9 +22,6 @@ import org.eclipse.papyrus.infra.constraints.DisplayUnit;
* @author Camille Letavernier
*
*/
-//TODO : To be refactored
-//The constraint framework should be accessible by other plug-ins which don't
-//necessarily depend on oep.properties
public interface Constraint {
/**
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java
new file mode 100644
index 00000000000..ca67aa621da
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java
@@ -0,0 +1,17 @@
+package org.eclipse.papyrus.infra.constraints.providers;
+
+import org.eclipse.papyrus.infra.constraints.runtime.ConstraintsManager;
+import org.eclipse.papyrus.infra.widgets.providers.AbstractFilteredContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+
+//TODO : Move that to customization.constraints
+public class ConstraintTypeContentProvider extends AbstractFilteredContentProvider implements IStaticContentProvider {
+
+ public ConstraintTypeContentProvider() {
+
+ }
+
+ public Object[] getElements() {
+ return ConstraintsManager.instance.getConstraintTypes().toArray();
+ }
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintsManager.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintsManager.java
new file mode 100644
index 00000000000..97c9ec2dce1
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintsManager.java
@@ -0,0 +1,68 @@
+package org.eclipse.papyrus.infra.constraints.runtime;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.papyrus.infra.constraints.Activator;
+import org.eclipse.papyrus.infra.constraints.environment.ConstraintEnvironment;
+import org.eclipse.papyrus.infra.constraints.environment.ConstraintType;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+
+
+public class ConstraintsManager {
+
+ public final static String EXTENSION_ID = Activator.PLUGIN_ID + ".ConstraintEnvironment"; //$NON-NLS-1$
+
+ private ResourceSet resourceSet;
+
+ private final Set<ConstraintEnvironment> environments;
+
+ private ConstraintsManager() {
+ environments = new HashSet<ConstraintEnvironment>();
+ resourceSet = new ResourceSetImpl();
+ loadExtensionPoint();
+ }
+
+ private void loadExtensionPoint() {
+ IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
+
+ for(IConfigurationElement e : config) {
+ final String environmentResource = e.getAttribute("environmentModel"); //$NON-NLS-1$
+ URI uri = URI.createURI("platform:/plugin/" + e.getContributor().getName() + "/" + environmentResource); //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ addEnvironment(uri);
+ } catch (IOException ex) {
+ Activator.log.error("The plugin " + e.getContributor() + " contributed an invalid " + "extension for " + EXTENSION_ID, ex); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ }
+ }
+ }
+
+ public void addEnvironment(URI uri) throws IOException {
+ EObject model = EMFHelper.loadEMFModel(resourceSet, uri);
+ if(model instanceof ConstraintEnvironment) {
+ addEnvironment((ConstraintEnvironment)model);
+ }
+ }
+
+ public void addEnvironment(ConstraintEnvironment environment) {
+ environments.add(environment);
+ }
+
+ public static ConstraintsManager instance = new ConstraintsManager();
+
+ public Collection<ConstraintType> getConstraintTypes() {
+ Collection<ConstraintType> constraintTypes = new HashSet<ConstraintType>();
+ for(ConstraintEnvironment environment : environments) {
+ constraintTypes.addAll(environment.getConstraintTypes());
+ }
+ return constraintTypes;
+ }
+}
diff --git a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/Activator.java b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/Activator.java
index 8eea7633de3..d9496b16e90 100644
--- a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/Activator.java
+++ b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/Activator.java
@@ -28,7 +28,8 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
- public LogHelper helper;
+ public static LogHelper log;
+
/**
* The constructor
*/
@@ -44,7 +45,7 @@ public class Activator extends AbstractUIPlugin {
public void start(final BundleContext context) throws Exception {
super.start(context);
plugin = this;
- helper = new LogHelper(this);
+ log = new LogHelper(this);
}
/*
diff --git a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/AbstractNattableEditorFactory.java b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/AbstractNattableEditorFactory.java
index 5c05e155184..a2242de3f65 100644
--- a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/AbstractNattableEditorFactory.java
+++ b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/AbstractNattableEditorFactory.java
@@ -23,6 +23,7 @@ import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.table.common.Activator;
import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorPart;
@@ -159,8 +160,7 @@ public abstract class AbstractNattableEditorFactory extends AbstractEditorFactor
registry = servicesRegistry.getService(ActionBarContributorRegistry.class);
} catch (ServiceException e) {
// Service not found
- // TODO Log the error
- e.printStackTrace();
+ Activator.log.error(e);
return null;
}
@@ -168,7 +168,7 @@ public abstract class AbstractNattableEditorFactory extends AbstractEditorFactor
return registry.getActionBarContributor(actionBarId);
} catch (BackboneException e) {
// TODO Log the error and throw an exception instead
- e.printStackTrace();
+ Activator.log.error(e);
return null;
}
}
diff --git a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/PapyrusCommandFactory.java b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/PapyrusCommandFactory.java
index e8cb358cef0..dc67fd3fadf 100644
--- a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/PapyrusCommandFactory.java
+++ b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/factory/PapyrusCommandFactory.java
@@ -124,7 +124,7 @@ public class PapyrusCommandFactory extends DefaultCommandFactory {
String className = owner.getClass().getCanonicalName();
if(className.contains("org.eclipse.emf.facet")) { //$NON-NLS-1$
String message = "the type " + className + " should be included in the test"; //$NON-NLS-1$ //$NON-NLS-2$
- Activator.getDefault().helper.info(message);
+ Activator.getDefault().log.info(message);
return true;
}
return false;
diff --git a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/handlers/AbstractCreateNattableEditorCommand.java b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/handlers/AbstractCreateNattableEditorCommand.java
index 90b12229ecf..11d45126704 100644
--- a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/handlers/AbstractCreateNattableEditorCommand.java
+++ b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/handlers/AbstractCreateNattableEditorCommand.java
@@ -183,7 +183,7 @@ public abstract class AbstractCreateNattableEditorCommand extends AbstractHandle
try {
CheckedOperationHistory.getInstance().execute(command, new NullProgressMonitor(), null);
} catch (ExecutionException e) {
- Activator.getDefault().helper.error("Can't create Table Editor", e); //$NON-NLS-1$
+ Activator.getDefault().log.error("Can't create Table Editor", e); //$NON-NLS-1$
}
}
@@ -258,7 +258,7 @@ public abstract class AbstractCreateNattableEditorCommand extends AbstractHandle
try {
impl = catalog.getModelQueryImpl(query);
} catch (ModelQueryException e) {
- Activator.getDefault().helper.error(e);
+ Activator.getDefault().log.error(e);
}
if(impl != null) {
ModelQueryResult result = impl.evaluate(context);
diff --git a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/listener/AbstractSynchronizedTableTriggerListener.java b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/listener/AbstractSynchronizedTableTriggerListener.java
index 1e04bb33546..958cbe03074 100644
--- a/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/listener/AbstractSynchronizedTableTriggerListener.java
+++ b/plugins/infra/table/org.eclipse.papyrus.infra.table.common/src/org/eclipse/papyrus/infra/table/common/listener/AbstractSynchronizedTableTriggerListener.java
@@ -99,7 +99,7 @@ public abstract class AbstractSynchronizedTableTriggerListener extends TriggerLi
try {
impl = catalog.getModelQueryImpl(query);
} catch (ModelQueryException e) {
- Activator.getDefault().helper.error(e);
+ Activator.getDefault().log.error(e);
}
if(impl != null) {
ModelQueryResult result = impl.evaluate(this.table.getTable().getContext());
@@ -280,7 +280,7 @@ public abstract class AbstractSynchronizedTableTriggerListener extends TriggerLi
try {
queryImpl = ModelQuerySetCatalog.getSingleton().getModelQueryImpl(query);
} catch (ModelQueryException e) {
- Activator.getDefault().helper.error(e);
+ Activator.getDefault().log.error(e);
}
for(EObject current : elementsToAdd) {
diff --git a/plugins/infra/table/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java b/plugins/infra/table/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java
index b6a808a04db..e7433ff7ace 100644
--- a/plugins/infra/table/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java
+++ b/plugins/infra/table/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.edit.EMFEditPlugin;
import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
import org.eclipse.emf.facet.infra.browser.custom.core.CustomizationsCatalog;
import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -39,7 +40,8 @@ public class Activator extends AbstractUIPlugin {
/** the customization manager */
private CustomizationManager fCustomizationManager;
- //FIXME : this plugin doesn't provide a LogHelper
+ public static LogHelper log;
+
/**
* The constructor
*/
@@ -55,6 +57,7 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ log = new LogHelper(this);
EMFEditPlugin.getComposedAdapterFactoryDescriptorRegistry();
}

Back to the top