Skip to content
Snippets Groups Projects
Commit 6ebcee94 authored by nullsub's avatar nullsub
Browse files

remove editpolicyhandler from modelPattern

parent 6a8f08b7
Branches
No related tags found
No related merge requests found
...@@ -99,10 +99,8 @@ public class ModelPattern extends FRaMEDShapePattern implements IPattern { ...@@ -99,10 +99,8 @@ public class ModelPattern extends FRaMEDShapePattern implements IPattern {
*/ */
@Override @Override
public boolean canAdd(IAddContext addContext) { public boolean canAdd(IAddContext addContext) {
if(addContext.getNewObject() instanceof Model && ((Model)addContext.getNewObject()).getParent() != null) { if(addContext.getNewObject() instanceof Model) {
Type type = ((Model) addContext.getNewObject()).getParent().getType(); return (UIUtil.getLinkedModelForDiagram(getDiagram()) == null);
return (UIUtil.getLinkedModelForDiagram(getDiagram()) == null)
&& EditPolicyService.getHandler(this.getDiagram()).canAdd(addContext, type);
} }
return false; return false;
} }
......
...@@ -60,6 +60,8 @@ public class EditPolicyHandler { ...@@ -60,6 +60,8 @@ public class EditPolicyHandler {
* @return * @return
*/ */
private List<ConstraintRule> getConstraints(ActionEnum action, Type type) { private List<ConstraintRule> getConstraints(ActionEnum action, Type type) {
System.out.println("Action: " + action.toString() + ", Type: " + type.toString());
List<ConstraintRule> rules = new LinkedList<>(); List<ConstraintRule> rules = new LinkedList<>();
if(type == null) if(type == null)
......
...@@ -35,7 +35,6 @@ public class EditPolicyService { ...@@ -35,7 +35,6 @@ public class EditPolicyService {
*/ */
private static Map<String, EditPolicyHandler> editPolicyHandlers; private static Map<String, EditPolicyHandler> editPolicyHandlers;
public static void initEditPolicyService() { public static void initEditPolicyService() {
EditPolicyService.editpolicymodels = new LinkedList<>(); EditPolicyService.editpolicymodels = new LinkedList<>();
EditPolicyService.editPolicyHandlers = new HashMap<>(); EditPolicyService.editPolicyHandlers = new HashMap<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment