menu.item.element.Class.New.item.Constructor = createMemberByPattern("DefaultFor:Constructor")
menu.item.element.Class.New.item.Constructor.name = ["menu/new.constructor"]
menu.item.element.Class.New.item.Constructor.enabled = !hasProperty("$ejbBean") || !hasProperty("$hasConstructor")

menu.item.element.Class.New.item.Create Method =
\         member = createMemberByPattern("EJB/Create Method")
menu.item.element.Class.New.item.Create Method.separator.before = true
menu.item.element.Class.New.item.Create Method.condition = hasProperty("$ejbBean") || hasProperty("$ejbHome")

menu.item.element.Class.New.item.Find Method =
\     createMemberByPattern("EJB/Find Method")
menu.item.element.Class.New.item.Find Method.condition = hasProperty("$ejbEntity") || hasProperty("$ejbHome")

menu.item.element.Class.New.item.Business Method =
\     createMemberByPattern("EJB/Business Method")
menu.item.element.Class.New.item.Business Method.condition = hasProperty("$ejbBean") || hasProperty("$ejbRemote")

menu.item.element.Class.New.item.Field =
\         member = createMemberByPattern("EJB/Field")
menu.item.element.Class.New.item.Field.condition = hasProperty("$ejbEntity")

menu.item.element.Class.New.item.Primary Key Field =
\         member = createMemberByPattern("EJB/Field");
\         member->setProperty("$primaryKey",true)
menu.item.element.Class.New.item.Primary Key Field.condition = hasProperty("$ejbEntity")

menu.item.element.Class.New.item.EJB Environment Reference =
\         member = createMemberByPattern("EJB/Environment Reference")
menu.item.element.Class.New.item.EJB Environment Reference.separator.before = true
menu.item.element.Class.New.item.EJB Environment Reference.condition = hasProperty("$ejbBean")

menu.item.element.Class.New.item.EJB Reference =
\         member = createMemberByPattern("EJB/Reference")
menu.item.element.Class.New.item.EJB Reference.condition = hasProperty("$ejbBean")

menu.item.element.Class.New.item.EJB Security Role Reference =
\         member = createMemberByPattern("EJB/Security Role Reference")
menu.item.element.Class.New.item.EJB Security Role Reference.condition = hasProperty("$ejbBean")

menu.item.element.Class.New.item.EJB Resource Reference =
\         member = createMemberByPattern("EJB/Resource Reference")
menu.item.element.Class.New.item.EJB Resource Reference.condition = hasProperty("$ejbBean")

resource.element.Class.icon.creators = "com/togethersoft/modules/ejb/classdiagram/images/Creators.gif"
resource.element.Class.icon.finders = "com/togethersoft/modules/ejb/classdiagram/images/Finders.gif"
resource.element.Class.icon.businessMethods = "com/togethersoft/modules/ejb/classdiagram/images/BusinessMethods.gif"
resource.element.Class.icon.references = "com/togethersoft/modules/ejb/classdiagram/images/references.gif"

view.map.*.Class.isTopLevel() && hasProperty("$ejbRole").byRequest =
\     if( hasProperty("$ejbBean") || hasProperty("$ejbHome"),
\         creators = addCompartment("$ScrolledRectangle","EJBCreators");
\	  creators->setCanContainChilds();
\         creatorsLabel = addToCompartment(label("",getIcon("creators")), "EJBCreators");
\         creatorsLabel->setAlignment("Right");
\         creatorsLabel->setLayoutConstraints(preferredHeight(12),fixedHeight(true))
\     );
\
\     if( hasProperty("$ejbEntity") || hasProperty("$ejbHome"),
\         finders = addCompartment("$ScrolledRectangle","EJBFinders");
\	  finders->setCanContainChilds();
\         findersLabel = addToCompartment(label("",getIcon("finders")), "EJBFinders");
\         findersLabel->setAlignment("Right");
\         findersLabel->setLayoutConstraints(preferredHeight(12),fixedHeight(true))
\     );
\
\     if( hasProperty("$ejbBean") || hasProperty("$ejbRemote"),
\         businessMethods = addCompartment("$ScrolledRectangle","EJBBusinessMethods");
\	  businessMethods->setCanContainChilds();
\         businessMethodsLabel = addToCompartment(label("",getIcon("businessMethods")),"EJBBusinessMethods");
\         businessMethodsLabel->setAlignment("Right");
\         businessMethodsLabel->setLayoutConstraints(preferredHeight(12),fixedHeight(true))
\     );
\
\     if( hasProperty("$ejbBean"),
\         references = addCompartment("$ScrolledRectangle","EJBReferences");
\         referencesLabel = addToCompartment(label("",getIcon("references")),"EJBReferences");
\         referencesLabel->setAlignment("Right");
\         referencesLabel->setLayoutConstraints(preferredHeight(12),fixedHeight(true))
\     );
\
\  markersCompartment = addCompartment( "RectangleInvisible", "MarkersCompartment" );
\  markersCompartment->setLayoutConstraints( minHeight(10), fixedHeight(true));
\  markers = markersCompartment->addCompartment( "RectangleInvisible", "Markers" );
\  markers->setLayoutConstraints( widthAlign("parentDefined"), heightAlign("parentDefined"), toDecreaseWidth(true) );
\  markers->setLayout( "Move" );
\  if( hasViewProperty("$imported") &&
\      ( !%diagram%->hasPropertyValue( "$shapeType", "ClassDiagram" ) || %diagram%->hasProperty( "$physicalPackage" ) ),
\      importedMark=markers->addCompartment( "ShortcutMark", "shortcutMark" );
\      importedMark->setLayoutConstraints( minWidth(12), minHeight(10), horizontalAlign("left") )
\    )

view.map.*.Operation.true.ejbCreatorMethod =
\     if(getParent()->getParent()->getGraphicProperty("$ejbComponent") != null && hasProperty("$ejbCreatorMethod"),
\         setCompartment("EJBCreators")
\     )

view.map.*.Operation.true.ejbFinderMethod =
\     if(getParent()->getParent()->getGraphicProperty("$ejbComponent") != null && hasProperty("$ejbFinderMethod"),
\         setCompartment("EJBFinders")
\     )

view.map.*.Operation.true.ejbBusinessMethod =
\     if(getParent()->getParent()->getGraphicProperty("$ejbComponent") != null && hasProperty("$ejbBusinessMethod"),
\         setCompartment("EJBBusinessMethods")
\     )

view.map.*.Attribute.true.primaryKey =
\     if(getParent()->getParent()->getGraphicProperty("$ejbComponent") != null && hasProperty("$primaryKey"),
\         setFont(%defaultFontName%, "Bold", 12)
\     )
