# Internal organization of this config file:
#
#  Level 0: a)All concrete commands (no wildcards) which need to be displayed always first (usaully "NEW" ones)
#           b)All common commands (with wildcards) which need to be displayed before concrete commands from level 1 (for example, "Add..")
#  Level 1: a)separation line (defined in first command from b)  )
#           b)All concrete commands (no wildcards) which need to be displayed after possible appearance of common command defined in level 0 (for example, "cut, copy"..)
#           c)All common commands (with wildcards) which need to be displayed before concrete commands from level 2
#  Level 2: a)separation line (defined in first command from b)  )
#           b)All concrete commands (no wildcards) which need to be displayed after possible appearance of common command defined in level 1
#           c)All common commands (with wildcards) which need to be displayed before concrete commands from level 3
#  ...

#=================
#     Diagram level 0
#=================
menu.item.element.*.Open Diagram.separator.before = true
menu.item.element.*.Open Diagram = openDiagram()
menu.item.element.*.Open Diagram.condition = (isDiagram() && %element% != %diagram% && !hasPropertyValue("$modelPart", "process")) || (%diagram% == null && !hasPropertyValue("$modelPart", "process"))
menu.item.element.*.Open Diagram.name = if (isDiagram(), "Open", "Open Diagram")
menu.item.element.*.Open Diagram in New Tab = openDiagramInNewWindow()
menu.item.element.*.Open Diagram in New Tab.condition = isDiagram() && %element% != %diagram%
menu.item.element.*.Open Diagram in New Tab.name = ["menu/open_in_new_tab"]

menu.item.element.*.Import = importToActiveDiagram()
menu.item.element.*.Import.name = ["menu/add_dialog_title"]
menu.item.element.*.Import.condition = %element% != %diagram% && %diagram% == null
menu.item.element.*.Import.separator.after = true


menu.item.element.ClassDiagram.New = group
menu.item.element.ClassDiagram.New.name = ["menu/new"]
menu.item.element.ClassDiagram.New.item.Class = createNodeByPattern("DefaultFor:Class")
menu.item.element.ClassDiagram.New.item.Class.condition = hasPropertyValue("$modelPart", "model") && %DEFAULT_LANGUAGE% != "idl"
menu.item.element.ClassDiagram.New.item.Class.icon = "DiagramElementsToolbar/Class.gif"
menu.item.element.ClassDiagram.New.item.Class.name = ["menu/new.class"]
menu.item.element.ClassDiagram.New.item.Class.shortcut = CTRL+L
menu.item.element.ClassDiagram.New.item.Struct = createNodeByPattern("DefaultFor:Class")
menu.item.element.ClassDiagram.New.item.Struct.condition = hasPropertyValue("$modelPart", "model") && %DEFAULT_LANGUAGE% == "idl"
menu.item.element.ClassDiagram.New.item.Struct.icon = "DiagramElementsToolbar/Class.gif"
menu.item.element.ClassDiagram.New.item.Struct.name = ["menu/new.struct"]
menu.item.element.ClassDiagram.New.item.Struct.shortcut = CTRL+L
menu.item.element.ClassDiagram.New.item.Interface = createNodeByPattern("DefaultFor:Interface")
menu.item.element.ClassDiagram.New.item.Interface.condition = hasPropertyValue("$modelPart", "model")
menu.item.element.ClassDiagram.New.item.Interface.icon = "DiagramElementsToolbar/Interface.gif"
menu.item.element.ClassDiagram.New.item.Interface.name = ["menu/new.interface"]
menu.item.element.ClassDiagram.New.item.Interface.shortcut = CTRL+SHIFT+L
menu.item.element.ClassDiagram.New.item.Class by Pattern = choosePatternAndCreateNode()
menu.item.element.ClassDiagram.New.item.Class by Pattern.condition = hasPropertyValue("$modelPart", "model")
menu.item.element.ClassDiagram.New.item.Class by Pattern.icon = "DiagramElementsToolbar/CustomClass.gif"
menu.item.element.ClassDiagram.New.item.Package = createPackage()
;menu.item.element.ClassDiagram.New.item.Package.condition = %element% == %diagram%
menu.item.element.ClassDiagram.New.item.Package.condition = hasPropertyValue("$modelPart", "model")
menu.item.element.ClassDiagram.New.item.Package.icon = "DiagramElementsToolbar/Package.gif"
menu.item.element.ClassDiagram.New.item.Package.name = ["menu/new.package"]
menu.item.element.ClassDiagram.New.item.Package.shortcut = CTRL+E
menu.item.element.ClassDiagram.New.item.Valuetype = createNodeByPattern("DefaultFor:Valuetype")
menu.item.element.ClassDiagram.New.item.Valuetype.condition = hasPropertyValue("$modelPart", "model") && %DEFAULT_LANGUAGE% == "idl"
menu.item.element.ClassDiagram.New.item.Valuetype.icon = "DiagramElementsToolbar/Valuetype.gif"
menu.item.element.ClassDiagram.New.item.Valuetype.name = ["menu/new.valuetype"]
menu.item.element.ClassDiagram.New.item.Exception = createNodeByPattern("DefaultFor:Exception")
menu.item.element.ClassDiagram.New.item.Exception.condition = hasPropertyValue("$modelPart", "model") && %DEFAULT_LANGUAGE% == "idl"
menu.item.element.ClassDiagram.New.item.Exception.icon = "DiagramElementsToolbar/Exception.gif"
menu.item.element.ClassDiagram.New.item.Exception.name = ["menu/new.exception"]


#=================
#      Class level 0
#=================
menu.item.element.Class.New = group
menu.item.element.Class.New.name = ["menu/new"]
menu.item.element.Class.New.item.Attribute = createMemberByPattern("DefaultFor:Attribute")
menu.item.element.Class.New.item.Attribute.shortcut = CTRL+A
menu.item.element.Class.New.item.Attribute.name = ["menu/new.attribute"]
menu.item.element.Class.New.item.Operation = createMemberByPattern("DefaultFor:Operation")
menu.item.element.Class.New.item.Operation.shortcut = CTRL+O
menu.item.element.Class.New.item.Operation.name = ["menu/new.operation"]
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.Destructor = createMemberByPattern("DefaultFor:Destructor")
menu.item.element.Class.New.item.Destructor.name = ["menu/new.destructor"]
menu.item.element.Class.New.item.Property = createMemberByPattern("Property")
menu.item.element.Class.New.item.Property.name = ["menu/new.property"]
menu.item.element.Class.New.item.Property.shortcut =CTRL+B
menu.item.element.Class.New.item.Property.condition = (!hasProperty("$interface")) || (!hasOptionValue("option.beans.recognizeInterfaces", "none" ))
menu.item.element.Class.New.item.Member by Pattern = choosePatternAndCreateMember()
menu.item.element.Class.New.item.Member by Pattern.name = ["menu/new.member_by_pattern"]
menu.item.element.Class.New.item.Member by Pattern.shortcut = CTRL+T
menu.item.element.Class.New.item.Member by Pattern.condition = isFeatureEnabledByWorkspace("class.menu.Member by Pattern")
menu.item.element.Class.New.item.Inner Class = createNodeByPattern("DefaultFor:Class")
menu.item.element.Class.New.item.Inner Class.name = ["menu/new.inner_class"]
menu.item.element.Class.New.item.Inner Class.condition = !hasPropertyValue("$language","idl")
menu.item.element.Class.New.item.Struct = createNodeByPattern("DefaultFor:Class")
menu.item.element.Class.New.item.Struct.name = ["menu/new.struct"]
menu.item.element.Class.New.item.Struct.condition = hasPropertyValue("$language","idl")
menu.item.element.Class.New.item.Exception = createNodeByPattern("DefaultFor:Exception")
menu.item.element.Class.New.item.Exception.name = ["menu/new.exception"]
menu.item.element.Class.New.item.Exception.condition = hasPropertyValue("$language","idl")

#=================
# Package level 0
#=================
menu.item.element.Package.New = group
menu.item.element.Package.New.name = ["menu/new"]
menu.item.element.Package.New.item.Diagram = newDiagram()
menu.item.element.Package.New.item.Diagram.condition = hasPropertyValue("$modelPart", "model")
menu.item.element.Package.New.item.Diagram.icon = "MainToolbar/tb-main-new.gif"
menu.item.element.Package.New.item.Diagram.name = ["menu/new.diagram"]
menu.item.element.Package.New.item.Class = createNodeByPattern("DefaultFor:Class")
menu.item.element.Package.New.item.Class.condition = hasPropertyValue("$modelPart", "model") && %DEFAULT_LANGUAGE% != "idl"
menu.item.element.Package.New.item.Class.icon = "DiagramElementsToolbar/Class.gif"
menu.item.element.Package.New.item.Class.name = ["menu/new.class"]
menu.item.element.Package.New.item.Class.shortcut = CTRL+L
menu.item.element.Package.New.item.Struct = createNodeByPattern("DefaultFor:Class")
menu.item.element.Package.New.item.Struct.condition = hasPropertyValue("$modelPart", "model") && %DEFAULT_LANGUAGE% == "idl"
menu.item.element.Package.New.item.Struct.icon = "DiagramElementsToolbar/Class.gif"
menu.item.element.Package.New.item.Struct.name = ["menu/new.struct"]
menu.item.element.Package.New.item.Struct.shortcut = CTRL+L
menu.item.element.Package.New.item.Interface = createNodeByPattern("DefaultFor:Interface")
menu.item.element.Package.New.item.Interface.condition = hasPropertyValue("$modelPart", "model")
menu.item.element.Package.New.item.Interface.icon = "DiagramElementsToolbar/Interface.gif"
menu.item.element.Package.New.item.Interface.name = ["menu/new.interface"]
menu.item.element.Package.New.item.Interface.shortcut = CTRL+SHIFT+L
menu.item.element.Package.New.item.Class by Pattern = choosePatternAndCreateNode()
menu.item.element.Package.New.item.Class by Pattern.condition = hasPropertyValue("$modelPart", "model")
menu.item.element.Package.New.item.Class by Pattern.icon = "DiagramElementsToolbar/CustomClass.gif"
menu.item.element.Package.New.item.Package = createPackage()
menu.item.element.Package.New.item.Package.condition = hasPropertyValue("$modelPart", "model")
menu.item.element.Package.New.item.Package.icon = "DiagramElementsToolbar/Package.gif"
menu.item.element.Package.New.item.Package.name = ["menu/new.package"]
menu.item.element.Package.New.item.Package.shortcut = CTRL+E
menu.item.element.Package.New.item.Valuetype = createNodeByPattern("DefaultFor:Valuetype")
menu.item.element.Package.New.item.Valuetype.condition = hasPropertyValue("$modelPart", "model") && %DEFAULT_LANGUAGE% == "idl"
menu.item.element.Package.New.item.Valuetype.icon = "DiagramElementsToolbar/Valuetype.gif"
menu.item.element.Package.New.item.Valuetype.name = ["menu/new.valuetype"]
menu.item.element.Package.New.item.Exception = createNodeByPattern("DefaultFor:Exception")
menu.item.element.Package.New.item.Exception.condition = hasPropertyValue("$modelPart", "model") && %DEFAULT_LANGUAGE% == "idl"
menu.item.element.Package.New.item.Exception.icon = "DiagramElementsToolbar/Exception.gif"
menu.item.element.Package.New.item.Exception.name = ["menu/new.exception"]


#=================
#    Shortcuts on class's members
#=================
menu.item.element.*.New Attribute Shortcut = getParent()->createMemberByPattern("DefaultFor:Attribute")
menu.item.element.*.New Attribute Shortcut.condition = isMember() && getParent()->hasPropertyValue("$shapeType", "Class")
menu.item.element.*.New Attribute Shortcut.shortcut = CTRL+A
menu.item.element.*.New Attribute Shortcut.hidden = true
menu.item.element.*.New Operation Shortcut = getParent()->createMemberByPattern("DefaultFor:Operation")
menu.item.element.*.New Operation Shortcut.condition = isMember() && getParent()->hasPropertyValue("$shapeType", "Class")
menu.item.element.*.New Operation Shortcut.shortcut = CTRL+O
menu.item.element.*.New Operation Shortcut.hidden = true
menu.item.element.*.New Property Shortcut = getParent()->createMemberByPattern("Property")
menu.item.element.*.New Property Shortcut.condition = isMember() && getParent()->hasPropertyValue("$shapeType", "Class")
menu.item.element.*.New Property Shortcut.shortcut = CTRL+B
menu.item.element.*.New Property Shortcut.hidden = true


#=================
#    Attribute level 0
#=================
menu.item.element.Attribute.New Attribute =
\  newAttribute = getParent()->createMemberByPattern("DefaultFor:Attribute");
\  cut(newAttribute);
\  newAttribute = paste(BEFORE);
\  newAttribute->editInplace(null, true)
menu.item.element.Attribute.New Attribute.name = ["menu/new_attribute"]
menu.item.element.Attribute.New Attribute.shortcut = INSERT

# Uncomment for VisualCafe plugin
; menu.item.element.Attribute.OpenInVisualCafe.separator.before = true
; menu.item.element.Attribute.OpenInVisualCafe.condition = isPlugin()
; menu.item.element.Attribute.OpenInVisualCafe           = editWithSymantec()
; menu.item.element.Attribute.OpenInVisualCafe.name      = "Go to Source"
; menu.item.element.Attribute.OpenInVisualCafe.separator.after  = true



#=================
#    Operation level 0
#=================
menu.item.element.Operation.New Operation =
\  newOperation = getParent()->createMemberByPattern("DefaultFor:Operation");
\  cut(newOperation);
\  newOperation = paste(BEFORE);
\  newOperation->editInplace(null, true)
menu.item.element.Operation.New Operation.name = ["menu/new_operation"]
menu.item.element.Operation.New Operation.shortcut = INSERT

# Uncomment for VisualCafe plugin
; menu.item.element.Operation.OpenInVisualCafe.separator.before = true
; menu.item.element.Operation.OpenInVisualCafe.condition = isPlugin()
; menu.item.element.Operation.OpenInVisualCafe           = editWithSymantec()
; menu.item.element.Operation.OpenInVisualCafe.name      = "Go to Source"
; menu.item.element.Operation.OpenInVisualCafe.separator.after  = true

#=================
#    BeanProperty level 0
#=================
menu.item.element.BeanProperty.New Property =
\  newProperty = getParent()->createMemberByPattern("Property");
\  cut(newProperty);
\  newProperty = paste(BEFORE);
\  newProperty->editInplace(null, true)
menu.item.element.BeanProperty.New Property.name = ["menu/new_property"]
menu.item.element.BeanProperty.New Property.shortcut = INSERT


#=================
# Object level 0
#=================
menu.item.element.Object.New = group
menu.item.element.Object.New.name = ["menu/new"]
menu.item.element.Object.New.item.Class = node = getContainingPackage()->getContainingPackage()->createNodeByPattern("DefaultFor:Class");
\  setProperty( "$instantiates", getProperty( node, "$fullName" ) );
\  setSelected(%element%);
\  selectNodeInOI("$classInspector")
menu.item.element.Object.New.item.Class.icon = "DiagramElementsToolbar/Class.gif"
menu.item.element.Object.New.item.Class.name = ["menu/new.class"]
menu.item.element.Object.New.item.Interface = node = getContainingPackage()->getContainingPackage()->createNodeByPattern("DefaultFor:Interface");
\  setProperty( "$instantiates", getProperty( node, "$fullName" ) );
\  setSelected(%element%);
\  selectNodeInOI("$classInspector")
menu.item.element.Object.New.item.Interface.icon = "DiagramElementsToolbar/Interface.gif"
menu.item.element.Object.New.item.Interface.name = ["menu/new.interface"]


#=================
#    Message level 0
#=================
menu.item.element.MessageLink.New = group
menu.item.element.MessageLink.New.name = ["menu/new"]
menu.item.element.MessageLink.New.enabled =
\  getDestination()->hasProperty( "$instantiatedClass" ) &&
\  !( findElement( getDestination()->getProperty( "$instantiatedClass" ) )->hasProperty( "$readOnly" ) )

menu.item.element.MessageLink.New.item.Operation =
\  class = findElement( getDestination()->getProperty( "$instantiatedClass" ) );
\  operation = class->createMemberByPattern( "DefaultFor:Operation" );
\  setProperty( "operation", operation->getProperty( "$uniqueName" ) );
\  setSelected(%element%);
\  selectNodeInOI("$operationInspector")
menu.item.element.MessageLink.New.item.Operation.name = ["menu/new.operation"]
menu.item.element.MessageLink.New.item.Constructor =
\  class = findElement( getDestination()->getProperty( "$instantiatedClass" ) );
\  operation = class->createMemberByPattern( "DefaultFor:Constructor" );
\  setProperty( "operation", operation->getProperty( "$uniqueName" ) );
\  setSelected(%element%);
\  selectNodeInOI("$operationInspector")
menu.item.element.MessageLink.New.item.Constructor.name = ["menu/new.constructor"]
menu.item.element.MessageLink.New.item.Destructor =
\  class = findElement( getDestination()->getProperty( "$instantiatedClass" ) );
\  operation = class->createMemberByPattern( "DefaultFor:Destructor" );
\  setProperty( "operation", operation->getProperty( "$uniqueName" ) );
\  setSelected(%element%);
\  selectNodeInOI("$operationInspector")
menu.item.element.MessageLink.New.item.Destructor.name = ["menu/new.destructor"]
menu.item.element.MessageLink.New.item.Destructor.enabled =
\  findElement( getDestination()->getProperty( "$instantiatedClass" ) )->hasPropertyValue("$language", "cpp")

#=================
#    State level 0
#=================
menu.item.element.State.New Internal Transition = createMember( "InternalTransition" )
menu.item.element.State.New Internal Transition.shortcut   = CTRL+T
menu.item.element.State.New Internal Transition.shortcut2  = INSERT
menu.item.element.State.New Deferred Event = createMember( "DeferredEvent" )
menu.item.element.State.Add Multiline Description = setProperty( "explanation", "" );
\                                                   editInplace( "explanation", true )
menu.item.element.State.Add Multiline Description.enabled = !hasProperty( "explanation" )

#=================
#    Activity level 0
#=================
menu.item.element.Activity.New Internal Transition = createMember( "InternalTransition" )
menu.item.element.Activity.New Internal Transition.shortcut = CTRL+T
menu.item.element.Activity.New Deferred Event = createMember( "DeferredEvent" )

#=================
#    UseCase level 0
#=================
menu.item.element.UseCase.New Extension Point = createMember( "ExtensionPoint" )
menu.item.element.UseCase.Add Multiline Description = setProperty( "explanation", "" );
\                                                     editInplace( "explanation", true )
menu.item.element.UseCase.Add Multiline Description.enabled = !hasProperty( "explanation" )

#=================
#    Actor level 0
#=================
menu.item.element.Actor.Add Multiline Description = setProperty( "explanation", "" );
\                                                   editInplace( "explanation", true )
menu.item.element.Actor.Add Multiline Description.enabled = !hasProperty( "explanation" )

#=================
#    Component level 0
#=================
menu.item.element.Node.Add Multiline Description = setProperty( "explanation", "" );
\                                                  editInplace( "explanation", true )
menu.item.element.Node.Add Multiline Description.enabled = !hasProperty( "explanation" )

#=================
#    Node level 0
#=================
menu.item.element.Component.Add Multiline Description = setProperty( "explanation", "" );
\                                                       editInplace( "explanation", true )
menu.item.element.Component.Add Multiline Description.enabled = !hasProperty( "explanation" )

menu.item.element.*.Properties = properties
menu.item.element.*.Properties.name = "Properties..."
menu.item.element.*.Properties.icon = "MainToolbar\tb-main-properties.gif"
menu.item.element.*.Properties.separator.before = true
menu.item.element.*.Properties.separator.after = true
menu.item.element.*.Properties.shortcut = ALT+ENTER

#===================
#  Association link
#===================
menu.item.element.AssociationLink.Association = setProperty("$aggregation", false)
menu.item.element.AssociationLink.Association.checkbox = true
menu.item.element.AssociationLink.Association.checkbox.state = !hasProperty("$aggregation")
menu.item.element.AssociationLink.Association.name = ["menu/association"]
menu.item.element.AssociationLink.Aggregation = setProperty("$aggregation", true); setProperty("$byValue", false)
menu.item.element.AssociationLink.Aggregation.checkbox = true
menu.item.element.AssociationLink.Aggregation.checkbox.state = hasProperty("$aggregation") && !hasProperty("$byValue")
menu.item.element.AssociationLink.Aggregation.name = ["menu/aggregation"]
menu.item.element.AssociationLink.Composition = setProperty("$aggregation", true); setProperty("$byValue", true)
menu.item.element.AssociationLink.Composition.checkbox = true
menu.item.element.AssociationLink.Composition.checkbox.state = hasProperty("$aggregation") && hasProperty("$byValue")
menu.item.element.AssociationLink.Composition.separator.after = true
menu.item.element.AssociationLink.Composition.name = ["menu/composition"]

menu.item.element.AssociationLink.0_1 = if (isNearLinkSource(), setProperty("clientCardinality", "0..1"), setProperty("supplierCardinality", "0..1"))
menu.item.element.AssociationLink.0_1.name = "0..1"
menu.item.element.AssociationLink.0_1.condition = isNearLinkSource() || isNearLinkDestination()
menu.item.element.AssociationLink.1 = if (isNearLinkSource(), setProperty("clientCardinality", "1"), setProperty("supplierCardinality", "1"))
menu.item.element.AssociationLink.1.condition = isNearLinkSource() || isNearLinkDestination()
menu.item.element.AssociationLink.0_* = if (isNearLinkSource(), setProperty("clientCardinality", "0..*"), setProperty("supplierCardinality", "0..*"))
menu.item.element.AssociationLink.0_*.name = "0..*"
menu.item.element.AssociationLink.0_*.condition = isNearLinkSource() || isNearLinkDestination()
menu.item.element.AssociationLink.1_* = if (isNearLinkSource(), setProperty("clientCardinality", "1..*"), setProperty("supplierCardinality", "1..*"))
menu.item.element.AssociationLink.1_*.name = "1..*"
menu.item.element.AssociationLink.1_*.condition = isNearLinkSource() || isNearLinkDestination()
menu.item.element.AssociationLink.1_*.separator.after = true

menu.item.element.*.Choose Pattern = choosePattern()
menu.item.element.*.Choose Pattern.name = ["menu/choose_pattern_ellipsis"]
menu.item.element.*.Choose Pattern.condition =
\ if(isLink(),
\   isFeatureEnabledByWorkspace("link.menu.Choose Pattern"),
\   if (hasPropertyValue("$shapeType", "Attribute"),
\     isFeatureEnabledByWorkspace("attribute.menu.Choose Pattern"),
\     if (hasPropertyValue("$shapeType", "Operation"),
\       isFeatureEnabledByWorkspace("operation.menu.Choose Pattern"),
\       true)))

menu.item.element.AssociationLink.Client / Supplier Role.separator.before = true
menu.item.element.AssociationLink.Client / Supplier Role =
\  property = if(isNearLinkSource(), "clientRole", "supplierRole");
\  if (hasProperty(property),
\    editInplace(property, false),
\    setProperty(property, "role"); editInplace(property, true)
\  )
menu.item.element.AssociationLink.Client / Supplier Role.condition = isNearLinkSource() || isNearLinkDestination()
menu.item.element.AssociationLink.Client / Supplier Role.name =
\       if (isNearLinkSource(),
\               ["menu/client_role"],
\               ["menu/supplier_role"] )
menu.item.element.AssociationLink.Client / Supplier Qualifier =
\  property = if(isNearLinkSource(), "clientQualifier", "supplierQualifier");
\  if (hasProperty(property),
\    editInplace(property, false),
\    setProperty(property, "qualifier"); editInplace(property, true)
\  )
menu.item.element.AssociationLink.Client / Supplier Qualifier.condition = isNearLinkSource() || isNearLinkDestination()
menu.item.element.AssociationLink.Client / Supplier Qualifier.name =
\       if (isNearLinkSource(),
\               ["menu/client_qualifier"], ["menu/supplier_qualifier"])
menu.item.element.AssociationLink.Label =
\  if (hasProperty("label"),
\    editInplace("label", false),
\    setProperty("label", "label"); editInplace("label", true)
\  )
menu.item.element.AssociationLink.Label.separator.after = true
menu.item.element.AssociationLink.Label.name = ["menu/label"]


#=================
# Common commands which need to be displayed before concrete commands from level 1. ("Add, Update" section)
#=================
menu.item.element.*.Add = invokeImportDialog("Add Shortcuts for: "+%element%->getProperty("$name"))
menu.item.element.*.Add.name = ["menu/add_ellipsis"]
menu.item.element.*.Add.condition = (%element% == %diagram%)
menu.item.element.*.Add.shortcut = CTRL+SHIFT+A
;menu.item.element.*.Add Reference = addReference()
;menu.item.element.*.Add Reference.name = ["menu/add_reference"]

menu.item.element.*.Zoom.separator.before = true
menu.item.element.*.Zoom = group
menu.item.element.*.Zoom.condition = (%element% == %diagram%)
menu.item.element.*.Zoom.item.+ = zoom(1.05)
menu.item.element.*.Zoom.item.+.shortcut = ADD
menu.item.element.*.Zoom.item.+.shortcut2 = EQUALS
menu.item.element.*.Zoom.item.+.name = ["menu/zoom+"]
menu.item.element.*.Zoom.item.- = zoom(1 / 1.05)
menu.item.element.*.Zoom.item.-.shortcut = SUBTRACT
menu.item.element.*.Zoom.item.-.shortcut2 = MINUS
menu.item.element.*.Zoom.item.-.separator.after = true
menu.item.element.*.Zoom.item.-.name = ["menu/zoom-"]
menu.item.element.*.Zoom.item.Fit in Window = fitInWindow()
menu.item.element.*.Zoom.item.Fit in Window.name = ["menu/fit_in_window"]
menu.item.element.*.Zoom.item.Fit in Window.shortcut = MULTIPLY
menu.item.element.*.Zoom.item.1:1 = setZoomFactor(1)
menu.item.element.*.Zoom.item.1:1.name = ["menu/zoom_1_1"]
menu.item.element.*.Zoom.item.1:1.shortcut = DIVIDE
menu.item.element.*.Zoom.name = ["menu/zoom"]
menu.item.element.*.Show Hidden = invokeShowHiddenDialog("Show Hidden for: "+%element%->getProperty("$name"))
menu.item.element.*.Show Hidden.name = ["menu/show_hidden_ellipsis"]
menu.item.element.*.Show Hidden.condition = (%element% == %diagram%)

menu.item.element.*.Diagram Layout = group
menu.item.element.*.Diagram Layout.condition = %element% == %diagram%
menu.item.element.*.Diagram Layout.name = "Layout"
menu.item.element.*.Diagram Layout.item.All.separator.before = true
menu.item.element.*.Diagram Layout.item.All = doLayout({ layoutType := "all", considerPrintGrid := false })
menu.item.element.*.Diagram Layout.item.All.shortcut = CTRL+K
menu.item.element.*.Diagram Layout.item.All For Printing = doLayout({ layoutType := "all", considerPrintGrid := true })
menu.item.element.*.Diagram Layout.item.All For Printing.separator.after = true
menu.item.element.*.Diagram Layout.separator.after = true
menu.item.element.*.Update = updateDiagrams()
menu.item.element.*.Update.condition = (%element% == %diagram%)
menu.item.element.*.Update.shortcut = F5
menu.item.element.*.Update.name = ["menu/update"]
menu.item.element.*.Update Package Dependencies = updatePackageDependencies()
menu.item.element.*.Update Package Dependencies.condition = (%element% == %diagram%) && isFeatureEnabledByWorkspace("diagram.menu.Update Package Dependencies")
menu.item.element.*.Update Package Dependencies.name = ["menu/update_package_dependencies"]
menu.item.element.*.Diagram Options = diagramOptions()
menu.item.element.*.Diagram Options.name = ["menu/diagram_options_ellipsis"]
menu.item.element.*.Diagram Options.condition = (%element% == %diagram%)
menu.item.element.*.Diagram Options.separator.after = true

#=================
#     Package level 1
#=================
menu.item.element.Package.Paste

#=================
#      Class level 1
#=================

menu.item.element.Class.Edit Definition = editDefinition()
menu.item.element.Class.Add Linked = referencedImport("Linked")
menu.item.element.Class.Add Linked.name = ["menu/add_linked_ellipsis"]

menu.item.element.Class.Choose Pattern
menu.item.element.Class.Choose Pattern.separator.after = true

menu.item.element.Class.Cut.separator.before = true
menu.item.element.Class.Cut
menu.item.element.Class.Copy
menu.item.element.Class.Clone
menu.item.element.Class.Paste
menu.item.element.Class.Delete from View
menu.item.element.Class.Delete from View with Shortcut
menu.item.element.Class.Delete
menu.item.element.Class.Delete with Shortcut
menu.item.element.Class.Delete with Shortcut.separator.after = true

menu.item.element.Class.Format Source = formatSource(getProperty("$file"))
menu.item.element.Class.Format Source.name = ["menu/format_source"]
menu.item.element.Class.Format Source.condition = isFeatureEnabledByWorkspace("diagram.menu.Format Source")

;menu.item.element.Class.Reorder Members = invokeScript( "com.togethersoft.modules.memberSorter.MemberSorter" )

menu.item.element.Class.Layout.separator.before = true
menu.item.element.Class.Layout

menu.item.element.Class.Show Circle = setViewProperty("hideAll", !hasViewProperty("showCircle"));
\                                     setViewProperty("showCircle", !hasViewProperty("showCircle"))
menu.item.element.Class.Show Circle.checkbox = true
menu.item.element.Class.Show Circle.checkbox.state = hasViewProperty("showCircle")
menu.item.element.Class.Show Circle.name = ["menu/show_as_circle"]
menu.item.element.Class.Show Circle.condition = hasProperty( "$interface" ) &&
\                                               !%diagram%->hasPropertyValue( "$shapeType", "ComponentDiagram" ) &&
\                                               !%diagram%->hasPropertyValue( "$shapeType", "DeploymentDiagram" )

menu.item.element.Class.Hide/Show = setViewProperty("$visible", !hasViewProperty("$visible"))
menu.item.element.Class.Hide/Show.name = if (hasViewProperty("$visible"), ["menu/hide"], ["menu/show"])
menu.item.element.Class.Hide/Show.condition = !hasViewProperty("$visible")

menu.item.element.Class.Hide Compartment = group
menu.item.element.Class.Hide Compartment.name = ["menu/hide_compartment"]
menu.item.element.Class.Hide Compartment.condition = hasViewProperty("$visible")
menu.item.element.Class.Hide Compartment.separator.after = true

menu.item.element.Class.Hide Compartment.item.Hide Class = setViewProperty("$visible", false)
menu.item.element.Class.Hide Compartment.item.Hide Class.name = if( hasProperty( "$interface" ),
\                                                                   ["menu/hide_compartment.hide_interface_icon"],
\                                                                   ["menu/hide_compartment.hide_class_icon"] )
menu.item.element.Class.Hide Compartment.item.Hide Class.separator.after = true

menu.item.element.Class.Hide Compartment.item.Attributes = setViewProperty("hideAttributes", !hasViewProperty("hideAttributes"))
menu.item.element.Class.Hide Compartment.item.Attributes.checkbox = true
menu.item.element.Class.Hide Compartment.item.Attributes.checkbox.state = hasViewProperty("hideAttributes")
menu.item.element.Class.Hide Compartment.item.Attributes.name = ["menu/hide_compartment.attributes"]

menu.item.element.Class.Hide Compartment.item.Operations = setViewProperty("hideOperations", !hasViewProperty("hideOperations"))
menu.item.element.Class.Hide Compartment.item.Operations.checkbox = true
menu.item.element.Class.Hide Compartment.item.Operations.checkbox.state = hasViewProperty("hideOperations")
menu.item.element.Class.Hide Compartment.item.Operations.name = ["menu/hide_compartment.operations"]

menu.item.element.Class.Hide Compartment.item.Inner Classes = setViewProperty("hideClasses", !hasViewProperty("hideClasses"))
menu.item.element.Class.Hide Compartment.item.Inner Classes.checkbox = true
menu.item.element.Class.Hide Compartment.item.Inner Classes.checkbox.state = hasViewProperty("hideClasses")
menu.item.element.Class.Hide Compartment.item.Inner Classes.name = ["menu/hide_compartment.inner_classes"]

menu.item.element.Class.Hide Compartment.item.Properties = setViewProperty("hideProperties", !hasViewProperty("hideProperties"))
menu.item.element.Class.Hide Compartment.item.Properties.checkbox = true
menu.item.element.Class.Hide Compartment.item.Properties.checkbox.state = hasViewProperty("hideProperties")
menu.item.element.Class.Hide Compartment.item.Properties.name = ["menu/hide_compartment.properties"]
menu.item.element.Class.Hide Compartment.item.Properties.condition = hasOption("option.beans.enable") &&
\                                                                    %DEFAULT_LANGUAGE% == "java"

menu.item.element.Class.Hide Compartment.item.Events = setViewProperty("hideEvents", !hasViewProperty("hideEvents"))
menu.item.element.Class.Hide Compartment.item.Events.checkbox = true
menu.item.element.Class.Hide Compartment.item.Events.checkbox.state = hasViewProperty("hideEvents")
menu.item.element.Class.Hide Compartment.item.Events.name = ["menu/hide_compartment.events"]
menu.item.element.Class.Hide Compartment.item.Events.condition = hasOption("option.beans.enable") &&
\                                                                %DEFAULT_LANGUAGE% == "java"

menu.item.element.Class.Hide Compartment.item.All.separator.before = true
menu.item.element.Class.Hide Compartment.item.All = setViewProperty("hideAll", !hasViewProperty("hideAll"))
menu.item.element.Class.Hide Compartment.item.All.checkbox = true
menu.item.element.Class.Hide Compartment.item.All.checkbox.state = hasViewProperty("hideAll")
menu.item.element.Class.Hide Compartment.item.All.name = ["menu/hide_compartment.all"]

menu.item.element.Class.Rename

#=================
#    Attribute level 1
#=================
menu.item.element.Attribute.Edit Definition = editDefinition()
menu.item.element.Attribute.Choose Pattern
menu.item.element.Attribute.Choose Pattern.separator.after = true

menu.item.element.Attribute.Cut.separator.before = true
menu.item.element.Attribute.Cut
menu.item.element.Attribute.Copy
menu.item.element.Attribute.Clone
menu.item.element.Attribute.Paste
menu.item.element.Attribute.Delete
menu.item.element.Attribute.Delete.separator.after = true

#=================
#    Operation level 1
#=================
menu.item.element.Operation.Edit Definition = editDefinition()
menu.item.element.Operation.GenSequenceDiagram = invokeScript( "com.togethersoft.modules.sequence.generateSequenceDiagram.GenerateSequenceDiagramScript")
menu.item.element.Operation.GenSequenceDiagram.name = ["menu/gen_sequence_diagram"]
menu.item.element.Operation.GenSequenceDiagram.enabled = !getContainingNode()->hasProperty("$interface") &&
\                                                        !hasProperty("$abstract")

menu.item.element.Operation.Choose Pattern
menu.item.element.Operation.Choose Pattern.separator.after = true


menu.item.element.Operation.Cut.separator.before = true
menu.item.element.Operation.Cut
menu.item.element.Operation.Copy
menu.item.element.Operation.Clone
menu.item.element.Operation.Paste
menu.item.element.Operation.Delete
menu.item.element.Operation.Delete.separator.after = true


#=================
#    BeanProperty
#=================
menu.item.element.BeanProperty.Choose Pattern
menu.item.element.BeanProperty.Choose Pattern.separator.after = true

menu.item.element.BeanProperty.Cut.separator.before = true
menu.item.element.BeanProperty.Cut
menu.item.element.BeanProperty.Copy
menu.item.element.BeanProperty.Clone
menu.item.element.BeanProperty.Paste
menu.item.element.BeanProperty.Delete
menu.item.element.BeanProperty.Delete.separator.after = true


#=================
# Object level 1
#=================
menu.item.element.Object.Unlink class = setProperty( "$instantiates", null )
menu.item.element.Object.Unlink class.name = ["menu/unlink_class"]
menu.item.element.Object.Unlink class.enabled = hasProperty( "$instantiates" )

menu.item.element.Object.generate_impl = invokeScript( "com.togethersoft.modules.sequence.generateSourceCode.GenerateSourceCodeScript" )
menu.item.element.Object.generate_impl.name = "Generate implementation"
menu.item.element.Object.generate_impl.condition = %diagram%->hasPropertyValue("$shapeType","SequenceDiagram")
menu.item.element.Object.generate_impl.separator.after = true


#=================
# Message level 1
#=================
menu.item.element.MessageLink.unlink_operation = setProperty( "$messageOperationName", null )
menu.item.element.MessageLink.unlink_operation.name = ["menu/unlink_operation"]
menu.item.element.MessageLink.unlink_operation.enabled = hasProperty( "operation" )

menu.item.element.MessageLink.generate_impl = invokeScript( "com.togethersoft.modules.sequence.generateSourceCode.GenerateSourceCodeScript" )
menu.item.element.MessageLink.generate_impl.name = "Generate implementation"
menu.item.element.MessageLink.generate_impl.separator.after = true


#=====================================================================
;
#=====================================================================
menu.item.element.*.Cut.separator.before = true
menu.item.element.*.Cut = cut()
menu.item.element.*.Cut.condition = %element% != %diagram%
menu.item.element.*.Cut.name = ["menu/cut"]
menu.item.element.*.Copy = copy()
menu.item.element.*.Copy.condition = %element% != %diagram%
menu.item.element.*.Copy.name = ["menu/copy"]
menu.item.element.*.Clone = clone()
menu.item.element.*.Clone.condition = %element% != %diagram%
menu.item.element.*.Clone.shortcut= CTRL+SHIFT+C
menu.item.element.*.Clone.name = ["menu/clone"]

#================= State level 1
menu.item.element.State.Paste

#================= InternalTransition level 1

menu.item.element.InternalTransition.New Internal Transition  =
\  newTransition = getParent()->createMember( "InternalTransition" );
\  cut(newTransition);
\  newTransition = paste(BEFORE);
\  newTransition->editInplace(null, true)
menu.item.element.InternalTransition.New Internal Transition.shortcut = INSERT

menu.item.element.InternalTransition.New Internal Transition Shortcut = getParent()->createMember( "InternalTransition" )
menu.item.element.InternalTransition.New Internal Transition Shortcut.shortcut = CTRL+T
menu.item.element.InternalTransition.New Internal Transition Shortcut.hidden = true

menu.item.element.InternalTransition.Cut
menu.item.element.InternalTransition.Copy
menu.item.element.InternalTransition.Clone
menu.item.element.InternalTransition.Paste


#================= DeferredEvent level 1

menu.item.element.DeferredEvent.New Deferred Event  =
\  newEvent = getParent()->createMember( "DeferredEvent" );
\  cut(newEvent);
\  newEvent = paste(BEFORE);
\  newEvent->editInplace(null, true)
menu.item.element.DeferredEvent.New Deferred Event.shortcut = INSERT

menu.item.element.DeferredEvent.Cut
menu.item.element.DeferredEvent.Copy
menu.item.element.DeferredEvent.Clone
menu.item.element.DeferredEvent.Paste

#=================

menu.item.element.*.Paste = paste()
menu.item.element.*.Paste.name = ["menu/paste"]
menu.item.element.*.Paste Reference = pasteReference()
menu.item.element.*.Paste Reference.name = ["menu/paste_reference"]
menu.item.element.*.Paste Reference.shortcut = CTRL+SHIFT+V

menu.item.element.*.Delete from View = deleteReference()
menu.item.element.*.Delete from View.name = ["menu/delete_from_view"]
menu.item.element.*.Delete from View.condition =
\ allImported = true; forEachInDo(element, %elements%(), allImported = allImported && element->hasViewProperty("$imported")); !allImported
menu.item.element.*.Delete from View with Shortcut = deleteReference()
menu.item.element.*.Delete from View with Shortcut.name = ["menu/delete_from_view"]
menu.item.element.*.Delete from View with Shortcut.shortcut = DELETE
menu.item.element.*.Delete from View with Shortcut.condition = hasViewProperty("$imported")
menu.item.element.*.Delete = delete()
menu.item.element.*.Delete.name = ["menu/delete"]
menu.item.element.*.Delete.condition =
\ allNotImported = true; allReferences = true;
\ forEachInDo(
\   element,
\   %elements%(),
\   allReferences = allReferences && element->getParent()->isDiagram();
\   allNotImported = allNotImported && !element->hasViewProperty("$imported")
\ );
\ !allNotImported
menu.item.element.*.Delete with Shortcut = delete()
menu.item.element.*.Delete with Shortcut.name = ["menu/delete"]
menu.item.element.*.Delete with Shortcut.shortcut = DELETE
menu.item.element.*.Delete with Shortcut.condition = %element% != %diagram% && !hasViewProperty("$imported")
menu.item.element.*.Delete with Shortcut.separator.after = true

menu.item.element.*.Rename = editInplace()
menu.item.element.*.Rename.shortcut = F2
menu.item.element.*.Rename.name = if(hasPropertyValue("$shapeType", "Note"), "Edit", ["menu/rename"])

menu.item.element.AssociatesLink.Rename =
\  if (!hasProperty("label"),
\    setProperty("label", "unnamed"); editInplace("label", true),
\    editInplace()
\  )
menu.item.element.AssociatesLink.Rename.shortcut = F2
menu.item.element.AssociatesLink.Rename.name = ["menu/rename"]

menu.item.element.AggregatesLink.Rename =
\  if (!hasProperty("label"),
\    setProperty("label", "unnamed"); editInplace("label", true),
\    editInplace()
\  )
menu.item.element.AggregatesLink.Rename.shortcut = F2
menu.item.element.AggregatesLink.Rename.name = ["menu/rename"]

menu.item.element.CommunicatesLink.Rename =
\  if (!hasProperty("label"),
\    setProperty("label", "unnamed"); editInplace("label", true),
\    editInplace()
\  )
menu.item.element.CommunicatesLink.Rename.shortcut = F2
menu.item.element.CommunicatesLink.Rename.name = ["menu/rename"]

menu.item.element.ExtendsLink.Rename =
\  if (!hasProperty("label"),
\    setProperty("label", "unnamed"); editInplace("label", true),
\    editInplace()
\  )
menu.item.element.ExtendsLink.Rename.shortcut = F2
menu.item.element.ExtendsLink.Rename.name = ["menu/rename"]

menu.item.element.IncludesLink.Rename =
\  if (!hasProperty("label"),
\    setProperty("label", "unnamed"); editInplace("label", true),
\    editInplace()
\  )
menu.item.element.IncludesLink.Rename.shortcut = F2
menu.item.element.IncludesLink.Rename.name = ["menu/rename"]

menu.item.element.SubscribesLink.Rename =
\  if (!hasProperty("label"),
\    setProperty("label", "unnamed"); editInplace("label", true),
\    editInplace()
\  )
menu.item.element.SubscribesLink.Rename.shortcut = F2
menu.item.element.SubscribesLink.Rename.name = ["menu/rename"]

#=================
#      Diagram level 2 (Sequence diagram concrete commands)
#=================
menu.item.element.SequenceDiagram.Show as Sequence.separator.before = true
menu.item.element.SequenceDiagram.Show as Sequence = setProperty( "$viewType", null )
menu.item.element.SequenceDiagram.Show as Sequence.condition = %element% == %diagram%
menu.item.element.SequenceDiagram.Show as Sequence.enabled = hasProperty( "$viewType" )
menu.item.element.SequenceDiagram.Show as Sequence.name = ["menu/show_as_sequence"]
menu.item.element.SequenceDiagram.Show as Collaboration = setProperty( "$viewType", "collaborationView" )
menu.item.element.SequenceDiagram.Show as Collaboration.condition = %element% == %diagram%
menu.item.element.SequenceDiagram.Show as Collaboration.enabled = !hasPropertyValue( "$viewType", "collaborationView" )
menu.item.element.SequenceDiagram.Show as Collaboration.name = ["menu/show_as_collaboration"]

#menu.item.element.SequenceDiagram.generate_impl = invokeScript( "com.togethersoft.modules.sequencediagram.generate.GenerateImplementation")
menu.item.element.SequenceDiagram.generate_impl = invokeScript( "com.togethersoft.modules.sequence.generateSourceCode.GenerateSourceCodeScript" )
menu.item.element.SequenceDiagram.generate_impl.name = "Generate implementation"
;menu.item.element.SequenceDiagram.generate_impl.separator.after = true

#---------
# Message
#---------
#
# Type submenu (creation, destruction)
#
menu.item.element.MessageLink.Type = group
menu.item.element.MessageLink.Type.item.Creation = setProperty( "$creationMessage", !hasProperty( "$creationMessage" ) )
menu.item.element.MessageLink.Type.item.Creation.checkbox = true
menu.item.element.MessageLink.Type.item.Creation.checkbox.state = hasProperty( "$creationMessage" )
menu.item.element.MessageLink.Type.item.Destruction = setProperty( "$destructionMessage", !hasProperty( "$destructionMessage" ) )
menu.item.element.MessageLink.Type.item.Destruction.checkbox = true
menu.item.element.MessageLink.Type.item.Destruction.checkbox.state = hasProperty( "$destructionMessage" )
menu.item.element.MessageLink.Type.name = ["menu/type"]
#
# Type of Syncronization submenu (call, asynchronous)
#
menu.item.element.MessageLink.Synchronization = group
menu.item.element.MessageLink.Synchronization.name = ["menu/synchronization"]
menu.item.element.MessageLink.Synchronization.item.call = setProperty( "$controlFlowType", "call" )
menu.item.element.MessageLink.Synchronization.item.call.checkbox = true
menu.item.element.MessageLink.Synchronization.item.call.checkbox.state = hasPropertyValue( "$controlFlowType", "call" )
menu.item.element.MessageLink.Synchronization.item.call.icon = "DropDowns\seq-call.gif"
menu.item.element.MessageLink.Synchronization.item.call.name = ["menu/synchronization_call"]
menu.item.element.MessageLink.Synchronization.item.synchronous = setProperty( "$controlFlowType", "synchronous" )
menu.item.element.MessageLink.Synchronization.item.synchronous.checkbox = true
menu.item.element.MessageLink.Synchronization.item.synchronous.checkbox.state = hasPropertyValue( "$controlFlowType", "synchronous" )
menu.item.element.MessageLink.Synchronization.item.synchronous.icon = "DropDowns\seq-synchronus.gif"
menu.item.element.MessageLink.Synchronization.item.synchronous.name = ["menu/synchronization_synchronous"]
menu.item.element.MessageLink.Synchronization.item.asynchronous = setProperty( "$controlFlowType", "asynchronous" )
menu.item.element.MessageLink.Synchronization.item.asynchronous.checkbox = true
menu.item.element.MessageLink.Synchronization.item.asynchronous.checkbox.state = hasPropertyValue( "$controlFlowType", "asynchronous" )
menu.item.element.MessageLink.Synchronization.item.asynchronous.icon = "DropDowns\seq-asynchronous.gif"
menu.item.element.MessageLink.Synchronization.item.asynchronous.name = ["menu/synchronization_asynchronous"]
menu.item.element.MessageLink.Synchronization.item.wait = setProperty( "$controlFlowType", "wait" )
menu.item.element.MessageLink.Synchronization.item.wait.checkbox = true
menu.item.element.MessageLink.Synchronization.item.wait.checkbox.state = hasPropertyValue( "$controlFlowType", "wait" )
menu.item.element.MessageLink.Synchronization.item.wait.icon = "DropDowns\seq-wait.gif"
menu.item.element.MessageLink.Synchronization.item.wait.name = ["menu/synchronization_wait"]
menu.item.element.MessageLink.Synchronization.item.nowait = setProperty( "$controlFlowType", "nowait" )
menu.item.element.MessageLink.Synchronization.item.nowait.checkbox = true
menu.item.element.MessageLink.Synchronization.item.nowait.checkbox.state = hasPropertyValue( "$controlFlowType", "nowait" )
menu.item.element.MessageLink.Synchronization.item.nowait.icon = "DropDowns\seq-nowait.gif"
menu.item.element.MessageLink.Synchronization.item.nowait.name = ["menu/synchronization_nowait"]
#
# message branching control
#
menu.item.element.MessageLink.Branching = group
menu.item.element.MessageLink.Branching.item.None = setProperty( "alternativeMessage", null )
menu.item.element.MessageLink.Branching.item.None.enabled = hasProperty( "alternativeMessage" )
menu.item.element.MessageLink.Branching.item.None.name = ["menu/none"]
menu.item.element.MessageLink.Branching.item.With previous = setProperty( "alternativeMessage", getProperty( "$previousMessage" ) )
menu.item.element.MessageLink.Branching.item.With previous.enabled = !hasProperty( "alternativeMessage" ) &&
\                                                                    hasProperty( "$previousMessage" )
menu.item.element.MessageLink.Branching.item.With previous.name = ["menu/with_previous"]
menu.item.element.MessageLink.Branching.name = ["menu/branching"]
#
# message delivery time
#
menu.item.element.MessageLink.Non-atomic = setProperty( "$nonAtomicDelivery", !hasProperty( "$nonAtomicDelivery" ) )
menu.item.element.MessageLink.Non-atomic.checkbox = true
menu.item.element.MessageLink.Non-atomic.checkbox.state = hasProperty( "$nonAtomicDelivery" )
menu.item.element.MessageLink.Non-atomic.name = ["menu/non_atomic"]


#
# Activation (life rect) - disable all.
#
menu.item.element.Activation.Cut = null
menu.item.element.Activation.Cut.condition = false
menu.item.element.Activation.Copy = null
menu.item.element.Activation.Copy.condition = false
menu.item.element.Activation.Clone = null
menu.item.element.Activation.Clone.condition = false
menu.item.element.Activation.Paste = null
menu.item.element.Activation.Paste.condition = false
menu.item.element.Activation.Actual Size = null
menu.item.element.Activation.Actual Size.condition = false
menu.item.element.Activation.Hide/Show = null
menu.item.element.Activation.Hide/Show.condition = false

#menu.item.element.Activation.generate_impl = invokeScript( "com.togethersoft.modules.sequencediagram.generate.GenerateImplementation")
menu.item.element.Activation.generate_impl = invokeScript( "com.togethersoft.modules.sequence.generateSourceCode.GenerateSourceCodeScript" )
menu.item.element.Activation.generate_impl.name = "Generate implementation"

#
# StatementBlock - disable all.
#
menu.item.element.StatementBlock.Cut = null
menu.item.element.StatementBlock.Cut.condition = false
menu.item.element.StatementBlock.Copy = null
menu.item.element.StatementBlock.Copy.condition = false
menu.item.element.StatementBlock.Clone = null
menu.item.element.StatementBlock.Clone.condition = false
menu.item.element.StatementBlock.Paste = null
menu.item.element.StatementBlock.Paste.condition = false
menu.item.element.StatementBlock.Actual Size = null
menu.item.element.StatementBlock.Actual Size.condition = false
menu.item.element.StatementBlock.Hide/Show = null
menu.item.element.StatementBlock.Hide/Show.condition = false
menu.item.element.StatementBlock.generate_impl = invokeScript( "com.togethersoft.modules.sequence.generateSourceCode.GenerateSourceCodeScript" )
menu.item.element.StatementBlock.generate_impl.name = "Generate implementation"


menu.item.element.*.Layout.separator.before = true
menu.item.element.*.Layout = group
menu.item.element.*.Layout.condition = %element% != %diagram%
menu.item.element.*.Layout.item.Selected.separator.before = true
menu.item.element.*.Layout.item.Selected = doLayout({ layoutType := "selected", considerPrintGrid := false })
menu.item.element.*.Layout.item.Selected For Printing = doLayout({ layoutType := "selected", considerPrintGrid := true })
menu.item.element.*.Layout.item.Selected For Printing.separator.after = true
menu.item.element.*.Layout.item.Route Links.separator.before = true
menu.item.element.*.Layout.item.Route Links = routeLinks()
menu.item.element.*.Layout.item.Route Links.name = ["menu/route_links"]
menu.item.element.*.Layout.item.Actual Size = setDefaultSize()
menu.item.element.*.Layout.item.Actual Size.name = ["menu/actual_size"]
menu.item.element.*.Layout.item.Actual Size.separator.after = true
menu.item.element.*.Layout.item.Align Top.separator.before = true
menu.item.element.*.Layout.item.Align Top = doLayout({ layoutType := "alignment", alignmentType := "top" })
menu.item.element.*.Layout.item.Align Bottom = doLayout({ layoutType := "alignment", alignmentType := "bottom" })
menu.item.element.*.Layout.item.Align Left = doLayout({ layoutType := "alignment", alignmentType := "left" })
menu.item.element.*.Layout.item.Align Right = doLayout({ layoutType := "alignment", alignmentType := "right" })
menu.item.element.*.Layout.item.Align Right.separator.after = true

menu.item.element.*.Hide/Show = setViewProperty("$visible", !hasViewProperty("$visible"))
menu.item.element.*.Hide/Show.name = if (hasViewProperty("$visible"), ["menu/hide"], ["menu/show"])
menu.item.element.*.Hide/Show.separator.after = true


;menu.item.element.*.Generate Documentation.separator.before = true
;menu.item.element.*.Generate Documentation = invokeScript("script.system.GenHTML.GenerateHTML")
;menu.item.element.*.Generate Documentation.condition = (%element% == %diagram%)
;menu.item.element.*.Generate Documentation.separator.after = true
;menu.item.element.*.Generate Documentation.name = ["menu/generate_documentation"]

menu.item.element.*.Scroll to Source.separator.before = true
menu.item.element.*.Scroll to Source = scrollTo(getSource())
menu.item.element.*.Scroll to Source.condition = isLink()
menu.item.element.*.Scroll to Source.name = ["menu/scroll_to_source"]
menu.item.element.*.Scroll to Destination = scrollTo(getDestination())
menu.item.element.*.Scroll to Destination.condition = isLink()
menu.item.element.*.Scroll to Destination.name = ["menu/scroll_to_destination"]
menu.item.element.*.Scroll to Destination.separator.after = true

menu.item.element.DependencyLink.Dependency Explorer = invokeScript( "com.togethersoft.modules.showdependencies.ShowDependencies" )
menu.item.element.DependencyLink.Dependency Explorer.name = "Show Dependencies"
menu.item.element.DependencyLink.Dependency Explorer.separator.after = true

menu.item.element.Package.Version Control = group
menu.item.element.Package.Version Control.hideIfEmpty = true
menu.item.element.Package.Version Control.condition = isVersionControlEnabled ()
menu.item.element.Package.Version Control.separator.before = true
menu.item.element.Package.Version Control.separator.after = true
menu.item.element.Package.Version Control.item.Add = srcControlAdd()
menu.item.element.Package.Version Control.item.Add.name = ["menu/vc.add"]
menu.item.element.Package.Version Control.item.Get = srcControlGet()
menu.item.element.Package.Version Control.item.Get.name = ["menu/vc.get"]
menu.item.element.Package.Version Control.item.Update = vcsCmdUpdate()
menu.item.element.Package.Version Control.item.Update.name = ["menu/vc.update"]
menu.item.element.Package.Version Control.item.Check In = srcControlCheckIn()
menu.item.element.Package.Version Control.item.Check In.name = ["menu/vc.checkin"]
menu.item.element.Package.Version Control.item.Check Out = srcControlCheckOut()
menu.item.element.Package.Version Control.item.Check Out.name = ["menu/vc.checkout"]
menu.item.element.Package.Version Control.item.Properties = srcControlProperties()
menu.item.element.Package.Version Control.item.Properties.name = ["menu/vc.version_control_properties"]
menu.item.element.Package.Version Control.item.Properties.shortcut = CTRL+Q
menu.item.element.Package.Version Control.name = ["menu/version_control"]

menu.item.element.ClassDiagram.Version Control = group
menu.item.element.ClassDiagram.Version Control.hideIfEmpty = true
menu.item.element.ClassDiagram.Version Control.condition = hasProperty("$physicalPackage") && isVersionControlEnabled () 
menu.item.element.ClassDiagram.Version Control.separator.before = true
menu.item.element.ClassDiagram.Version Control.separator.after = true
menu.item.element.ClassDiagram.Version Control.item.Add = srcControlAdd()
menu.item.element.ClassDiagram.Version Control.item.Add.name = ["menu/vc.add"]
menu.item.element.ClassDiagram.Version Control.item.Get = srcControlGet()
menu.item.element.ClassDiagram.Version Control.item.Get.name = ["menu/vc.get"]
menu.item.element.ClassDiagram.Version Control.item.Update = vcsCmdUpdate()
menu.item.element.ClassDiagram.Version Control.item.Update.name = ["menu/vc.update"]
menu.item.element.ClassDiagram.Version Control.item.Check In = srcControlCheckIn()
menu.item.element.ClassDiagram.Version Control.item.Check In.name = ["menu/vc.checkin"]
menu.item.element.ClassDiagram.Version Control.item.Check Out = srcControlCheckOut()
menu.item.element.ClassDiagram.Version Control.item.Check Out.name = ["menu/vc.checkout"]
menu.item.element.ClassDiagram.Version Control.item.Properties = srcControlProperties()
menu.item.element.ClassDiagram.Version Control.item.Properties.name = ["menu/vc.version_control_properties"]
menu.item.element.ClassDiagram.Version Control.item.Properties.shortcut = CTRL+Q
menu.item.element.ClassDiagram.Version Control.name = ["menu/version_control"]


menu.item.element.*.Version Control Element = group
menu.item.element.*.Version Control Element.hideIfEmpty = true
menu.item.element.*.Version Control Element.condition = !isPackage() && (!isDiagram() || !hasProperty ("$physicalPackage")) && isVersionControlEnabled () 
menu.item.element.*.Version Control Element.separator.before = true
menu.item.element.*.Version Control Element.separator.after = true
menu.item.element.*.Version Control Element.item.Add = srcControlAdd()
menu.item.element.*.Version Control Element.item.Add.name = ["menu/vc.add"]
menu.item.element.*.Version Control Element.item.Get = srcControlGet()
menu.item.element.*.Version Control Element.item.Get.name = if (isShowVcsDialog(), ["menu/vc.get"], ["menu/vc.get_immediate"])
menu.item.element.*.Version Control Element.item.Update = vcsCmdUpdate()
menu.item.element.*.Version Control Element.item.Update.name = if (isShowVcsDialog(), ["menu/vc.update"], ["menu/vc.update_immediate"])
menu.item.element.*.Version Control Element.item.Check In = srcControlCheckIn()
menu.item.element.*.Version Control Element.item.Check In.name = if (isShowVcsDialog(), ["menu/vc.checkin"], ["menu/vc.checkin_immediate"])
menu.item.element.*.Version Control Element.item.Check Out = srcControlCheckOut()
menu.item.element.*.Version Control Element.item.Check Out.name = if (isShowVcsDialog(), ["menu/vc.checkout"], ["menu/vc.checkout_immediate"])
menu.item.element.*.Version Control Element.item.UnCheck Out = vcsCmdUnCheckOut()
menu.item.element.*.Version Control Element.item.UnCheck Out.name = ["menu/vc.uncheckout"]
menu.item.element.*.Version Control Element.item.Properties = srcControlProperties()
menu.item.element.*.Version Control Element.item.Properties.name = ["menu/vc.version_control_properties"]
menu.item.element.*.Version Control Element.item.Properties.shortcut = CTRL+Q
menu.item.element.*.Version Control Element.name = ["menu/version_control"]

menu.item.element.*.Visibility = group
menu.item.element.*.Visibility.condition = if (hasPropertyValue("$shapeType", "Class"), isFeatureEnabledByWorkspace("class.menu.visibility"), true)
menu.item.element.*.Visibility.separator.before = true
menu.item.element.*.Visibility.item.Public = setProperty("$public", true)
menu.item.element.*.Visibility.item.Public.checkbox = true
menu.item.element.*.Visibility.item.Public.checkbox.state = hasProperty("$public")
menu.item.element.*.Visibility.item.Public.name = ["menu/public"]
menu.item.element.*.Visibility.item.Protected = setProperty("$protected", true)
menu.item.element.*.Visibility.item.Protected.checkbox = true
menu.item.element.*.Visibility.item.Protected.checkbox.state = hasProperty("$protected")
menu.item.element.*.Visibility.item.Protected.name = ["menu/protected"]
menu.item.element.*.Visibility.item.Package Local = setProperty("$packageLocal", true)
menu.item.element.*.Visibility.item.Package Local.checkbox = true
menu.item.element.*.Visibility.item.Package Local.checkbox.state = hasProperty("$packageLocal")
menu.item.element.*.Visibility.item.Package Local.name = ["menu/package_local"]
menu.item.element.*.Visibility.item.Private = setProperty("$private", true)
menu.item.element.*.Visibility.item.Private.checkbox = true
menu.item.element.*.Visibility.item.Private.checkbox.state = hasProperty("$private")
menu.item.element.*.Visibility.item.Private.name = ["menu/private"]
menu.item.element.*.Visibility.name = ["menu/visibility"]

menu.item.element.*.Abstract = setProperty("$abstract", !hasProperty("$abstract"))
menu.item.element.*.Abstract.checkbox = true
menu.item.element.*.Abstract.checkbox.state = hasProperty("$abstract")
menu.item.element.*.Abstract.name = ["menu/abstract"]
menu.item.element.*.Abstract.condition = if (hasPropertyValue("$shapeType", "Class"), isFeatureEnabledByWorkspace("class.menu.abstract"), true)

menu.item.element.*.Static = setProperty("$static", !hasProperty("$static"))
menu.item.element.*.Static.checkbox = true
menu.item.element.*.Static.checkbox.state = hasProperty("$static")
menu.item.element.*.Static.name = ["menu/static"]

menu.item.element.Operation.Virtual = setProperty("$virtual", !hasProperty("$virtual"))
menu.item.element.Operation.Virtual.condition = hasPropertyValue("$language", "cpp") && !getContainingNode()->hasProperty("$interface") && !hasProperty("$constructor")
menu.item.element.Operation.Virtual.checkbox = true
menu.item.element.Operation.Virtual.checkbox.state = hasProperty("$virtual")
menu.item.element.Operation.Virtual.name = ["menu/virtual"]

menu.item.element.Operation.Inline = setProperty("$inline", !hasProperty("$inline"))
menu.item.element.Operation.Inline.condition = hasPropertyValue("$language", "cpp") && !getContainingNode()->hasProperty("$interface")
menu.item.element.Operation.Inline.checkbox = true
menu.item.element.Operation.Inline.checkbox.state = hasProperty("$inline")
menu.item.element.Operation.Inline.name = ["menu/inline"]

;menu.item.element.*.Final = setProperty("$final", !hasProperty("$final"))
;menu.item.element.*.Final.checkbox = true
;menu.item.element.*.Final.checkbox.state = hasProperty("$final")
;menu.item.element.*.Final.name = ["menu/final"]

menu.item.model.root.Project Properties = showProjectProperties()
menu.item.model.root.Project Properties.name = ["menu/projectProperties"]
menu.item.model.root.Version Control = group
menu.item.model.root.Version Control.hideIfEmpty = false
menu.item.model.root.Version Control.condition = isVersionControlEnabled ()
menu.item.model.root.Version Control.separator.before = false
menu.item.model.root.Version Control.separator.after = true
menu.item.model.root.Version Control.item.Add = srcControlAdd()
menu.item.model.root.Version Control.item.Add.name = ["menu/vc.add"]
menu.item.model.root.Version Control.item.Get = srcControlGet()
menu.item.model.root.Version Control.item.Get.name = ["menu/vc.get"]
menu.item.model.root.Version Control.item.Update = vcsCmdUpdate()
menu.item.model.root.Version Control.item.Update.name = ["menu/vc.update"]
menu.item.model.root.Version Control.item.Check In = srcControlCheckIn()
menu.item.model.root.Version Control.item.Check In.name = ["menu/vc.checkin"]
menu.item.model.root.Version Control.item.Check Out = srcControlCheckOut()
menu.item.model.root.Version Control.item.Check Out.name = ["menu/vc.checkout"]
menu.item.model.root.Version Control.item.Properties = srcControlProperties()
menu.item.model.root.Version Control.item.Properties.name = ["menu/vc.version_control_properties"]
menu.item.model.root.Version Control.item.Properties.shortcut = CTRL+Q
menu.item.model.root.Version Control.name = ["menu/version_control"]

menu.item.model.root.CloseProject = closeProject()
menu.item.model.root.CloseProject.name = ["menu/closeProject"]

#=================
# Common commands which need to be displayed in the last lines of menus after the last commands from concreate command section
#=================

;none :)

#========================================================================================================
menu.item.file.folder.New Project = newProject(%file_spec%)
menu.item.file.folder.New Project.name = ["menu/newProject"]

menu.item.file.project.Open = openProject(%file_spec%)
menu.item.file.project.Open.icon = "Main Toolbar/tb-main-open.gif"

menu.item.file.html_file.View = browseURL(%file_spec%)
menu.item.file.html_file.View.name = ["i18n_host_ui_menu/menumanagerimpl.view"]

menu.item.file.*.Edit.separator.before = true
menu.item.file.*.Edit = edit(%file_spec%)
menu.item.file.*.Edit in New Tab = editInNewWindow(%file_spec%)
menu.item.file.*.Edit in New Tab.separator.after = true

menu.item.file.*.Format Source = formatSource(%file_spec%)
menu.item.file.*.Format Source.name = ["menu/format_source"]
menu.item.file.*.Format Source.condition = isFeatureEnabledByWorkspace("file.menu.Format Source")
menu.item.file.*.Format Source.shortcut = CTRL+T

menu.item.file.folder.Refresh = updateNode()
menu.item.file.folder.Refresh.name = ["menu/refresh"]

menu.item.file.*.Delete = deleteFile(%file_spec%)
menu.item.file.*.Delete.condition =
\ (%file_spec% != %TOGETHER_HOME% + "/samples") &&
\ (%file_spec% != %TOGETHER_HOME% + "/templates") &&
\ (%file_spec% != %TOGETHER_HOME% + "/myprojects")

;menu.item.file.xml_file.Import from XML = invokeScript ("script.xml.XmlImportExport", {action:="import", language:="design"})
;menu.item.file.xml_file.Import from XML.name = ["menu/import_from_xml"]
;menu.item.file.xml_file.Export from XML = invokeScript ("script.xml.XmlImportExport", {action:="export", language:="design"})
;menu.item.file.xml_file.Export from XML.name = ["menu/export_to_xml"]

;menu.item.element.ClassDiagram.Import from XML = invokeScript ("script.xml.XmlImportExport", {action:="import", language:="default"})
;menu.item.element.ClassDiagram.Import from XML.name = ["menu/import_from_xml"]
;menu.item.element.ClassDiagram.Export to XML  = invokeScript ("script.xml.XmlImportExport", {action:="export", language:="default"})
;menu.item.element.ClassDiagram.Export to XML.name = ["menu/export_to_xml"]
;menu.item.element.Package.Import from XML = invokeScript ("script.xml.XmlImportExport", {action:="import", language:="default"})
;menu.item.element.Package.Import from XML.name = ["menu/import_from_xml"]
;menu.item.element.Package.Export to XML  = invokeScript ("script.xml.XmlImportExport", {action:="export", language:="default"})
;menu.item.element.Package.Export to XML.name = ["menu/export_to_xml"]

menu.item.file.*.Version Control = group
menu.item.file.*.Version Control.hideIfEmpty = false
menu.item.file.*.Version Control.condition = isDirectory (singleFile (%file_spec%)) && isVersionControlEnabled (%file_spec%)
menu.item.file.*.Version Control.separator.before = true
menu.item.file.*.Version Control.separator.after = true
menu.item.file.*.Version Control.item.Add = srcControlAddFile(%file_spec%)
menu.item.file.*.Version Control.item.Add.name = ["menu/vc.add"]
menu.item.file.*.Version Control.item.Get = srcControlGetFile(%file_spec%)
menu.item.file.*.Version Control.item.Get.name = ["menu/vc.get"]
menu.item.file.*.Version Control.item.Check In = srcControlCheckInFile(%file_spec%)
menu.item.file.*.Version Control.item.Check In.name = ["menu/vc.checkin"]
menu.item.file.*.Version Control.item.Check Out = srcControlCheckOutFile(%file_spec%)
menu.item.file.*.Version Control.item.Check Out.name = ["menu/vc.checkout"]
menu.item.file.*.Version Control.item.Update = vcsCmdUpdate(%file_spec%)
menu.item.file.*.Version Control.item.Update.name = ["menu/vc.update"]
menu.item.file.*.Version Control.item.Properties = srcControlPropertiesFile(%file_spec%)
menu.item.file.*.Version Control.item.Properties.name = ["menu/vc.version_control_properties"]
menu.item.file.*.Version Control.item.Properties.shortcut = CTRL+Q
menu.item.file.*.Version Control.name = ["menu/version_control"]

menu.item.file.*.Version Control file = group
menu.item.file.*.Version Control file.hideIfEmpty = false
menu.item.file.*.Version Control file.condition = !isDirectory (singleFile (%file_spec%)) && isVersionControlEnabled (%file_spec%)
menu.item.file.*.Version Control file.separator.before = true
menu.item.file.*.Version Control file.separator.after = true
menu.item.file.*.Version Control file.item.Add = srcControlAddFile(%file_spec%)
menu.item.file.*.Version Control file.item.Add.name = ["menu/vc.add"]
menu.item.file.*.Version Control file.item.Get = srcControlGetFile(%file_spec%)
menu.item.file.*.Version Control file.item.Get.name = if (isShowVcsDialog (), ["menu/vc.get"], ["menu/vc.get_immediate"])
menu.item.file.*.Version Control file.item.Update = vcsCmdUpdate(%file_spec%)
menu.item.file.*.Version Control file.item.Update.name = if (isShowVcsDialog (), ["menu/vc.update"], ["menu/vc.update_immediate"])
menu.item.file.*.Version Control file.item.Check In = srcControlCheckInFile(%file_spec%)
menu.item.file.*.Version Control file.item.Check In.name = if (isShowVcsDialog (), ["menu/vc.checkin"], ["menu/vc.checkin_immediate"])
menu.item.file.*.Version Control file.item.Check Out = srcControlCheckOutFile(%file_spec%)
menu.item.file.*.Version Control file.item.Check Out.name = if (isShowVcsDialog (), ["menu/vc.checkout"], ["menu/vc.checkout_immediate"])
menu.item.file.*.Version Control file.item.UnCheck Out = vcsCmdUnCheckOut(%file_spec%)
menu.item.file.*.Version Control file.item.UnCheck Out.name = ["menu/vc.uncheckout"]
menu.item.file.*.Version Control file.item.Properties = srcControlPropertiesFile(%file_spec%)
menu.item.file.*.Version Control file.item.Properties.name = ["menu/vc.version_control_properties"]
menu.item.file.*.Version Control file.item.Properties.shortcut = CTRL+Q
menu.item.file.*.Version Control file.name = ["menu/version_control"]

menu.item.script.*.Run = %script%->invoke()
menu.item.script.*.Run.name = "Run"
menu.item.script.*.Run.condition = !%script%->isType("folder") &&\
                                   !%script%->hasPropertyValue("Time", "OnDemand")

menu.item.script.*.Enable = %script%->invoke()
menu.item.script.*.Enable.name = "Activate"
menu.item.script.*.Enable.condition = %script%->hasPropertyValue("Time", "OnDemand") &&\
                                      !%script%->hasProperty("Enabled")

menu.item.script.*.Options = %script%->options()
menu.item.script.*.Options.name = "Options..."
menu.item.script.*.Options.condition = %script%->hasProperty("Options") &&\
(\
(%script%->hasPropertyValue("Time", "OnDemand") &&  %script%->hasProperty("Enabled")) ||\
(%script%->hasPropertyValue("Time", "User"))\
)

menu.item.script.*.Disable = %script%->invoke()
menu.item.script.*.Disable.name = "Deactivate"
menu.item.script.*.Disable.condition = %script%->hasPropertyValue("Time", "OnDemand") &&\
                                       %script%->hasProperty("Enabled")

menu.item.script.*.Help = %script%->help()
menu.item.script.*.Help.name = "Help"
menu.item.script.*.Help.condition = %script%->hasProperty("HelpFile")

#menu.item.script.package.Run = invokeScript(%file_spec%)
#menu.item.script.java_source.Run = invokeScript(%file_spec%)
#menu.item.script.java_class.Run = invokeScript(%file_spec%)
#menu.item.script.python_script_source.Run = invokeScript(%file_spec%)
#menu.item.script.tcl_script_source.Run = invokeScript(%file_spec%)


#menu.item.script.package.Help                         = displayHelp(%file_spec%)
#menu.item.script.package.Help.condition              = hasHelp(%file_spec%)
#menu.item.script.java_source.Help                     = displayHelp(%file_spec%)
#menu.item.script.java_source.Help.condition          = hasHelp(%file_spec%)
#menu.item.script.java_class.Help                      = displayHelp(%file_spec%)
#menu.item.script.java_class.Help.condition           = hasHelp(%file_spec%)
#menu.item.script.python_script_source.Help            = displayHelp(%file_spec%)
#menu.item.script.python_script_source.Help.condition = hasHelp(%file_spec%)
#menu.item.script.tcl_script_source.Help               = displayHelp(%file_spec%)
#menu.item.script.tcl_script_source.Help.condition    = hasHelp(%file_spec%)

#menu.item.script.package.Enable                        = enableScript(%file_spec%)
#menu.item.script.package.Enable.condition              = canBeEnabled(%file_spec%)
#menu.item.script.java_source.Enable                    = enableScript(%file_spec%)
#menu.item.script.java_source.Enable.condition          = canBeEnabled(%file_spec%)
#menu.item.script.java_class.Enable                     = enableScript(%file_spec%)
#menu.item.script.java_class.Enable.condition           = canBeEnabled(%file_spec%)
#menu.item.script.python_script_source.Enable           = enableScript(%file_spec%)
#menu.item.script.python_script_source.Enable.condition = canBeEnabled(%file_spec%)
#menu.item.script.tcl_script_source.Enable              = enableScript(%file_spec%)
#menu.item.script.tcl_script_source.Enable.condition    = canBeEnabled(%file_spec%)


#menu.item.script.package.Disable                       = disableScript(%file_spec%)
#menu.item.script.package.Disable.condition             = canBeDisabled(%file_spec%)
#menu.item.script.java_source.Disable                   = disableScript(%file_spec%)
#menu.item.script.java_source.Disable.condition         = canBeDisabled(%file_spec%)
#menu.item.script.java_class.Disable                    = disableScript(%file_spec%)
#menu.item.script.java_class.Disable.condition          = canBeDisabled(%file_spec%)
#menu.item.script.python_script_source.Disable          = disableScript(%file_spec%)
#menu.item.script.python_script_source.Disable.condition = canBeDisabled(%file_spec%)
#menu.item.script.tcl_script_source.Disable             = disableScript(%file_spec%)
#menu.item.script.tcl_script_source.Disable.condition   = canBeDisabled(%file_spec%)


menu.item.element.*.Close.separator.before = true
menu.item.element.*.Close = close()
menu.item.element.*.Close.condition = %element% == %diagram%
menu.item.element.*.Close.shortcut= CTRL+F4
menu.item.element.*.Close.separator.after = true



menu.item.textEditor.*.New = new()
menu.item.textEditor.*.New.name = "New"
menu.item.textEditor.*.Open = open()
menu.item.textEditor.*.Open.name = "Open..."
;menu.item.textEditor.*.Save = save()
;menu.item.textEditor.*.Save.name = "Save"
;menu.item.textEditor.*.Save.separator.before = true
;menu.item.textEditor.*.Save As = saveAs()
;menu.item.textEditor.*.Save As.name = "Save As..."

menu.item.textEditor.*.Cut = cut()
menu.item.textEditor.*.Cut.name = "Cut"
menu.item.textEditor.*.Cut.separator.before = true

menu.item.textEditor.*.Copy = copy()
menu.item.textEditor.*.Copy.name = "Copy"

menu.item.textEditor.*.Paste = paste()
menu.item.textEditor.*.Paste.name = "Paste"

menu.item.textEditor.*.Select All = selectAll()
menu.item.textEditor.*.Select All.name = "Select All"
menu.item.textEditor.*.Select All.separator.before = true

menu.item.textEditor.*.Format Source = formatSource()
menu.item.textEditor.*.Format Source.name = ["menu/format_source"]
menu.item.textEditor.*.Format Source.condition = isFeatureEnabledByWorkspace("editor.menu.Format Source")
menu.item.textEditor.*.Format Source.separator.before = true
menu.item.textEditor.*.Format Source.shortcut = CTRL+T

menu.item.textEditor.*.JBrowseSimbol = jBrowseSimbol()
menu.item.textEditor.*.JBrowseSimbol.name = "Browse Symbol"

;menu.item.textEditor.*.ShowBkmk = show_Bkmk()
;menu.item.textEditor.*.ShowBkmk.name = "Show Bookmarks"
;menu.item.textEditor.*.AddBkmk = set_Bkmk()
;menu.item.textEditor.*.AddBkmk.name = "Add Bookmark"

menu.item.textEditor.*.Bookmarks = group
menu.item.textEditor.*.Bookmarks.name = "Bookmarks"
;menu.item.textEditor.*.Bookmarks.separator.before = true
;menu.item.textEditor.*.Bookmarks.separator.after = true

menu.item.textEditor.*.Bookmarks.item.Toggle = set_Bkmk()
menu.item.textEditor.*.Bookmarks.item.Toggle.name = "Toggle Bookmark  Ctrl+M"
menu.item.textEditor.*.Bookmarks.item.ShowDlg = show_Bkmk()
menu.item.textEditor.*.Bookmarks.item.ShowDlg.name = "Show Bookmarks...  Ctrl+D"

menu.item.textEditor.*.ShowEditorOptions = showEditorOptions()
menu.item.textEditor.*.ShowEditorOptions.name = "Text Editor Options..."
menu.item.textEditor.*.ShowEditorOptions.separator.before = true
menu.item.textEditor.*.ShowEditorOptions.separator.after = true

menu.item.textEditor.*.PreserveTab = preserveTab()
menu.item.textEditor.*.PreserveTab.name = "Preserve Tab"
;menu.item.textEditor.*.PreserveTab.separator.before = true

menu.item.textEditor.*.Close = close()
menu.item.textEditor.*.Close.name = "Close"
;menu.item.textEditor.*.Close.separator.before = true
menu.item.textEditor.*.Close All = closeAll()
menu.item.textEditor.*.Close All.name = "Close All"


menu.item.textEditor.*.Version Control = group
menu.item.textEditor.*.Version Control.hideIfEmpty = false
menu.item.textEditor.*.Version Control.condition = isVersionControlEnabled (%file_spec%)
menu.item.textEditor.*.Version Control.separator.before = true
menu.item.textEditor.*.Version Control.separator.after = true
menu.item.textEditor.*.Version Control.item.Add = srcControlAddFile(%file_spec%)
menu.item.textEditor.*.Version Control.item.Add.name = ["menu/vc.add"]
menu.item.textEditor.*.Version Control.item.Get = srcControlGetFile(%file_spec%)
menu.item.textEditor.*.Version Control.item.Get.name = if (isShowVcsDialog(), ["menu/vc.get"], ["menu/vc.get_immediate"])
menu.item.textEditor.*.Version Control.item.Update = vcsCmdUpdate(%file_spec%)
menu.item.textEditor.*.Version Control.item.Update.name = if (isShowVcsDialog(), ["menu/vc.update"], ["menu/vc.update_immediate"])
menu.item.textEditor.*.Version Control.item.Check In = srcControlCheckInFile(%file_spec%)
menu.item.textEditor.*.Version Control.item.Check In.name = if (isShowVcsDialog(), ["menu/vc.checkin"], ["menu/vc.checkin_immediate"])
menu.item.textEditor.*.Version Control.item.Check Out = srcControlCheckOutFile(%file_spec%)
menu.item.textEditor.*.Version Control.item.Check Out.name = if (isShowVcsDialog(), ["menu/vc.checkout"], ["menu/vc.checkout_immediate"])
menu.item.textEditor.*.Version Control.item.UnCheck Out = vcsCmdUnCheckOut(%file_spec%)
menu.item.textEditor.*.Version Control.item.UnCheck Out.name = ["menu/vc.uncheckout"]
menu.item.textEditor.*.Version Control.item.Properties = srcControlPropertiesFile(%file_spec%)
menu.item.textEditor.*.Version Control.item.Properties.name = ["menu/vc.version_control_properties"]
menu.item.textEditor.*.Version Control.item.Properties.shortcut = CTRL+Q
menu.item.textEditor.*.Version Control.name = ["menu/version_control"]

;;;;;;;;;;;;;;;;;;;;;;;;;;;

menu.item.textEditorTab.*.PreserveTab = preserveTab()
menu.item.textEditorTab.*.PreserveTab.name = "Preserve Tab"

menu.item.textEditorTab.*.Close = close()
menu.item.textEditorTab.*.Close.name = "Close"


