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

remove editpolicyhandler from modelPattern

parent 6a8f08b7
No related branches found
No related tags found
No related merge requests found
......@@ -99,10 +99,8 @@ public class ModelPattern extends FRaMEDShapePattern implements IPattern {
*/
@Override
public boolean canAdd(IAddContext addContext) {
if(addContext.getNewObject() instanceof Model && ((Model)addContext.getNewObject()).getParent() != null) {
Type type = ((Model) addContext.getNewObject()).getParent().getType();
return (UIUtil.getLinkedModelForDiagram(getDiagram()) == null)
&& EditPolicyService.getHandler(this.getDiagram()).canAdd(addContext, type);
if(addContext.getNewObject() instanceof Model) {
return (UIUtil.getLinkedModelForDiagram(getDiagram()) == null);
}
return false;
}
......
......@@ -60,6 +60,8 @@ public class EditPolicyHandler {
* @return
*/
private List<ConstraintRule> getConstraints(ActionEnum action, Type type) {
System.out.println("Action: " + action.toString() + ", Type: " + type.toString());
List<ConstraintRule> rules = new LinkedList<>();
if(type == null)
......
......@@ -35,7 +35,6 @@ public class EditPolicyService {
*/
private static Map<String, EditPolicyHandler> editPolicyHandlers;
public static void initEditPolicyService() {
EditPolicyService.editpolicymodels = new LinkedList<>();
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