Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Dumoulin2014-01-27 23:11:44 +0000
committerCedric Dumoulin2014-01-27 23:11:44 +0000
commit548b4274541122804c1e94b2bea547c1e345b2bb (patch)
tree762200c4dfea1eee41b50cea5eac249f3c52438b /extraplugins/layers
parent393d734365895e9901bbbd7a78794e7682364d6b (diff)
downloadorg.eclipse.papyrus-548b4274541122804c1e94b2bea547c1e345b2bb.tar.gz
org.eclipse.papyrus-548b4274541122804c1e94b2bea547c1e345b2bb.tar.xz
org.eclipse.papyrus-548b4274541122804c1e94b2bea547c1e345b2bb.zip
330199 - Layers are created at index 0 in layer operators.
Let the top layer be at index 0, and bottom layer at the end of the list of layers.
Diffstat (limited to 'extraplugins/layers')
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java4
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractCreateLayerExpressionHandler.java19
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerHandler.java3
3 files changed, 16 insertions, 10 deletions
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java
index 740ec69cb99..0131eaa69df 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel/src/org/eclipse/papyrus/layers/stackmodel/layers/impl/LayerOperatorImpl.java
@@ -89,7 +89,9 @@ public abstract class LayerOperatorImpl extends LayerExpressionImpl implements L
* @generated NOT
*/
public void addLayer(LayerExpression layer) {
- getLayers().add(layer);
+// getLayers().add(layer);
+ // Add layer on top of the stack.
+ getLayers().add(0, layer);
}
/**
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 82583889b25..a2845f1a15d 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
@@ -20,6 +20,7 @@ import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.layers.stackmodel.NotFoundException;
import org.eclipse.papyrus.layers.stackmodel.layers.LayerExpression;
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;
@@ -75,14 +76,18 @@ public abstract class AbstractCreateLayerExpressionHandler extends AbstractLayer
// insert layer in selected object
Object selection = selections.get(0);
- if(selection instanceof LayersStack) {
- LayersStack stack = (LayersStack)selection;
- stack.setLayers(layer);
- }
- else {
- LayerOperator operator = (LayerOperator)selection;
- operator.getLayers().add(layer);
+ if(selection instanceof LayersContainer) {
+ LayersContainer stack = (LayersContainer)selection;
+ stack.addLayer(layer);
}
+// if(selection instanceof LayersStack) {
+// LayersStack stack = (LayersStack)selection;
+// stack.setLayers(layer);
+// }
+// else {
+// LayerOperator operator = (LayerOperator)selection;
+// operator.getLayers().add(layer);
+// }
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerHandler.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerHandler.java
index 8ee5ff4795f..858296153b0 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerHandler.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/CreateLayerHandler.java
@@ -23,8 +23,7 @@ import org.eclipse.papyrus.layers.stackmodel.layers.LayersFactory;
* @author cedric dumoulin
*
*/
-public class CreateLayerHandler extends
-AbstractCreateLayerExpressionHandler implements IHandler {
+public class CreateLayerHandler extends AbstractCreateLayerExpressionHandler implements IHandler {
/**

Back to the top