diff options
| author | Pierre-Charles David | 2015-05-21 08:51:16 +0000 |
|---|---|---|
| committer | Pierre-Charles David | 2015-05-28 15:20:25 +0000 |
| commit | 7fc40e9e70cb4cdb00a16b2616df845aa3065aa2 (patch) | |
| tree | c561dff2c18a4043dff29d6e884473d831b74212 | |
| parent | 01a019486ef2b9f0434076ee13f9e399843e137f (diff) | |
| download | org.eclipse.sirius-7fc40e9e70cb4cdb00a16b2616df845aa3065aa2.tar.gz org.eclipse.sirius-7fc40e9e70cb4cdb00a16b2616df845aa3065aa2.tar.xz org.eclipse.sirius-7fc40e9e70cb4cdb00a16b2616df845aa3065aa2.zip | |
[441946] Improve the ordering of menu items
Define the actual order of VSM context menu categories and items inside
categories. Not all items may by fully handled, but it is already way
better than the previous state.
Also make the menu priorities test less strict: it should not be a
failure if a key is missing (the code is ready to handle this with
default priorities), but only if a key is malformed.
The "missing key" tests is still useful, but only as an optional report
which can be used to reviews if some important types have been
forgotten/left without priority.
Bug: 441946
Change-Id: I4aa8b521dfbae98fcfbf9b932ed292b8dc407f8c
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
3 files changed, 223 insertions, 313 deletions
diff --git a/plugins/org.eclipse.sirius.editor/plugin.properties b/plugins/org.eclipse.sirius.editor/plugin.properties index 5df9c64f1c..b842c72737 100644 --- a/plugins/org.eclipse.sirius.editor/plugin.properties +++ b/plugins/org.eclipse.sirius.editor/plugin.properties @@ -130,305 +130,184 @@ _UI_SiriusModelWizardName_label = Viewpoint Specification Model name: titleSelectAFile = Select a file titleSelectFiles = Select files -#Priorities of menus -ConditionalStylePriority = 100 -CustomizationPriority = 200 -DiagramElementPriority = 300 -ElementCreationPriority = 400 -ElementEditionPriority = 500 -ExtensionPriority = 600 -FilterPriority = 700 -ImportPriority = 800 -LayoutPriority = 900 -MenuPriority = 1000 -NavigationPriority = 1100 -OperationPriority = 1200 -ReorderPriority = 1300 -RepresentationPriority = 1400 -RepresentationCreationPriority = 1500 -SimulationPriority = 1600 -StylePriority = 1700 -TableElementPriority = 1800 -TemplatePriority = 1900 -ToolPriority = 2000 -TreeElementPriority = 2100 -ValidationPriority = 2200 -VariablePriority = 2300 -OthersPriority = 2400 -InitializePriority = 2500 -RefactorPriority = 2600 +# Priorities of menus +RepresentationPriority = 1000 +TemplatePriority = 2000 +DiagramElementPriority = 3000 +TableElementPriority = 4000 +TreeElementPriority = 5000 +StylePriority = 6000 +ConditionalStylePriority = 7000 +ElementCreationPriority = 8000 +ElementEditionPriority = 9000 +ToolPriority = 10000 +ReorderPriority = 11000 +RepresentationCreationPriority = 12000 +CustomizationPriority = 13000 +FilterPriority = 14000 +ValidationPriority = 15000 +ImportPriority = 16000 +MenuPriority = 17000 +NavigationPriority = 18000 +SimulationPriority = 19000 +VariablePriority = 20000 +OperationPriority = 21000 +LayoutPriority = 22000 +ExtensionPriority = 23000 +InitializePriority = 24000 +RefactorPriority = 25000 +OthersPriority = 26000 # Priorities of sub-menus -diagram.description.DiagramDescription = 1000000000 -diagram.description.DiagramImportDescription = 1000000000 -diagram.description.DiagramExtensionDescription = 1000000000 -diagram.description.DiagramElementMapping = 1000000000 -diagram.description.AbstractNodeMapping = 1000000000 -diagram.description.NodeMapping = 1000000000 -diagram.description.ContainerMapping = 1000000000 -diagram.description.NodeMappingImport = 1000000000 -diagram.description.ContainerMappingImport = 1000000000 -diagram.description.EdgeMapping = 1000000000 -diagram.description.IEdgeMapping = 1000000000 -diagram.description.EdgeMappingImport = 1000000000 -diagram.description.ConditionalNodeStyleDescription = 1000000000 -diagram.description.ConditionalEdgeStyleDescription = 1000000000 -diagram.description.ConditionalContainerStyleDescription = 1000000000 -diagram.description.Layout = 1000000000 -diagram.description.OrderedTreeLayout = 1000000000 -diagram.description.CompositeLayout = 1000000000 -diagram.description.MappingBasedDecoration = 1000000000 -diagram.description.Layer = 1000000000 -diagram.description.AdditionalLayer = 1000000000 -diagram.description.DragAndDropTargetDescription = 1000000000 -diagram.description.style.BorderedStyleDescription = 1000000000 -diagram.description.style.NodeStyleDescription = 1000000000 -diagram.description.style.CustomStyleDescription = 1000000000 -diagram.description.style.SquareDescription = 1000000000 -diagram.description.style.LozengeNodeDescription = 1000000000 -diagram.description.style.EllipseNodeDescription = 1000000000 -diagram.description.style.BundledImageDescription = 1000000000 -diagram.description.style.NoteDescription = 1000000000 -diagram.description.style.DotDescription = 1000000000 -diagram.description.style.GaugeCompositeStyleDescription = 1000000000 -diagram.description.style.GaugeSectionDescription = 1000000000 -diagram.description.style.SizeComputationContainerStyleDescription = 1000000000 -diagram.description.style.RoundedCornerStyleDescription = 1000000000 -diagram.description.style.ContainerStyleDescription = 1000000000 -diagram.description.style.FlatContainerStyleDescription = 1000000000 -diagram.description.style.ShapeContainerStyleDescription = 1000000000 -diagram.description.style.WorkspaceImageDescription = 1000000000 -diagram.description.style.EdgeStyleDescription = 1000000000 -diagram.description.style.BeginLabelStyleDescription = 1000000000 -diagram.description.style.CenterLabelStyleDescription = 1000000000 -diagram.description.style.EndLabelStyleDescription = 1000000000 -diagram.description.style.BracketEdgeStyleDescription = 1000000000 -diagram.description.style.HideLabelCapabilityStyleDescription = 1000000000 -diagram.description.tool.ToolSection = 1000000000 -diagram.description.tool.ToolGroup = 1000000000 -diagram.description.tool.ToolGroupExtension = 1000000000 -diagram.description.tool.NodeCreationDescription = 1000000000 -diagram.description.tool.EdgeCreationDescription = 1000000000 -diagram.description.tool.ContainerCreationDescription = 1000000000 -diagram.description.tool.DeleteElementDescription = 1000000000 -diagram.description.tool.DoubleClickDescription = 1000000000 -diagram.description.tool.DeleteHook = 1000000000 -diagram.description.tool.DeleteHookParameter = 1000000000 -diagram.description.tool.ReconnectEdgeDescription = 1000000000 -diagram.description.tool.RequestDescription = 1000000000 -diagram.description.tool.DirectEditLabel = 1000000000 -diagram.description.tool.BehaviorTool = 1000000000 -diagram.description.tool.SourceEdgeCreationVariable = 1000000000 -diagram.description.tool.SourceEdgeViewCreationVariable = 1000000000 -diagram.description.tool.TargetEdgeCreationVariable = 1000000000 -diagram.description.tool.TargetEdgeViewCreationVariable = 1000000000 -diagram.description.tool.ElementDoubleClickVariable = 1000000000 -diagram.description.tool.NodeCreationVariable = 1000000000 -diagram.description.tool.CreateView = 1000000000 -diagram.description.tool.CreateEdgeView = 1000000000 -diagram.description.tool.Navigation = 1000000000 -diagram.description.tool.DiagramCreationDescription = 1000000000 -diagram.description.tool.DiagramNavigationDescription = 1000000000 -diagram.description.tool.ContainerDropDescription = 1000000000 -diagram.description.filter.FilterDescription = 1000000000 -diagram.description.filter.Filter = 1000000000 -diagram.description.filter.MappingFilter = 1000000000 -diagram.description.filter.CompositeFilterDescription = 1000000000 -diagram.description.filter.VariableFilter = 1000000000 -diagram.description.filter.FilterVariable = 1000000000 -diagram.description.concern.ConcernSet = 1000000000 -diagram.description.concern.ConcernDescription = 1000000000 -tree.description.TreeDescription = 1000000000 -tree.description.TreeItemMapping = 1000000000 -tree.description.TreeItemStyleDescription = 1000000000 -tree.description.ConditionalTreeItemStyleDescription = 1000000000 -tree.description.TreeItemTool = 1000000000 -tree.description.TreeItemDragTool = 1000000000 -tree.description.TreeItemContainerDropTool = 1000000000 -tree.description.TreeItemCreationTool = 1000000000 -tree.description.TreeItemEditionTool = 1000000000 -tree.description.TreeItemDeletionTool = 1000000000 -tree.description.TreeCreationDescription = 1000000000 -tree.description.TreeNavigationDescription = 1000000000 -tree.description.TreeMapping = 1000000000 -tree.description.StyleUpdater = 1000000000 -tree.description.TreeVariable = 1000000000 -tree.description.TreeItemUpdater = 1000000000 -tree.description.PrecedingSiblingsVariables = 1000000000 -tree.description.TreeItemMappingContainer = 1000000000 -tree.description.TreePopupMenu = 1000000000 -table.description.TableDescription = 1000000000 -table.description.EditionTableDescription = 1000000000 -table.description.CrossTableDescription = 1000000000 -table.description.TableMapping = 1000000000 -table.description.LineMapping = 1000000000 -table.description.ColumnMapping = 1000000000 -table.description.ElementColumnMapping = 1000000000 -table.description.FeatureColumnMapping = 1000000000 -table.description.CellUpdater = 1000000000 -table.description.StyleUpdater = 1000000000 -table.description.IntersectionMapping = 1000000000 -table.description.TableTool = 1000000000 -table.description.LabelEditTool = 1000000000 -table.description.CreateTool = 1000000000 -table.description.CreateColumnTool = 1000000000 -table.description.CreateCrossColumnTool = 1000000000 -table.description.CreateLineTool = 1000000000 -table.description.CreateCellTool = 1000000000 -table.description.DeleteTool = 1000000000 -table.description.DeleteColumnTool = 1000000000 -table.description.DeleteLineTool = 1000000000 -table.description.ForegroundStyleDescription = 1000000000 -table.description.BackgroundStyleDescription = 1000000000 -table.description.ForegroundConditionalStyle = 1000000000 -table.description.BackgroundConditionalStyle = 1000000000 -table.description.TableVariable = 1000000000 -table.description.TableCreationDescription = 1000000000 -table.description.TableNavigationDescription = 1000000000 -viewpoint.description.Group = 1000000000 -viewpoint.description.Component = 1000000000 -viewpoint.description.Viewpoint = 1000000000 -viewpoint.description.FeatureExtensionDescription = 1000000000 -viewpoint.description.RepresentationDescription = 1000000000 -viewpoint.description.RepresentationTemplate = 1000000000 -viewpoint.description.RepresentationImportDescription = 1000000000 -viewpoint.description.RepresentationExtensionDescription = 1000000000 -viewpoint.description.MetamodelExtensionSetting = 1000000000 -viewpoint.description.JavaExtension = 1000000000 -viewpoint.description.RepresentationElementMapping = 1000000000 -viewpoint.description.AbstractMappingImport = 1000000000 -viewpoint.description.DocumentedElement = 1000000000 -viewpoint.description.DModelElement = 1000000000 -viewpoint.description.DAnnotation = 1000000000 -viewpoint.description.ConditionalStyleDescription = 1000000000 -viewpoint.description.PasteTargetDescription = 1000000000 -viewpoint.description.DecorationDescriptionsSet = 1000000000 -viewpoint.description.DecorationDescription = 1000000000 -viewpoint.description.SemanticBasedDecoration = 1000000000 -viewpoint.description.Customization = 1000000000 -viewpoint.description.IVSMElementCustomization = 1000000000 -viewpoint.description.VSMElementCustomization = 1000000000 -viewpoint.description.VSMElementCustomizationReuse = 1000000000 -viewpoint.description.EStructuralFeatureCustomization = 1000000000 -viewpoint.description.EAttributeCustomization = 1000000000 -viewpoint.description.EReferenceCustomization = 1000000000 -viewpoint.description.SelectionDescription = 1000000000 -viewpoint.description.ColorDescription = 1000000000 -viewpoint.description.SystemColor = 1000000000 -viewpoint.description.InterpolatedColor = 1000000000 -viewpoint.description.ColorStep = 1000000000 -viewpoint.description.FixedColor = 1000000000 -viewpoint.description.UserFixedColor = 1000000000 -viewpoint.description.UserColor = 1000000000 -viewpoint.description.Environment = 1000000000 -viewpoint.description.SytemColorsPalette = 1000000000 -viewpoint.description.UserColorsPalette = 1000000000 -viewpoint.description.AnnotationEntry = 1000000000 -viewpoint.description.EndUserDocumentedElement = 1000000000 -viewpoint.description.IdentifiedElement = 1000000000 -viewpoint.description.ComputedColor = 1000000000 -viewpoint.description.DAnnotationEntry = 1000000000 -viewpoint.description.style.StyleDescription = 1000000000 -viewpoint.description.style.BasicLabelStyleDescription = 1000000000 -viewpoint.description.style.LabelStyleDescription = 1000000000 -viewpoint.description.style.LabelBorderStyles = 1000000000 -viewpoint.description.style.LabelBorderStyleDescription = 1000000000 -viewpoint.description.style.TooltipStyleDescription = 1000000000 -viewpoint.description.tool.ToolEntry = 1000000000 -viewpoint.description.tool.AbstractToolDescription = 1000000000 -viewpoint.description.tool.MappingBasedToolDescription = 1000000000 -viewpoint.description.tool.ToolDescription = 1000000000 -viewpoint.description.tool.PasteDescription = 1000000000 -viewpoint.description.tool.SelectionWizardDescription = 1000000000 -viewpoint.description.tool.PaneBasedSelectionWizardDescription = 1000000000 -viewpoint.description.tool.RepresentationCreationDescription = 1000000000 -viewpoint.description.tool.RepresentationNavigationDescription = 1000000000 -viewpoint.description.tool.MenuItemOrRef = 1000000000 -viewpoint.description.tool.MenuItemDescription = 1000000000 -viewpoint.description.tool.MenuItemDescriptionReference = 1000000000 -viewpoint.description.tool.OperationAction = 1000000000 -viewpoint.description.tool.ExternalJavaAction = 1000000000 -viewpoint.description.tool.ExternalJavaActionCall = 1000000000 -viewpoint.description.tool.PopupMenu = 1000000000 -viewpoint.description.tool.AbstractVariable = 1000000000 -viewpoint.description.tool.VariableContainer = 1000000000 -viewpoint.description.tool.AcceleoVariable = 1000000000 -viewpoint.description.tool.SubVariable = 1000000000 -viewpoint.description.tool.DialogVariable = 1000000000 -viewpoint.description.tool.ElementDropVariable = 1000000000 -viewpoint.description.tool.ElementSelectVariable = 1000000000 -viewpoint.description.tool.ElementVariable = 1000000000 -viewpoint.description.tool.ElementViewVariable = 1000000000 -viewpoint.description.tool.ElementDeleteVariable = 1000000000 -viewpoint.description.tool.DropContainerVariable = 1000000000 -viewpoint.description.tool.SelectContainerVariable = 1000000000 -viewpoint.description.tool.ContainerViewVariable = 1000000000 -viewpoint.description.tool.SelectModelElementVariable = 1000000000 -viewpoint.description.tool.EditMaskVariables = 1000000000 -viewpoint.description.tool.ContainerModelOperation = 1000000000 -viewpoint.description.tool.ModelOperation = 1000000000 -viewpoint.description.tool.InitialNodeCreationOperation = 1000000000 -viewpoint.description.tool.InitialOperation = 1000000000 -viewpoint.description.tool.InitEdgeCreationOperation = 1000000000 -viewpoint.description.tool.InitialContainerDropOperation = 1000000000 -viewpoint.description.tool.CreateInstance = 1000000000 -viewpoint.description.tool.ChangeContext = 1000000000 -viewpoint.description.tool.SetValue = 1000000000 -viewpoint.description.tool.SetObject = 1000000000 -viewpoint.description.tool.Unset = 1000000000 -viewpoint.description.tool.MoveElement = 1000000000 -viewpoint.description.tool.RemoveElement = 1000000000 -viewpoint.description.tool.For = 1000000000 -viewpoint.description.tool.If = 1000000000 -viewpoint.description.tool.DeleteView = 1000000000 -viewpoint.description.tool.NameVariable = 1000000000 -viewpoint.description.tool.ExternalJavaActionParameter = 1000000000 -viewpoint.description.tool.ToolFilterDescription = 1000000000 -viewpoint.description.tool.FeatureChangeListener = 1000000000 -viewpoint.description.tool.Case = 1000000000 -viewpoint.description.tool.SwitchChild = 1000000000 -viewpoint.description.tool.Default = 1000000000 -viewpoint.description.tool.Switch = 1000000000 -viewpoint.description.validation.ValidationSet = 1000000000 -viewpoint.description.validation.ValidationRule = 1000000000 -viewpoint.description.validation.SemanticValidationRule = 1000000000 -viewpoint.description.validation.ViewValidationRule = 1000000000 -viewpoint.description.validation.RuleAudit = 1000000000 -viewpoint.description.validation.ValidationFix = 1000000000 -viewpoint.description.audit.InformationSection = 1000000000 -viewpoint.description.audit.TemplateInformationSection = 1000000000 -sequence.description.SequenceDiagramDescription = 1000000000 -sequence.description.InstanceRoleMapping = 1000000000 -sequence.description.EventMapping = 1000000000 -sequence.description.DelimitedEventMapping = 1000000000 -sequence.description.ExecutionMapping = 1000000000 -sequence.description.StateMapping = 1000000000 -sequence.description.EndOfLifeMapping = 1000000000 -sequence.description.MessageMapping = 1000000000 -sequence.description.BasicMessageMapping = 1000000000 -sequence.description.ReturnMessageMapping = 1000000000 -sequence.description.CreationMessageMapping = 1000000000 -sequence.description.DestructionMessageMapping = 1000000000 -sequence.description.MessageEndVariable = 1000000000 -sequence.description.CoveredLifelinesVariable = 1000000000 -sequence.description.FrameMapping = 1000000000 -sequence.description.InteractionUseMapping = 1000000000 -sequence.description.CombinedFragmentMapping = 1000000000 -sequence.description.OperandMapping = 1000000000 -sequence.description.ObservationPointMapping = 1000000000 -sequence.description.tool.SequenceDiagramToolDescription = 1000000000 -sequence.description.tool.OrderedElementCreationTool = 1000000000 -sequence.description.tool.CoveringElementCreationTool = 1000000000 -sequence.description.tool.InstanceRoleCreationTool = 1000000000 -sequence.description.tool.LifelineCreationTool = 1000000000 -sequence.description.tool.MessageCreationTool = 1000000000 -sequence.description.tool.ExecutionCreationTool = 1000000000 -sequence.description.tool.StateCreationTool = 1000000000 -sequence.description.tool.InteractionUseCreationTool = 1000000000 -sequence.description.tool.CombinedFragmentCreationTool = 1000000000 -sequence.description.tool.OperandCreationTool = 1000000000 -sequence.description.tool.ObservationPointCreationTool = 1000000000 -sequence.description.tool.ReorderTool = 1000000000 -sequence.description.tool.InstanceRoleReorderTool = 1000000000 +# On "Group" +viewpoint.description.Viewpoint = 1000 +viewpoint.description.UserColorsPalette = 2000 +# On "User Color Palette" +viewpoint.description.UserFixedColor = 1000 +viewpoint.description.ComputedColor = 2000 +viewpoint.description.InterpolatedColor = 3000 +# On "Component > New Extension" +diagram.description.DiagramExtensionDescription = 1000 +viewpoint.description.JavaExtension = 2000 +viewpoint.description.MetamodelExtensionSetting = 3000 +# On "Viewpoint > New Representation" +diagram.description.DiagramDescription = 1000 +table.description.EditionTableDescription = 2000 +table.description.CrossTableDescription = 3000 +tree.description.TreeDescription = 4000 +sequence.description.SequenceDiagramDescription = 5000 +# On "Diagram > New Diagram Element" +diagram.description.Layer = 1000 +diagram.description.AdditionalLayer = 2000 +# On "Diagram > New Layout" +diagram.description.OrderedTreeLayout = 1000 +diagram.description.CompositeLayout = 2000 +# On "Layer > New Diagram Element" +diagram.description.NodeMapping = 1000 +diagram.description.ContainerMapping = 2000 +diagram.description.EdgeMapping = 3000 +sequence.description.InstanceRoleMapping = 4000 +sequence.description.ExecutionMapping = 5000 +sequence.description.BasicMessageMapping = 6000 +sequence.description.ReturnMessageMapping = 7000 +sequence.description.CreationMessageMapping = 8000 +sequence.description.DestructionMessageMapping = 9000 +sequence.description.InteractionUseMapping = 10000 +sequence.description.CombinedFragmentMapping = 11000 +sequence.description.OperandMapping = 12000 +sequence.description.ObservationPointMapping = 13000 +sequence.description.StateMapping = 14000 +sequence.description.EndOfLifeMapping = 15000 +viewpoint.description.DecorationDescriptionsSet = 16000 +# On "Layer > New Import" +diagram.description.NodeMappingImport = 15000 +diagram.description.ContainerMappingImport = 25000 +diagram.description.EdgeMappingImport = 35000 +# On "Node > New Style" +diagram.description.style.BundledImageDescription = 1000 +diagram.description.style.WorkspaceImageDescription = 2000 +diagram.description.style.FlatContainerStyleDescription = 3000 +diagram.description.style.SquareDescription = 4000 +diagram.description.style.LozengeNodeDescription = 5000 +diagram.description.style.DotDescription = 6000 +diagram.description.style.EllipseNodeDescription = 7000 +diagram.description.style.NoteDescription = 8000 +diagram.description.style.GaugeCompositeStyleDescription = 9000 +diagram.description.style.ShapeContainerStyleDescription = 10000 +diagram.description.style.CustomStyleDescription = 11000 +# On "Edge > New Style" +diagram.description.style.EdgeStyleDescription = 1000 +diagram.description.style.BracketEdgeStyleDescription = 2000 +# On "Edge Style > New Style" +diagram.description.style.CenterLabelStyleDescription = 1000 +diagram.description.style.BeginLabelStyleDescription = 2000 +diagram.description.style.EndLabelStyleDescription = 3000 +# On "Tool Section > New Element Creation" +sequence.description.tool.InstanceRoleCreationTool = 1000 +sequence.description.tool.ExecutionCreationTool = 2000 +sequence.description.tool.MessageCreationTool = 3000 +sequence.description.tool.InteractionUseCreationTool = 4000 +sequence.description.tool.CombinedFragmentCreationTool = 5000 +sequence.description.tool.OperandCreationTool = 6000 +sequence.description.tool.ObservationPointCreationTool = 7000 +sequence.description.tool.StateCreationTool = 8000 +diagram.description.tool.NodeCreationDescription = 9000 +diagram.description.tool.ContainerCreationDescription = 10000 +diagram.description.tool.EdgeCreationDescription = 11000 +# On "Tool Section > New Element Edition" +diagram.description.tool.DirectEditLabel = 1000 +viewpoint.description.tool.DeleteElementDescription = 2000 +diagram.description.tool.ReconnectEdgeDescription = 3000 +diagram.description.tool.DoubleClickDescription = 4000 +viewpoint.description.tool.SelectionWizardDescription = 5000 +viewpoint.description.tool.PaneBasedSelectionWizardDescription = 6000 +diagram.description.tool.ContainerDropDescription = 7000 +viewpoint.description.tool.PasteDescription = 8000 +# On "Tool Section > New Tool" +diagram.description.tool.ToolSection = 1000 +diagram.description.tool.ToolGroup = 2000 +diagram.description.tool.ToolGroupExtension = 3000 +# On "Tool Section > New Menu" +viewpoint.description.tool.PopupMenu = 1000 +tree.description.TreePopupMenu = 2000 +viewpoint.description.tool.OperationAction = 3000 +# On "Tool Section > New Navigation" +diagram.description.tool.DiagramNavigationDescription = 1000 +table.description.TableNavigationDescription = 2000 +tree.description.TreeNavigationDescription = 3000 +# On "Tool Section > New Representation Creation +diagram.description.tool.DiagramCreationDescription = 1000 +table.description.TableCreationDescription = 2000 +tree.description.TreeCreationDescription = 3000 +# On "Tool Section > New Simulation" +viewpoint.description.tool.BehaviorTool = 10000 +# On "Tool Section > New Reorder" +sequence.description.tool.ReorderTool = 1000 +sequence.description.tool.InstanceRoleReorderTool = 2000 +# On "Tool Section > New Operation/New Extension" +viewpoint.description.tool.ExternalJavaAction = 1000 +diagram.description.tool.RequestDescription = 2000 +# On "Edition/Cross Table Description > New Table Element" +table.description.LineMapping = 1000 +table.description.FeatureColumnMapping = 2000 +table.description.ElementColumnMapping = 3000 +table.description.IntersectionMapping = 4000 +# On "<TableElement> > New (Conditional) Style" +table.description.ForegroundStyleDescription = 1000 +table.description.ForegroundConditionalStyle = 2000 +table.description.BackgroundStyleDescription = 3000 +table.description.BackgroundConditionalStyle = 4000 +# On "<LineElement> > New Tool" +table.description.CreateLineTool = 1000 +table.description.CreateColumnTool = 2000 +table.description.CreateCrossColumnTool = 3000 +table.description.CreateCellTool = 4000 +table.description.LabelEditTool = 5000 +table.description.DeleteLineTool = 6000 +table.description.DeleteColumnTool = 7000 +# On "Tree Item > New Tool" +tree.description.TreeItemCreationTool = 1000 +tree.description.TreeItemEditionTool = 2000 +tree.description.TreeItemDeletionTool = 3000 +tree.description.TreeItemDragTool = 4000 +tree.description.TreeItemContainerDropTool = 5000 +# On <any model operation> > New Operation +viewpoint.description.tool.ChangeContext = 1000 +viewpoint.description.tool.CreateInstance = 2000 +viewpoint.description.tool.SetValue = 3000 +viewpoint.description.tool.Unset = 4000 +viewpoint.description.tool.MoveElement = 5000 +viewpoint.description.tool.RemoveElement = 6000 +diagram.description.tool.CreateView = 7000 +diagram.description.tool.CreateEdgeView = 8000 +viewpoint.description.tool.DeleteView = 9000 +diagram.description.tool.Navigation = 10000 +viewpoint.description.tool.If = 11000 +viewpoint.description.tool.Switch = 12000 +viewpoint.description.tool.For = 13000 +viewpoint.description.tool.ExternalJavaActionCall = 14000 +# On "Switch > New" +viewpoint.description.tool.Case = 1000 +viewpoint.description.tool.Default = 2000 #End of user code specific keys diff --git a/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/api/menu/AbstractMenuBuilder.java b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/api/menu/AbstractMenuBuilder.java index 2e17ebb6cd..26753c85b5 100644 --- a/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/api/menu/AbstractMenuBuilder.java +++ b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/api/menu/AbstractMenuBuilder.java @@ -250,7 +250,7 @@ public abstract class AbstractMenuBuilder { private static int getPriority(ResourceLocator rl, String id) { try { - return Integer.parseInt(rl.getString(id)); + return Integer.parseInt(rl.getString(id).trim()); } catch (NumberFormatException nfe) { } catch (MissingResourceException mre) { } @@ -505,7 +505,7 @@ public abstract class AbstractMenuBuilder { if (key != null && !priorityMap.containsKey(key)) { int priority = AbstractMenuBuilder.DEFAULT_PRIORITY; try { - priority = Integer.parseInt(SiriusEditorPlugin.INSTANCE.getString(key)); + priority = Integer.parseInt(SiriusEditorPlugin.INSTANCE.getString(key).trim()); } catch (MissingResourceException mre) { } catch (NumberFormatException nfe) { } diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/common/SubMenusPrioritiesTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/common/SubMenusPrioritiesTest.java index 6bbeb3c80f..0db7efa973 100644 --- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/common/SubMenusPrioritiesTest.java +++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/common/SubMenusPrioritiesTest.java @@ -11,20 +11,37 @@ *******************************************************************************/ package org.eclipse.sirius.tests.unit.common; -import java.util.ArrayList; import java.util.List; import java.util.MissingResourceException; +import java.util.Set; import junit.framework.TestCase; -import org.eclipse.emf.common.util.TreeIterator; import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.sirius.business.internal.metamodel.helper.EClassHelper; import org.eclipse.sirius.editor.editorPlugin.SiriusEditorPlugin; +import org.eclipse.sirius.ext.emf.AllContents; +import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +/** + * Check that the priorities for the elements in the VSM editor's context menu + * are correctly defined. + */ public class SubMenusPrioritiesTest extends TestCase { + /** + * It should not be considered an error if some EClass does not have an + * explicit priority set in the properties file, as the code handles this + * case fine with a default value. However it may be interesting to run the + * test with this flag on from time to time and manually review the missing + * keys to verify if some important type is not missing. + */ + private static final boolean REPORT_MISSING_KEYS = false; + public void testViewpointDescriptions() { validateChildrenHavePriority(org.eclipse.sirius.viewpoint.description.DescriptionPackage.eINSTANCE); } @@ -45,24 +62,38 @@ public class SubMenusPrioritiesTest extends TestCase { validateChildrenHavePriority(org.eclipse.sirius.diagram.sequence.description.DescriptionPackage.eINSTANCE); } + @SuppressWarnings("unused") private void validateChildrenHavePriority(EPackage ePackage) { - List<EClass> list = new ArrayList<EClass>(); - TreeIterator<EObject> iterator = ePackage.eAllContents(); - while (iterator.hasNext()) { - EObject eObj = iterator.next(); - if (eObj instanceof EClass) { - list.add((EClass) eObj); + Set<String> missing = Sets.newTreeSet(); + Set<String> invalid = Sets.newTreeSet(); + + // Collect concrete classes which can have priorities associated + List<EClass> classes = Lists.newArrayList(); + for (EClass klass : Iterables.filter(AllContents.of(ePackage, true), EClass.class)) { + if (!klass.isAbstract() && !klass.isInterface()) { + classes.add(klass); } } - for (EClass eClass : list) { + + // Check the priorities are defined and valid + for (EClass eClass : classes) { String key = EClassHelper.getPath(eClass); try { - Integer.parseInt(SiriusEditorPlugin.INSTANCE.getString(key)); + Integer.parseInt(SiriusEditorPlugin.INSTANCE.getString(key).trim()); } catch (MissingResourceException mre) { - fail("The sub-menu priority key '" + key + "' is missing in the plugin.properties file of the sirius.editor plugin"); + missing.add(key); } catch (NumberFormatException nfe) { - fail("The value associated with the key '" + key + "' in the plugin.properties file of the sirius.editor plugin is not an int"); + invalid.add(key); } } + + // Report any errors or warnings + if (missing.size() > 0 && REPORT_MISSING_KEYS) { + System.err.println("The following concrete types do not have any priority set; they will get the default value from AbstractMenuBuilder.DEFAULT_PRIORITY:"); + System.err.println("* " + Joiner.on("\n* ").join(missing)); + } + if (invalid.size() > 0) { + fail("The following keys have malformed values which can not be parsed as integers: " + Joiner.on(", ").join(invalid)); + } } } |
