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
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')
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ConnectorItemProvider.java4
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ShapeItemProvider.java4
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.runtime/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/Activator.java10
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackApplicationSynchronizer.java17
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackSynchronizer.java109
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersModelEventNotifier.java7
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/service/LayersApplicationService.java24
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/DynamicContextMenu.java2
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/AbstractLayerCommand.java4
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/DynamicCreateChildMenu.java3
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/ShowCreateChildCommand.java1
-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
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/.options2
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers/ui/Activator.java6
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractCreateLayerExpressionHandler.java13
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayerStackCommand.java4
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java4
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachDiagramViewsToLayer.java11
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachLayerStackCommand.java3
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachPropertyFromListToLayer.java11
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerOperatorsFromParameter.java14
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DeleteItemHandler.java5
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DetachLayerStackCommand.java5
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/AttachDiagramSelectedItemsToCurrentLayer.java8
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/RemoveDiagramSelectedItemsFromCurrentLayer.java7
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/view/LayersExplorerView.java19
39 files changed, 340 insertions, 152 deletions
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ConnectorItemProvider.java b/extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ConnectorItemProvider.java
index fc3ee18ecc1..3a77c8cee0f 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ConnectorItemProvider.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ConnectorItemProvider.java
@@ -45,7 +45,7 @@ public class ConnectorItemProvider extends org.eclipse.gmf.runtime.notation.prov
@Override
public String getText(Object object) {
- System.err.println("getText()");
+// System.err.println("getText()");
Shape shape = (Shape)object;
Object domainObject = shape.getElement();
@@ -69,7 +69,7 @@ public class ConnectorItemProvider extends org.eclipse.gmf.runtime.notation.prov
*/
@Override
public Object getImage(Object object) {
- System.err.println("getImage()");
+// System.err.println("getImage()");
Shape shape = (Shape)object;
Object domainObject = shape.getElement();
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ShapeItemProvider.java b/extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ShapeItemProvider.java
index 83579e04b3b..24105e7e045 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ShapeItemProvider.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit/src/org/eclipse/papyrus/layers/notationmodel/edit/ShapeItemProvider.java
@@ -45,7 +45,7 @@ public class ShapeItemProvider extends org.eclipse.gmf.runtime.notation.provider
@Override
public String getText(Object object) {
- System.err.println("getText()");
+// System.err.println("getText()");
Shape shape = (Shape)object;
Object domainObject = shape.getElement();
@@ -69,7 +69,7 @@ public class ShapeItemProvider extends org.eclipse.gmf.runtime.notation.provider
*/
@Override
public Object getImage(Object object) {
- System.err.println("getImage()");
+// System.err.println("getImage()");
Shape shape = (Shape)object;
Object domainObject = shape.getElement();
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/META-INF/MANIFEST.MF b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/META-INF/MANIFEST.MF
index 40933ab25a5..3674cd2cd31 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/META-INF/MANIFEST.MF
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/META-INF/MANIFEST.MF
@@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.infra.core,
org.eclipse.core.resources;bundle-version="3.8.100",
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.0",
- org.eclipse.uml2.uml;bundle-version="4.1.1"
+ org.eclipse.uml2.uml;bundle-version="4.1.1",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.layers.runtime,
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/Activator.java b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/Activator.java
index fe8eb0d72c0..592e759c30c 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/Activator.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/Activator.java
@@ -10,13 +10,17 @@
******************************************************************************/
package org.eclipse.papyrus.layers.runtime;
-import org.osgi.framework.BundleActivator;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.osgi.framework.BundleContext;
-public class Activator implements BundleActivator {
+public class Activator extends Plugin {
private static BundleContext context;
+ /** Logging helper */
+ public static LogHelper log;
+
static BundleContext getContext() {
return context;
}
@@ -27,6 +31,8 @@ public class Activator implements BundleActivator {
*/
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
+ // register the login helper
+ log = new LogHelper(this);
}
/*
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackApplicationSynchronizer.java b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackApplicationSynchronizer.java
index 5e3cba92c77..356f6c78253 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackApplicationSynchronizer.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackApplicationSynchronizer.java
@@ -21,6 +21,7 @@ import org.eclipse.papyrus.layers.runtime.model.LayersModel;
import org.eclipse.papyrus.layers.runtime.model.LayersModelEventRootNotifier;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
+import static org.eclipse.papyrus.layers.runtime.Activator.log;
/**
@@ -287,7 +288,10 @@ public class LayerStackApplicationSynchronizer implements ILayersModelRootEventL
* @param msg
*/
public void layerStackAdded(Notification msg) {
- System.out.println("LayerStackApplicationSynchronizer.layerStackAdded : " + msg.getNewValue());
+
+ if(log.isDebugEnabled()) {
+ log.debug("LayerStackApplicationSynchronizer.layerStackAdded : " + msg.getNewValue());
+ }
// Find the LayerStack
LayersStack stack = LayersStackApplicationEventNotifier.getAddedLayerStack(msg);
@@ -338,7 +342,9 @@ public class LayerStackApplicationSynchronizer implements ILayersModelRootEventL
* @param msg
*/
public void layerStackRemoved(Notification msg) {
- System.out.println("LayerStack is removed" + msg.getOldValue());
+ if(log.isDebugEnabled()) {
+ log.debug("LayerStack is removed" + msg.getOldValue());
+ }
// Find the LayerStack
LayersStack stack = LayersStackApplicationEventNotifier.getRemovedLayerStack(msg);
@@ -355,7 +361,10 @@ public class LayerStackApplicationSynchronizer implements ILayersModelRootEventL
* @param msg
*/
public void diagramRemoved(Notification msg) {
- System.out.println(this.getClass().getSimpleName() + ".diagramRemoved() - " + msg.getOldValue());
+
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".diagramRemoved() - " + msg.getOldValue());
+ }
if( state != State.ApplicationCreated) {
return;
@@ -373,7 +382,7 @@ public class LayerStackApplicationSynchronizer implements ILayersModelRootEventL
LayerStackSynchronizer synchronizer = synchronizers.remove(diagram);
if( synchronizer != null ) {
// Should not happen
- System.err.println(this.getClass().getSimpleName() + ".diagramRemoved() - synchronizernot completly cleaned. Finish the job.");
+ log.info(this.getClass().getSimpleName() + ".diagramRemoved() - synchronizer not completly cleaned. Finish the job.");
synchronizer.dispose();
}
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackSynchronizer.java b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackSynchronizer.java
index e69ce3dc0a4..ef59e705a97 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackSynchronizer.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayerStackSynchronizer.java
@@ -27,6 +27,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.Property;
import org.eclipse.papyrus.layers.stackmodel.layers.PropertySetter;
import org.eclipse.papyrus.layers.stackmodel.notifier.DiagramViewEventNotifier;
import org.eclipse.papyrus.layers.stackmodel.notifier.IDiagramViewEventListener;
+import static org.eclipse.papyrus.layers.runtime.Activator.log;
/**
@@ -172,7 +173,10 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
*/
@Override
public void propertyValueAdded(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + ".propertyValueAdded " + notification.getNewValue());
+
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".propertyValueAdded " + notification.getNewValue());
+ }
PropertySetter setter = null;
try {
@@ -202,14 +206,13 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
setter.setValue(views.get(i), commands.get(i).getCmdValue() );
}
else {
- System.err.println( this.getClass().getSimpleName() + "ERROR - a cmd is null " + commands);
+ log.info(this.getClass().getSimpleName() + "ERROR - a cmd is null " + commands);
}
}
} catch (NotFoundException e) {
- System.err.println(e.getMessage());
+ log.error(e);
} catch (LayersException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.error(e);
} catch (UnsupportedOperationException e) {
// A setter or getter is not implemented
throw new UnsupportedOperationException("setter='" + setter.getClass().getName()+"'", e);
@@ -220,7 +223,9 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
@Override
public void propertyValueRemoved(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + ".propertyValueRemoved " + notification.getOldValue());
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".propertyValueRemoved " + notification.getOldValue());
+ }
try {
// Name of the property
@@ -254,10 +259,9 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
}
} catch (NotFoundException e) {
- System.err.println(e.getMessage());
+ log.error(e);
} catch (LayersException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.error(e);
}
}
@@ -265,7 +269,9 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
@Override
public void propertyValueChanged(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + ".propertyValueChanged " + notification.getNewValue());
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".propertyValueChanged " + notification.getNewValue());
+ }
// If LayerExpression::IsLayerEnabled() is changed, treat it separately.
if(notification.getFeature() == LayersPackage.eINSTANCE.getLayerExpression_IsLayerEnabled()) {
@@ -303,10 +309,9 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
}
}
} catch (NotFoundException e) {
- System.err.println(e.getMessage());
+ log.error(e);
} catch (LayersException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.error(e);
}
}
@@ -319,8 +324,12 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
* @param notification
*/
private void propertyValueChangedIsLayerEnabled(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + ".propertyValueChangedIsLayerEnabled " + notification.getNewValue());
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".propertyValueChangedIsLayerEnabled " + notification.getNewValue());
+
+ }
+
try {
checkApplication();
@@ -331,10 +340,9 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
recomputePropertiesForAllViewsOf(layer);
} catch (NotFoundException e) {
- System.err.println(e.getMessage());
+ log.error(e);
} catch (LayersException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.error(e);
}
}
@@ -387,7 +395,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
} catch (NotFoundException e) {
// No setter found
- System.err.println(e.getMessage());
+ log.error(e);
} catch (NullPointerException e) {
// A command is null
}
@@ -399,10 +407,12 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
@Override
public void layerAdded(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + ".layerAdded() " + notification.getNewValue());
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".layerAdded() " + notification.getNewValue());
+ }
if( ! (notification.getNewValue() instanceof AbstractLayer) ) {
- System.err.println( "TODO: " + this.getClass().getSimpleName() + ".layerAdded() " + notification.getOldValue() + " - recompute for LayerOperator not implemented yet.");;
+ log.info( "TODO: " + this.getClass().getSimpleName() + ".layerAdded() " + notification.getOldValue() + " - recompute for LayerOperator not implemented yet.");;
return;
}
@@ -413,7 +423,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
checkApplication();
recomputePropertiesForAllViewsOf(layer);
} catch (LayersException e) {
- e.printStackTrace();
+ log.error(e);
}
}
@@ -422,10 +432,12 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
@Override
public void layerRemoved(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + " layerRemoved() " + notification.getOldValue());
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + " layerRemoved() " + notification.getOldValue());
+ }
if( ! (notification.getOldValue() instanceof AbstractLayer) ) {
- System.err.println( "TODO: " + this.getClass().getSimpleName() + ".layerRemoved() " + notification.getOldValue() + " - recompute() after removing layerOperator not implemented yet.");;
+ log.info( "TODO: " + this.getClass().getSimpleName() + ".layerRemoved() " + notification.getOldValue() + " - recompute() after removing layerOperator not implemented yet.");;
return;
}
// Extract the affected layer
@@ -435,7 +447,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
checkApplication();
recomputePropertiesForAllViewsOf(layer);
} catch (LayersException e) {
- e.printStackTrace();
+ log.error(e);
}
}
@@ -472,7 +484,9 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
*/
@Override
public void layerMoved(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + " layerMoved(not tested) " + notification.getNewValue());
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + " layerMoved(not tested) " + notification.getNewValue());
+ }
// Extract the affected layer
AbstractLayer layer = (AbstractLayer)notification.getNewValue();
@@ -481,7 +495,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
checkApplication();
recomputePropertiesForAllViewsOf(layer);
} catch (LayersException e) {
- e.printStackTrace();
+ log.error(e);
}
}
@@ -494,7 +508,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
*/
@Override
public void layerSet(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + " layerSet(not implemented) " + notification.getNewValue());
+ log.info(this.getClass().getSimpleName() + " layerSet(not implemented) " + notification.getNewValue());
}
@@ -508,7 +522,10 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
*/
@Override
public void viewAddedToLayer(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + " viewAddedToLayer( " + notification.getNewValue() + " )");
+
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + " viewAddedToLayer( " + notification.getNewValue() + " )");
+ }
// We need to find the view, the layer in which it is added,
// and the properties attached to this layer.
@@ -536,21 +553,23 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
setter.setValue(view, commands.get(i).getCmdValue() );
} catch (NotFoundException e) {
// No setter found
- System.err.println(e.getMessage());
+ log.error("No setter found", e);
} catch (NullPointerException e) {
// A command is null
}
}
} catch (LayersException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.error(e);
}
}
@Override
public void multiViewsAddedToLayer(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + ".multiViewsAddedToLayer( " + notification.getNewValue() + " )");
+
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".multiViewsAddedToLayer( " + notification.getNewValue() + " )");
+ }
// We need to find the view, the layer in which it is added,
// and the properties attached to this layer.
@@ -564,7 +583,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
recompute(views, properties);
} catch (LayersException e) {
- e.printStackTrace();
+ log.error(e);
}
}
@@ -579,7 +598,10 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
*/
@Override
public void viewRemovedFromLayer(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + " viewRemovedFromLayer( " + notification.getOldValue() + " )");
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + " viewRemovedFromLayer( " + notification.getOldValue() + " )");
+ }
+
// We need to find the view, the layer in which it is added,
// and the properties attached to this layer.
// Then, we compute this property and set it to the view.
@@ -605,21 +627,24 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
setter.setValue(view, commands.get(i).getCmdValue() );
} catch (NotFoundException e) {
// No setter found
- System.err.println(e.getMessage());
+ log.error("No setter found", e);
} catch (NullPointerException e) {
// A command is null
}
}
} catch (LayersException e) {
// TODO Auto-generated catch block
- e.printStackTrace();
+ log.error(e);
}
}
@Override
public void multiViewsRemovedFromLayer(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + " multiViewsRemovedFromLayer( " + notification.getOldValue() + " )");
-
+
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + " multiViewsRemovedFromLayer( " + notification.getOldValue() + " )");
+ }
+
// We need to find the view, the layer in which it is added,
// and the properties attached to this layer.
// Then, we compute this property and set it to the view.
@@ -632,7 +657,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
recompute(views, properties);
} catch (LayersException e) {
- e.printStackTrace();
+ log.error(e);
}
}
@@ -648,7 +673,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
*/
@Override
public void viewMovedBetweenLayer(Notification notification) {
- System.out.println(this.getClass().getSimpleName() + " viewMovedBetweenLayer(not implemented) " + notification.getNewValue());
+ log.info(this.getClass().getSimpleName() + " viewMovedBetweenLayer(not implemented) " + notification.getNewValue());
}
@@ -662,7 +687,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
*/
@Override
public void diagramViewAdded(Notification msg) {
- System.out.println(this.getClass().getSimpleName() + " diagramViewAdded(not implemented) " + msg.getNewValue());
+ log.info(this.getClass().getSimpleName() + " diagramViewAdded(not implemented) " + msg.getNewValue());
// WARNING !!!
// Some filtering should be done on the event.
@@ -682,7 +707,7 @@ public class LayerStackSynchronizer implements IDiagramViewEventListener, ILayer
*/
@Override
public void diagramViewRemoved(Notification msg) {
- System.out.println(this.getClass().getSimpleName() + " diagramViewRemoved(not implemented) " + msg.getOldValue());
+ log.info(this.getClass().getSimpleName() + " diagramViewRemoved(not implemented) " + msg.getOldValue());
// WARNING !!!
// Some filtering should be done on the event.
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersModelEventNotifier.java b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersModelEventNotifier.java
index 0b28b9659e6..4c15cb07aab 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersModelEventNotifier.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersModelEventNotifier.java
@@ -24,7 +24,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
import org.eclipse.papyrus.layers.stackmodel.layers.TypeInstance;
import org.eclipse.papyrus.layers.stackmodel.layers.impl.StringToTypeInstanceMapImpl;
import org.eclipse.papyrus.layers.stackmodel.layers.util.ECoreUtils;
-
+import static org.eclipse.papyrus.layers.runtime.Activator.log;
/**
* This class listen to a {@link LayersStack} and send event to listeners.
@@ -52,7 +52,10 @@ public class LayersModelEventNotifier {
@Override
public void notifyChanged(Notification notification) {
- System.err.println( this.getClass().getSimpleName() + ".event received " + notification.getFeature());
+ if(log.isDebugEnabled() ) {
+ log.debug( this.getClass().getSimpleName() + ".event received " + notification.getFeature());
+ }
+
// Self atttach
super.notifyChanged(notification);
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/service/LayersApplicationService.java b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/service/LayersApplicationService.java
index 5095eb98ccd..c134f35ac93 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/service/LayersApplicationService.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/service/LayersApplicationService.java
@@ -10,7 +10,8 @@
******************************************************************************/
package org.eclipse.papyrus.layers.runtime.service;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import static org.eclipse.papyrus.layers.runtime.Activator.log;
+
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.NotFoundException;
import org.eclipse.papyrus.infra.core.services.IService;
@@ -21,7 +22,6 @@ import org.eclipse.papyrus.layers.runtime.LayerStackApplicationSynchronizer;
import org.eclipse.papyrus.layers.runtime.model.LayersModel;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
-
/**
* @author cedric dumoulin
*
@@ -39,10 +39,6 @@ public class LayersApplicationService implements IService {
*/
protected LayerStackApplicationSynchronizer layersSynchronizer;
/**
- * Papyrus editor instance
- */
- private IMultiDiagramEditor multiDiagramEditor;
- /**
* associated layerModel.
*/
private LayersModel layersModel;
@@ -69,7 +65,7 @@ public class LayersApplicationService implements IService {
public void init(ServicesRegistry servicesRegistry) throws ServiceException {
// Retrieve required services.
modelSet = servicesRegistry.getService(ModelSet.class);
- multiDiagramEditor = servicesRegistry.getService(IMultiDiagramEditor.class);
+// multiDiagramEditor = servicesRegistry.getService(IMultiDiagramEditor.class);
}
/**
@@ -93,11 +89,13 @@ public class LayersApplicationService implements IService {
// Check model
LayersStackApplication application = layersModel.getModelRoot();
boolean isAlreadyExist = (application !=null);
- if( isAlreadyExist) {
- System.out.println("LayerApplication already exist in modelSet");
- }
- else {
- System.out.println("LayerApplication do not exist in modelSet");
+ if( log.isDebugEnabled() ) {
+ if( isAlreadyExist) {
+ log.debug("LayerApplication already exist in modelSet");
+ }
+ else {
+ log.debug("LayerApplication do not exist in modelSet");
+ }
}
// Start synchronizer
@@ -117,7 +115,7 @@ public class LayersApplicationService implements IService {
layersSynchronizer = null;
layersModel = null;
modelSet = null;
- multiDiagramEditor = null;
+// multiDiagramEditor = null;
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/DynamicContextMenu.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/DynamicContextMenu.java
index 7cd1f73fda0..6956df0c05d 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/DynamicContextMenu.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/DynamicContextMenu.java
@@ -439,7 +439,7 @@ public class DynamicContextMenu implements ISelectionChangedListener {
*/
public void menuAboutToShow(IMenuManager menuManager) {
- System.err.println("menuAboutToShow("+ menuManager.getId()+ ")");
+// System.err.println("menuAboutToShow("+ menuManager.getId()+ ")");
MenuManager submenuManager = null;
submenuManager = new MenuManager(LayersEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/AbstractLayerCommand.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/AbstractLayerCommand.java
index 9db736d7ae8..b194d1a027d 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/AbstractLayerCommand.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/AbstractLayerCommand.java
@@ -154,7 +154,7 @@ public abstract class AbstractLayerCommand extends AbstractHandler {
if( ! (evaluationContext instanceof IEvaluationContext)) {
setBaseEnabled(false);
- System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ") - no context");
+// System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ") - no context");
return;
}
@@ -175,7 +175,7 @@ public abstract class AbstractLayerCommand extends AbstractHandler {
}
- System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ")");
+// System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ")");
}
/**
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/DynamicCreateChildMenu.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/DynamicCreateChildMenu.java
index c86b8afcaa6..41dcf8a9997 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/DynamicCreateChildMenu.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/DynamicCreateChildMenu.java
@@ -35,8 +35,7 @@ public class DynamicCreateChildMenu extends CompoundContributionItem {
*/
@Override
protected IContributionItem[] getContributionItems() {
- // TODO Auto-generated method stub
- System.err.println("getContributionItems()");
+// System.err.println("getContributionItems()");
IContributionItem[] items = new IContributionItem[1];
Map<String, String> parms = new HashMap<String, String>();
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/ShowCreateChildCommand.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/ShowCreateChildCommand.java
index f10113a8754..d87e2d4cf44 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/ShowCreateChildCommand.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/ShowCreateChildCommand.java
@@ -41,7 +41,6 @@ public class ShowCreateChildCommand extends AbstractLayerCommand implements IHan
*/
@Override
protected void doExecute(NotationDiagramHelper notationDiagramHelper) {
- System.out.println( this.getClass().getSimpleName() + ".doExecute()");
notationDiagramHelper.attachLayersStack();
}
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);
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/.options b/extraplugins/layers/org.eclipse.papyrus.layers.ui/.options
new file mode 100644
index 00000000000..9f800bbf670
--- /dev/null
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/.options
@@ -0,0 +1,2 @@
+# master switch
+org.eclipse.papyrus.layers.ui/debug=true \ No newline at end of file
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/META-INF/MANIFEST.MF b/extraplugins/layers/org.eclipse.papyrus.layers.ui/META-INF/MANIFEST.MF
index 39118cf72a3..020cb55b200 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/META-INF/MANIFEST.MF
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/META-INF/MANIFEST.MF
@@ -35,7 +35,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.navigator;bundle-version="3.5.300",
org.eclipse.gmf.runtime.notation.edit;bundle-version="1.7.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.gmfdiag.hyperlink;bundle-version="0.10.1"
+ org.eclipse.papyrus.infra.gmfdiag.hyperlink;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %providerName
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers/ui/Activator.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers/ui/Activator.java
index 997ac204182..0174a709562 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers/ui/Activator.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers/ui/Activator.java
@@ -10,6 +10,7 @@
******************************************************************************/
package org.eclipse.papyrus.layers.ui;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -24,6 +25,9 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
+ /** Logging helper */
+ public static LogHelper log;
+
/**
* The constructor
*/
@@ -37,6 +41,8 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ // register the login helper
+ log = new LogHelper(plugin);
}
/*
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractCreateLayerExpressionHandler.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractCreateLayerExpressionHandler.java
index a2845f1a15d..4d03ce9d3dd 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractCreateLayerExpressionHandler.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractCreateLayerExpressionHandler.java
@@ -23,6 +23,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperator;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersContainer;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
public abstract class AbstractCreateLayerExpressionHandler extends AbstractLayersCommand {
@@ -45,7 +46,9 @@ public abstract class AbstractCreateLayerExpressionHandler extends AbstractLayer
*/
@Override
protected void doExecute(ExecutionEvent event, IEvaluationContext context, List<Object> selections) {
- System.out.println( this.getClass().getSimpleName() + ".doExecute()");
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".doExecute()");
+ }
if(!isEnabled(context, selections)) {
return;
@@ -72,7 +75,9 @@ public abstract class AbstractCreateLayerExpressionHandler extends AbstractLayer
layer.setName("layer" + creationCount++);
layer.setApplication(application);
- System.out.println( this.getClass().getSimpleName() + ". layerCreated");
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ". layerCreated");
+ }
// insert layer in selected object
Object selection = selections.get(0);
@@ -108,7 +113,9 @@ public abstract class AbstractCreateLayerExpressionHandler extends AbstractLayer
}
Object first = selections.get(0);
boolean res = (first instanceof LayerOperator) || (first instanceof LayersStack);
- System.err.println("isEnable(" + res + ")");
+// if(log.isDebugEnabled()) {
+// log.debug("isEnable(" + res + ")");
+// }
return res;
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayerStackCommand.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayerStackCommand.java
index 2f224da9d37..09bf0554b63 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayerStackCommand.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayerStackCommand.java
@@ -155,7 +155,7 @@ public abstract class AbstractLayerStackCommand extends AbstractHandler {
if( ! (evaluationContext instanceof IEvaluationContext)) {
setBaseEnabled(false);
- System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ") - no context");
+// System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ") - no context");
return;
}
@@ -176,7 +176,7 @@ public abstract class AbstractLayerStackCommand extends AbstractHandler {
}
- System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ")");
+// System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ")");
}
/**
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java
index 96e96a98d68..3b43a846309 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java
@@ -221,7 +221,7 @@ public abstract class AbstractLayersCommand extends AbstractHandler {
if( ! (evaluationContext instanceof IEvaluationContext)) {
setBaseEnabled(false);
- System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ") - no context");
+// System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ") - no context");
return;
}
@@ -232,7 +232,7 @@ public abstract class AbstractLayersCommand extends AbstractHandler {
setBaseEnabled(isEnabled(context, selections));
- System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ")");
+// System.out.println(getCommandName() + ".setEnabled(" + isEnabled() + ")");
}
/**
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachDiagramViewsToLayer.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachDiagramViewsToLayer.java
index 029529d3f0f..afd682b560d 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachDiagramViewsToLayer.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachDiagramViewsToLayer.java
@@ -32,6 +32,8 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
+
/**
* Handler used to select multiples views to attach to the selected Layer.
@@ -79,6 +81,7 @@ public class AttachDiagramViewsToLayer extends AbstractLayersCommand {
try {
// Get the layer and application
+ @SuppressWarnings("unused")
LayersStackApplication application = lookupLayersStackApplicationChecked(context);
AbstractLayer layer = (AbstractLayer)getSelections(context).get(0);
@@ -158,13 +161,17 @@ public class AttachDiagramViewsToLayer extends AbstractLayersCommand {
// Remove unset views
for( View property : unsetProperties) {
- System.out.println("unset view " + property.getElement());
+ if(log.isDebugEnabled()) {
+ log.debug("unset view " + property.getElement());
+ }
layer.getViews().remove(property);
}
// add set instances
for( View property : setProperties) {
- System.out.println("set Property " + property.getElement());
+ if(log.isDebugEnabled()) {
+ log.debug("set Property " + property.getElement());
+ }
layer.getViews().add(property);
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachLayerStackCommand.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachLayerStackCommand.java
index 39b78f9f5d8..c7966e60385 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachLayerStackCommand.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachLayerStackCommand.java
@@ -13,7 +13,6 @@ package org.eclipse.papyrus.layers3.ui.commands;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.IHandler;
import org.eclipse.papyrus.layers.runtime.NotationDiagramHelper;
-import org.eclipse.papyrus.layers3.ui.view.LayersExplorerViewUtils;
/**
@@ -43,7 +42,7 @@ public class AttachLayerStackCommand extends AbstractLayerStackCommand implement
*/
@Override
protected void doExecute(ExecutionEvent event, NotationDiagramHelper notationDiagramHelper) {
- System.out.println( this.getClass().getSimpleName() + ".doExecute()");
+// System.out.println( this.getClass().getSimpleName() + ".doExecute()");
notationDiagramHelper.attachLayersStack();
// ensure the Layers explorer is open
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachPropertyFromListToLayer.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachPropertyFromListToLayer.java
index 297345f76ca..d0575182e4a 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachPropertyFromListToLayer.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AttachPropertyFromListToLayer.java
@@ -10,8 +10,9 @@
******************************************************************************/
package org.eclipse.papyrus.layers3.ui.commands;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
+
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
@@ -134,13 +135,17 @@ public class AttachPropertyFromListToLayer extends AbstractLayersCommand {
// Remove unset instances
for( Property property : unsetProperties) {
- System.out.println("unset Property " + property.getName());
+ if(log.isDebugEnabled()) {
+ log.debug("unset Property " + property.getName());
+ }
layer.removePropertyInstance(property);
}
// add set instances
for( Property property : setProperties) {
- System.out.println("set Property " + property.getName());
+ if(log.isDebugEnabled()) {
+ log.debug("set Property " + property.getName());
+ }
layer.addPropertyInstance(property);
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerOperatorsFromParameter.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerOperatorsFromParameter.java
index cf99c41fb58..78d29cba1d4 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerOperatorsFromParameter.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerOperatorsFromParameter.java
@@ -22,6 +22,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.AbstractLayerOperator;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerOperator;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStackApplication;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
/**
@@ -74,7 +75,9 @@ public class CreateLayerOperatorsFromParameter extends AbstractLayersCommand {
// Get command parameters
newLayerID = event.getParameter("org.eclipse.papyrus.layers.ui.createLayerOperator.parameters");
- System.err.println("Create Layer Operators '" + newLayerID + "'.");
+ if(log.isDebugEnabled()) {
+ log.debug("Create Layer Operators '" + newLayerID + "'.");
+ }
// Get application
try {
@@ -103,7 +106,9 @@ public class CreateLayerOperatorsFromParameter extends AbstractLayersCommand {
*/
@Override
protected void doExecute(ExecutionEvent event, IEvaluationContext context, List<Object> selections) {
- System.out.println( this.getClass().getSimpleName() + ".doExecute()");
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".doExecute()");
+ }
// Create a layer !
AbstractLayerOperator layerOperator;
@@ -113,8 +118,8 @@ public class CreateLayerOperatorsFromParameter extends AbstractLayersCommand {
layerOperator.setApplication(application);
} catch (LayersException e) {
// e.printStackTrace();
- System.err.println("Log - " + this.getClass().getName()
- + " - " + e.getMessage());
+ log.error("Log - " + this.getClass().getName()
+ + " - " + e.getMessage(), e);
return;
}
@@ -141,7 +146,6 @@ public class CreateLayerOperatorsFromParameter extends AbstractLayersCommand {
}
Object first = selections.get(0);
boolean res = (first instanceof LayerOperator) || (first instanceof LayersStack);
- System.err.println("isEnable(" + res + ")");
return res;
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DeleteItemHandler.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DeleteItemHandler.java
index cd62b7a52a8..00c5a158704 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DeleteItemHandler.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DeleteItemHandler.java
@@ -22,6 +22,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression;
import org.eclipse.papyrus.layers.stackmodel.layers.LayersStack;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
/**
@@ -73,7 +74,9 @@ public class DeleteItemHandler extends AbstractLayersCommand {
*/
@Override
protected void doExecute(ExecutionEvent event, IEvaluationContext context, List<Object> selections) {
- System.out.println( this.getClass().getSimpleName() + ".doExecute()");
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".doExecute()");
+ }
// insert layer in selected object
Object selection = selections.get(0);
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DetachLayerStackCommand.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DetachLayerStackCommand.java
index 083a639d0cb..ac5e31a469b 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DetachLayerStackCommand.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/DetachLayerStackCommand.java
@@ -16,6 +16,7 @@ package org.eclipse.papyrus.layers3.ui.commands;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.IHandler;
import org.eclipse.papyrus.layers.runtime.NotationDiagramHelper;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
/**
@@ -44,7 +45,9 @@ public class DetachLayerStackCommand extends AbstractLayerStackCommand implement
*/
@Override
protected void doExecute(ExecutionEvent event, NotationDiagramHelper notationDiagramHelper) {
- System.out.println( this.getClass().getSimpleName() + ".doExecute()");
+ if(log.isDebugEnabled()) {
+ log.debug(this.getClass().getSimpleName() + ".doExecute()");
+ }
notationDiagramHelper.removeLayersStack();
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/AttachDiagramSelectedItemsToCurrentLayer.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/AttachDiagramSelectedItemsToCurrentLayer.java
index 5b1635f264e..4bed4e1f453 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/AttachDiagramSelectedItemsToCurrentLayer.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/AttachDiagramSelectedItemsToCurrentLayer.java
@@ -33,6 +33,7 @@ import org.eclipse.papyrus.layers3.ui.commands.AbstractLayersCommand;
import org.eclipse.papyrus.layers3.ui.view.LayersExplorerView;
import org.eclipse.papyrus.layers3.ui.view.LayersExplorerViewUtils;
import org.eclipse.ui.IEditorPart;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
/**
* Attach the items selected in the diagram to the current Layer.
@@ -66,12 +67,12 @@ public class AttachDiagramSelectedItemsToCurrentLayer extends AbstractLayersComm
currentLayer = getSelectedLayerFromLayerExplorer(context);
} catch (NotFoundException e) {
// fail
- System.err.println("ERROR - " + this.getClass().getName() + " - " +e.getMessage());
+ log.error("ERROR - " + this.getClass().getName() + " - " +e.getMessage(), e);
return;
}
- System.out.println("selected views=" + diagramSelectedViews);
- System.out.println("selected layer=" + currentLayer.getName());
+// System.out.println("selected views=" + diagramSelectedViews);
+// System.out.println("selected layer=" + currentLayer.getName());
currentLayer.getViews().addAll(diagramSelectedViews);
}
@@ -115,7 +116,6 @@ public class AttachDiagramSelectedItemsToCurrentLayer extends AbstractLayersComm
* @param context
* @return
*/
- @SuppressWarnings("unchecked")
private List<View> getSelectedViewsFromCurrentDiagramEditor( IEvaluationContext context ) throws NotFoundException {
// TODO Auto-generated method stub
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/RemoveDiagramSelectedItemsFromCurrentLayer.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/RemoveDiagramSelectedItemsFromCurrentLayer.java
index 9fc89938c78..0fef34320a2 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/RemoveDiagramSelectedItemsFromCurrentLayer.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/RemoveDiagramSelectedItemsFromCurrentLayer.java
@@ -33,6 +33,7 @@ import org.eclipse.papyrus.layers3.ui.commands.AbstractLayersCommand;
import org.eclipse.papyrus.layers3.ui.view.LayersExplorerView;
import org.eclipse.papyrus.layers3.ui.view.LayersExplorerViewUtils;
import org.eclipse.ui.IEditorPart;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
/**
* Remove the items selected in the diagram from the current Layer.
@@ -68,12 +69,12 @@ public class RemoveDiagramSelectedItemsFromCurrentLayer extends AbstractLayersCo
currentLayer = getSelectedLayerFromLayerExplorer(context);
} catch (NotFoundException e) {
// fail
- System.err.println("ERROR - " + this.getClass().getName() + " - " +e.getMessage());
+ log.error("ERROR - " + this.getClass().getName() + " - " +e.getMessage(), e);
return;
}
- System.out.println("selected views=" + diagramSelectedViews);
- System.out.println("selected layer=" + currentLayer.getName());
+// System.out.println("selected views=" + diagramSelectedViews);
+// System.out.println("selected layer=" + currentLayer.getName());
currentLayer.getViews().removeAll(diagramSelectedViews);
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/view/LayersExplorerView.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/view/LayersExplorerView.java
index ef98fff830d..0f1657d11a0 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/view/LayersExplorerView.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/view/LayersExplorerView.java
@@ -62,6 +62,8 @@ import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.eclipse.wb.swt.SWTResourceManager;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
+import static org.eclipse.papyrus.layers.ui.Activator.log;
/**
@@ -142,7 +144,7 @@ public class LayersExplorerView extends ViewPart implements ITabbedPropertySheet
@Override
public void widgetDisposed(DisposeEvent e) {
- System.err.println(this.getClass().getName() + " is disposed !!!" + e.widget);
+ log.info(this.getClass().getName() + " is disposed !!!" + e.widget);
}
};
@@ -152,8 +154,10 @@ public class LayersExplorerView extends ViewPart implements ITabbedPropertySheet
@Override
public void selectionChanged(SelectionChangedEvent event) {
- System.out.println(LayersExplorerView.this.getClass().getSimpleName()
- + ".selectionChanged("+event.getSelection()+")" );
+ if(log.isDebugEnabled()) {
+ log.debug(LayersExplorerView.this.getClass().getSimpleName()
+ + ".selectionChanged("+event.getSelection()+")" );
+ }
}
@@ -363,7 +367,10 @@ public void createPartControl(Composite parent) {
* @param newContainer
*/
protected void activeSashWindowContainerChanged(ISashWindowsContainer newContainer) {
- System.err.println("activeSashWindowContainerChanged(" + (newContainer!=null?newContainer:"noContainer") + ")");
+
+ if(log.isDebugEnabled()) {
+ log.debug("activeSashWindowContainerChanged(" + (newContainer!=null?newContainer:"noContainer") + ")");
+ }
// check if there is a container
if(newContainer==null) {
@@ -500,7 +507,7 @@ public void createPartControl(Composite parent) {
ServicesRegistry registry = (ServicesRegistry)editor.getAdapter(ServicesRegistry.class);
if(registry == null) {
- System.err.println("New editor has no ServiceRegistry");
+ log.info("New editor has no ServiceRegistry");
setEmptyTreeInput();
return;
}
@@ -668,7 +675,7 @@ public void createPartControl(Composite parent) {
// Bad state
// FIXME Log error ?
- System.err.println("Error - "+ getClass().getSimpleName() + " - currentLayersModel and currentServicesRegistry should not be null.");
+ log.info("Error - "+ getClass().getSimpleName() + " - currentLayersModel and currentServicesRegistry should not be null.");
return null;
}

Back to the top