SysML

org.topcased.modeler.sysml.blockdefinitiondiagram.policies
Class EListLayoutEditPolicy

java.lang.Object
  extended by org.topcased.modeler.edit.policies.EListLayoutEditPolicy
      extended by org.topcased.modeler.sysml.blockdefinitiondiagram.policies.EListLayoutEditPolicy

public class EListLayoutEditPolicy
extends org.topcased.modeler.edit.policies.EListLayoutEditPolicy

A Layout that allow creation of eObjects in relation with an eStructuralFeature of the parent eObject or not. Contrary to org.topcased.modeler.edit.policies.EListLayoutEditPolicy, this edit policy allows only creation of childs which are of type of the eStructuralFeature


Field Summary
protected  EStructuralFeature _feature
           
 
Constructor Summary
EListLayoutEditPolicy(EStructuralFeature feature)
          The Constructor
 
Method Summary
protected  boolean isValid(EObject child, EObject parent)
          Check if the current EObject is a valid child for the parent EObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_feature

protected EStructuralFeature _feature
Constructor Detail

EListLayoutEditPolicy

public EListLayoutEditPolicy(EStructuralFeature feature)
The Constructor

Parameters:
feature - the EStructural feature that should be listed
Method Detail

isValid

protected boolean isValid(EObject child,
                          EObject parent)
Check if the current EObject is a valid child for the parent EObject. It's valid if the class of the child is the same than the type of the EStructuralFeature Derived classes are not allowed (because of Ports which are derived from Properties)

Parameters:
child - the child EObject
parent - the parent EObject
Returns:
true if the child can be added

SysML

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.