info.magnolia.pages.app.dnd
Class TemplateTypeRestrictionDropConstraint

java.lang.Object
  extended by info.magnolia.ui.workbench.tree.drop.AlwaysTrueDropConstraint
      extended by info.magnolia.pages.app.dnd.TemplateTypeRestrictionDropConstraint
All Implemented Interfaces:
info.magnolia.ui.workbench.tree.drop.DropConstraint

public class TemplateTypeRestrictionDropConstraint
extends info.magnolia.ui.workbench.tree.drop.AlwaysTrueDropConstraint
implements info.magnolia.ui.workbench.tree.drop.DropConstraint

TemplateTypeRestrictionDropConstraint allows drag-n-drop if and only if the parent node's template type is compatible with child node's template.


Constructor Summary
TemplateTypeRestrictionDropConstraint(info.magnolia.rendering.template.assignment.TemplateDefinitionAssignment templateAssignment)
           
 
Method Summary
 boolean allowedAfter(com.vaadin.data.Item sourceItem, com.vaadin.data.Item targetItem)
           
 boolean allowedAsChild(com.vaadin.data.Item sourceItem, com.vaadin.data.Item targetItem)
           
 boolean allowedBefore(com.vaadin.data.Item sourceItem, com.vaadin.data.Item targetItem)
           
 boolean allowedToMove(com.vaadin.data.Item sourceItem)
           
 
Methods inherited from class info.magnolia.ui.workbench.tree.drop.AlwaysTrueDropConstraint
isAllowedAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.ui.workbench.tree.drop.DropConstraint
isAllowedAt
 

Constructor Detail

TemplateTypeRestrictionDropConstraint

@Inject
public TemplateTypeRestrictionDropConstraint(info.magnolia.rendering.template.assignment.TemplateDefinitionAssignment templateAssignment)
Method Detail

allowedAsChild

public boolean allowedAsChild(com.vaadin.data.Item sourceItem,
                              com.vaadin.data.Item targetItem)
Specified by:
allowedAsChild in interface info.magnolia.ui.workbench.tree.drop.DropConstraint
Overrides:
allowedAsChild in class info.magnolia.ui.workbench.tree.drop.AlwaysTrueDropConstraint

allowedBefore

public boolean allowedBefore(com.vaadin.data.Item sourceItem,
                             com.vaadin.data.Item targetItem)
Specified by:
allowedBefore in interface info.magnolia.ui.workbench.tree.drop.DropConstraint
Overrides:
allowedBefore in class info.magnolia.ui.workbench.tree.drop.AlwaysTrueDropConstraint

allowedAfter

public boolean allowedAfter(com.vaadin.data.Item sourceItem,
                            com.vaadin.data.Item targetItem)
Specified by:
allowedAfter in interface info.magnolia.ui.workbench.tree.drop.DropConstraint
Overrides:
allowedAfter in class info.magnolia.ui.workbench.tree.drop.AlwaysTrueDropConstraint

allowedToMove

public boolean allowedToMove(com.vaadin.data.Item sourceItem)
Specified by:
allowedToMove in interface info.magnolia.ui.workbench.tree.drop.DropConstraint
Overrides:
allowedToMove in class info.magnolia.ui.workbench.tree.drop.AlwaysTrueDropConstraint


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.