Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Dumoulin2014-03-25 14:33:37 +0000
committerCedric Dumoulin2014-03-25 14:38:28 +0000
commit39fa5fbfca2e49d3aeb359ab773f7cf4072b4471 (patch)
tree380fcf1b7b301553ddc8004d90e6f052df85050b /extraplugins/layers/org.eclipse.papyrus.layers.stackmodel
parent210fa20c99b8f172e936fc1e74ab1a5e30c0076b (diff)
downloadorg.eclipse.papyrus-39fa5fbfca2e49d3aeb359ab773f7cf4072b4471.tar.gz
org.eclipse.papyrus-39fa5fbfca2e49d3aeb359ab773f7cf4072b4471.tar.xz
org.eclipse.papyrus-39fa5fbfca2e49d3aeb359ab773f7cf4072b4471.zip
330199 - [Layers] - Replace syserr and sysout by log.
Diffstat (limited to 'extraplugins/layers/org.eclipse.papyrus.layers.stackmodel')
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/META-INF/MANIFEST.MF4
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/Activator.java46
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/exprmatcher/ValueChangedEventNotifier.java15
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java42
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerOperatorImpl.java7
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AllViewsDerivedLayerImpl.java6
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/CustomPropertyOperatorImpl.java5
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/RegExpLayerImpl.java9
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/StackedLayerOperatorImpl.java7
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/loaders/RegistriesLoader.java10
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/PropertyIndexedList.java32
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java6
12 files changed, 146 insertions, 43 deletions
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/META-INF/MANIFEST.MF b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/META-INF/MANIFEST.MF
index e4c6a78de80..e527a2ecc41 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/META-INF/MANIFEST.MF
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/META-INF/MANIFEST.MF
@@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.uml2.uml;bundle-version="4.1.0",
org.eclipse.ocl.ecore;bundle-version="3.3.0",
org.eclipse.emf.query.ocl;bundle-version="2.0.0",
- com.google.guava;bundle-version="11.0.2"
+ com.google.guava;bundle-version="11.0.2",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -26,3 +27,4 @@ Export-Package: org.eclipse.papyrus.layers.configmodel.layersconfig,
org.eclipse.papyrus.layers.stackmodel.layers.impl,
org.eclipse.papyrus.layers.stackmodel.layers.util,
org.eclipse.papyrus.layers.stackmodel.notifier
+Bundle-Activator: org.eclipse.papyrus.layers.stackmodel.Activator
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/Activator.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/Activator.java
new file mode 100644
index 00000000000..112b9104e23
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/Activator.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * 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:
+ * Cedric Dumoulin - cedric.dumoulin@lifl.fr
+ ******************************************************************************/
+package org.eclipse.papyrus.layers.stackmodel;
+
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends Plugin {
+
+ private static BundleContext context;
+
+ /** Logging helper */
+ public static LogHelper log;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ // register the login helper
+ log = new LogHelper(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/exprmatcher/ValueChangedEventNotifier.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/exprmatcher/ValueChangedEventNotifier.java
index adf6abe1cd3..175868dff3e 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/exprmatcher/ValueChangedEventNotifier.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/exprmatcher/ValueChangedEventNotifier.java
@@ -25,6 +25,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
import org.eclipse.papyrus.layers.stackmodel.notifier.LayersTreeEventNotifier;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.UMLPackage;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
@@ -247,8 +248,10 @@ public class ValueChangedEventNotifier extends EContentAdapter {
@Override
protected void selfAdapt(Notification notification)
{
- System.err.println( this.getClass().getSimpleName() + ".selfAdapt("+ notification+")" );
- // Handle the View::element tree
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".selfAdapt("+ notification+")" );
+ }
+
if (notification.getFeature() == NotationPackage.eINSTANCE.getView_Element())
{
handleContainment(notification);
@@ -266,13 +269,15 @@ public class ValueChangedEventNotifier extends EContentAdapter {
*/
@Override
protected void setTarget(EObject target) {
- System.err.println( this.getClass().getSimpleName() + ".setTarget("+ target+")" );
- super.setTarget(target);
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".setTarget("+ target+")" );
+ }
+
// Handle the View::element tree
if( target instanceof View ) {
EObject extraTarget = ((View)target).getElement();
if( extraTarget != null) {
- System.err.println( this.getClass().getSimpleName() + ".setExtraTarget("+ extraTarget+")" );
+ log.info( this.getClass().getSimpleName() + ".setExtraTarget("+ extraTarget+")" );
// copied from org.eclipse.emf.ecore.util.EContentAdapter.setTarget(EObject)
// basicSetTarget(target);
// Add the extra object
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java
index 7da435656f0..917669706bb 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerImpl.java
@@ -44,6 +44,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
import org.eclipse.papyrus.layers.stackmodel.layers.NullInstance;
import org.eclipse.papyrus.layers.stackmodel.layers.Property;
import org.eclipse.papyrus.layers.stackmodel.layers.TypeInstance;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
* <!-- begin-user-doc -->
@@ -533,7 +534,10 @@ public abstract class AbstractLayerImpl extends LayerExpressionImpl implements A
@Override
public void notifyChanged(Notification msg) {
- System.err.println("event " + msg.getEventType());
+ if(log.isDebugEnabled()) {
+ log.debug("event " + msg.getEventType());
+
+ }
switch(msg.getFeatureID(AbstractLayer.class)) {
case LayersPackage.ABSTRACT_LAYER__PROPERTY_VALUE_MAP:
@@ -554,7 +558,11 @@ public abstract class AbstractLayerImpl extends LayerExpressionImpl implements A
* @param msg
*/
protected void notifyLayerPropertyValueMapChanged(Notification msg) {
- System.err.println("map changed " + msg.getEventType());
+
+ if(log.isDebugEnabled()) {
+ log.debug("map changed " + msg.getEventType());
+ }
+
switch(msg.getEventType()) {
case Notification.SET:
{
@@ -562,9 +570,12 @@ public abstract class AbstractLayerImpl extends LayerExpressionImpl implements A
// Add the value to other list
// An entry is added
StringToTypeInstanceMapImpl entry = (StringToTypeInstanceMapImpl)msg.getNewValue();
- System.out.println("SET - newValue=" + entry.getValue()
- + ", key=" + entry.getKey());
-
+
+ if(log.isDebugEnabled()) {
+ log.debug("SET - newValue=" + entry.getValue()
+ + ", key=" + entry.getKey());
+ }
+
String newKey = entry.getKey();
TypeInstance value = entry.getValue();
if( value != null) {
@@ -589,8 +600,12 @@ public abstract class AbstractLayerImpl extends LayerExpressionImpl implements A
{
// An entry is added
StringToTypeInstanceMapImpl entry = (StringToTypeInstanceMapImpl)msg.getNewValue();
- System.out.println("ADD - newValue=" + entry.getValue()
- + ", key=" + entry.getKey());
+
+ if(log.isDebugEnabled()) {
+ log.debug("ADD - newValue=" + entry.getValue()
+ + ", key=" + entry.getKey());
+ }
+
// Add the corresponding instance to propertyValues
try {
synchronizePropertyValue(entry.getKey(), entry.getValue());
@@ -604,8 +619,12 @@ public abstract class AbstractLayerImpl extends LayerExpressionImpl implements A
{
// An entry is removed
StringToTypeInstanceMapImpl entry = (StringToTypeInstanceMapImpl)msg.getOldValue();
- System.out.println("REMOVE" + entry.getValue()
- + ", key=" + entry.getKey());
+
+ if(log.isDebugEnabled()) {
+ log.debug("REMOVE" + entry.getValue()
+ + ", key=" + entry.getKey());
+ }
+
// Add the corresponding instance to propertyValues
try {
synchronizePropertyValue(entry.getKey(), NullInstance.NULLINSTANCE);
@@ -625,7 +644,10 @@ public abstract class AbstractLayerImpl extends LayerExpressionImpl implements A
* @param msg
*/
protected void notifyLayerApplicationFeatureChanged(Notification msg) {
- System.err.println("application changed " + msg.getEventType());
+ if(log.isDebugEnabled()) {
+ log.debug("application changed " + msg.getEventType());
+ }
+
switch(msg.getEventType()) {
case Notification.SET:
{
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerOperatorImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerOperatorImpl.java
index 8bc0816c2ec..8b5ef856062 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerOperatorImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AbstractLayerOperatorImpl.java
@@ -30,6 +30,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperatorDescriptor;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
import org.eclipse.papyrus.layers.stackmodel.layers.Property;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
* <!-- begin-user-doc -->
@@ -193,7 +194,7 @@ public abstract class AbstractLayerOperatorImpl extends LayerOperatorImpl implem
LayerOperatorDescriptor descriptor = application.getLayerOperatorDescriptorRegistry().getLayerOperatorDescriptor(getLayerOperatorDescriptorName());
setLayerOperatorDescriptor(descriptor);
} catch (NotFoundException e) {
- System.err.println("LOG - " + this.getClass().getName() + " - " + e.getMessage() );
+ log.error("LOG - " + this.getClass().getName() + " - " + e.getMessage(), e );
}
}
@@ -365,9 +366,9 @@ public abstract class AbstractLayerOperatorImpl extends LayerOperatorImpl implem
res = getLayerOperatorDescriptor().getPropertyOperator(property).getComputePropertyValueCommand(collectedCmds);
} catch (UnsupportedOperationException e) {
// The operator is not implemented
- System.err.println(this.getClass().getSimpleName() + "WARNING - Operator not implemened for LayerOperator '"
+ log.error(this.getClass().getSimpleName() + "WARNING - Operator not implemened for LayerOperator '"
+ this.getClass().getSimpleName() +"' and property '"
- + property.getName() + "'.");
+ + property.getName() + "'.", e);
return null;
}
return res;
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AllViewsDerivedLayerImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AllViewsDerivedLayerImpl.java
index 906d9ee477d..dd9f68028d3 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AllViewsDerivedLayerImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/AllViewsDerivedLayerImpl.java
@@ -7,6 +7,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.AllViewsDerivedLayer;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
import org.eclipse.papyrus.layers.stackmodel.util.DiagramViewToListSynchronizer;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
* <!-- begin-user-doc -->
@@ -59,7 +60,10 @@ public class AllViewsDerivedLayerImpl extends AbstractLayerImpl implements AllVi
public void initLayer(LayersStack owningLayersStack) {
super.initLayer(owningLayersStack);
- System.err.println(this.getClass().getSimpleName() + ".initLayer(" + owningLayersStack + ")");
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".initLayer(" + owningLayersStack + ")");
+ }
+
// Set the diagram associated to this tree of layers
viewsListSynchronizer.setDiagram(owningLayersStack.getDiagram());
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/CustomPropertyOperatorImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/CustomPropertyOperatorImpl.java
index 62d047e704a..07b8df48959 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/CustomPropertyOperatorImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/CustomPropertyOperatorImpl.java
@@ -26,6 +26,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
import org.eclipse.papyrus.layers.stackmodel.operators.CustomPropertyOperatorsInstance;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceException;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
* <!-- begin-user-doc -->
@@ -157,8 +158,8 @@ public class CustomPropertyOperatorImpl extends PropertyOperatorImpl implements
resetOperatorInstance();
} catch (LayersException e) {
// TODO log the error
- System.err.println("LOG-" + this.getClass().getName()
- + "- Can't set custom operator instance '" + e.getMessage() + "'.");
+ log.error("LOG-" + this.getClass().getName()
+ + "- Can't set custom operator instance '" + e.getMessage() + "'.", e);
}
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/RegExpLayerImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/RegExpLayerImpl.java
index 5a85e033e9d..2dff594d0ef 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/RegExpLayerImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/RegExpLayerImpl.java
@@ -43,6 +43,7 @@ import org.eclipse.papyrus.layers.stackmodel.notifier.IDiagramViewEventListener;
import org.eclipse.papyrus.layers.stackmodel.util.ObservableListView;
import com.google.common.eventbus.Subscribe;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
* <!-- begin-user-doc -->
@@ -288,7 +289,7 @@ public class RegExpLayerImpl extends AbstractLayerImpl implements RegExpLayer {
expressionMatcher.refreshMatchingElements();
} catch (LayersException e) {
// silently fails, but log the error.
- System.err.println( "Error - " + this.getClass().getSimpleName() + " - " + e.getMessage());
+ log.error( "Error - " + this.getClass().getSimpleName() + " - " + e.getMessage(), e);
}
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LayersPackage.REG_EXP_LAYER__EXPR, oldExpr, expr));
@@ -461,7 +462,11 @@ public class RegExpLayerImpl extends AbstractLayerImpl implements RegExpLayer {
@Subscribe
public void expressionResultChanged( ObservableListView<View>.ObservableListEvent event) {
- System.out.println( this.getClass().getSimpleName() + ".expressionResultChanged()");
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".expressionResultChanged()");
+ }
+
+
if( ! event.getAddedElements().isEmpty()) {
getViews().addAll(event.getAddedElements());
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/StackedLayerOperatorImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/StackedLayerOperatorImpl.java
index e43a7bd55f1..91901a32d79 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/StackedLayerOperatorImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/StackedLayerOperatorImpl.java
@@ -21,6 +21,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayer;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperatorDescriptor;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
import org.eclipse.papyrus.layers.stackmodel.layers.StackedLayerOperator;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
* <!-- begin-user-doc -->
@@ -80,9 +81,9 @@ public class StackedLayerOperatorImpl extends AbstractLayerOperatorImpl implemen
setLayerOperatorDescriptor(descriptor);
} catch (NotFoundException e) {
// Not found
- // TODO log the error
- System.err.println("LOG-" + this.getClass().getName()
- + "- Can't get LayerOperatorDescriptor for descriptorName '" + getLayerOperatorDescriptorName() + "'.");
+ log.error( this.getClass().getName()
+ + "- Can't get LayerOperatorDescriptor for descriptorName '" + getLayerOperatorDescriptorName() + "'."
+ , e);
}
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/loaders/RegistriesLoader.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/loaders/RegistriesLoader.java
index 7866adcea7d..84bd0c82021 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/loaders/RegistriesLoader.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/loaders/RegistriesLoader.java
@@ -20,6 +20,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperatorDescriptorRegis
import org.eclipse.papyrus.layers.stackmodel.layers.Property;
import org.eclipse.papyrus.layers.stackmodel.layers.PropertyOperator;
import org.eclipse.papyrus.layers.stackmodel.layers.PropertyRegistry;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
@@ -61,8 +62,7 @@ public class RegistriesLoader implements ILayerOperatorDescriptorRegistryLoader
LayerOperatorDescriptor descriptor = layerOperatorConfig.createLayersOperatorDescriptor();
descriptorRegistry.addLayerOperatorDescriptor(descriptor);
} catch (InstanciationException e) {
- System.err.println("LOG - " + this.getClass().getName() + " - " + e.getMessage());
- e.printStackTrace();
+ log.error("LOG - " + this.getClass().getName() + " - " + e.getMessage(), e);
}
}
@@ -72,8 +72,7 @@ public class RegistriesLoader implements ILayerOperatorDescriptorRegistryLoader
PropertyOperator operator = operatorConfig.createOperatorDescriptor();
descriptorRegistry.addPropertyOperator(operator);
} catch (InstanciationException e) {
- System.err.println("LOG - " + this.getClass().getName() + " - " + e.getMessage());
- e.printStackTrace();
+ log.error("LOG - " + this.getClass().getName() + " - " + e.getMessage(), e);
}
}
@@ -86,8 +85,7 @@ public class RegistriesLoader implements ILayerOperatorDescriptorRegistryLoader
String operatorName = binding.getOperator().getName();
descriptorRegistry.attachOperatorToDescriptor(property, operatorName, layerDescriptorName);
} catch (NotFoundException e) {
- System.err.println("LOG - " + this.getClass().getName() + " - " + e.getMessage());
- e.printStackTrace();
+ log.error("LOG - " + this.getClass().getName() + " - " + e.getMessage(), e);
}
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/PropertyIndexedList.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/PropertyIndexedList.java
index 106cfd0badc..8bf5ff10f14 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/PropertyIndexedList.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/util/PropertyIndexedList.java
@@ -22,6 +22,7 @@ import org.eclipse.papyrus.layers.stackmodel.BadStateException;
import org.eclipse.papyrus.layers.stackmodel.LayersException;
import org.eclipse.papyrus.layers.stackmodel.NotFoundException;
import org.eclipse.papyrus.layers.stackmodel.layers.Property;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
@@ -287,8 +288,9 @@ public class PropertyIndexedList<T> extends EObjectResolvingEList<T> {
@Override
public void notifyChanged(Notification msg) {
- System.err.println("event " + msg.getEventType());
-
+ if(log.isDebugEnabled()) {
+ log.debug("event " + msg.getEventType());
+ }
// Check if the notification comes from the map
if( msg.getFeatureID(mapParentClasstype) == MAP_FEATURE_ID) {
@@ -301,7 +303,10 @@ public class PropertyIndexedList<T> extends EObjectResolvingEList<T> {
* @param msg
*/
protected void notifyLayerPropertyValueMapChanged(Notification msg) {
- System.err.println("map changed " + msg.getEventType());
+ if(log.isDebugEnabled()) {
+ log.debug("map changed " + msg.getEventType());
+ }
+
switch(msg.getEventType()) {
case Notification.SET:
{
@@ -309,8 +314,11 @@ public class PropertyIndexedList<T> extends EObjectResolvingEList<T> {
// Add the value to other list
@SuppressWarnings("unchecked")
Map.Entry<String, T> entry = (Map.Entry<String, T>)msg.getNewValue();
- System.out.println("SET - newValue=" + entry.getValue()
- + ", key=" + entry.getKey());
+
+ if(log.isDebugEnabled()) {
+ log.debug("SET - newValue=" + entry.getValue()
+ + ", key=" + entry.getKey());
+ }
// String newKey = (String)msg.getNewValue();
T value = entry.getValue();
@@ -338,8 +346,11 @@ public class PropertyIndexedList<T> extends EObjectResolvingEList<T> {
// An entry is added
@SuppressWarnings("unchecked")
Map.Entry<String, T> entry = (Map.Entry<String, T>)msg.getNewValue();
- System.out.println("ADD - newValue=" + entry.getValue()
- + ", key=" + entry.getKey());
+ if(log.isDebugEnabled()) {
+ log.debug("ADD - newValue=" + entry.getValue()
+ + ", key=" + entry.getKey());
+ }
+
// Add the corresponding instance to propertyValues
try {
synchronizePropertyValue(entry.getKey(), entry.getValue());
@@ -354,8 +365,11 @@ public class PropertyIndexedList<T> extends EObjectResolvingEList<T> {
// An entry is removed
@SuppressWarnings("unchecked")
Map.Entry<String, T> entry = (Map.Entry<String, T>)msg.getNewValue();
- System.out.println("REMOVE" + entry.getValue()
- + ", key=" + entry.getKey());
+ if(log.isDebugEnabled()) {
+ log.debug("REMOVE" + entry.getValue()
+ + ", key=" + entry.getKey());
+ }
+
// Add the corresponding instance to propertyValues
try {
synchronizePropertyValue(entry.getKey(), NULL_VALUE);
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java
index 44356efa3de..2cda8b6a336 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/notifier/LayersTreeEventNotifier.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.util.EContentAdapter;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersPackage;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
+import static org.eclipse.papyrus.layers.stackmodel.Activator.log;
/**
@@ -70,8 +71,11 @@ public class LayersTreeEventNotifier extends EContentAdapter {
*/
@Override
public void notifyChanged(Notification notification) {
- System.err.println( this.getClass().getSimpleName() + ".notifyChanged( "
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".notifyChanged( "
+ notification.getFeature() + ")");
+ }
+
// Self atttach
super.notifyChanged(notification);

Back to the top