Skip to content

Commit bb61022

Browse files
committed
fix diagram wizard
fix diagram wizard
1 parent 466908a commit bb61022

File tree

3 files changed

+82
-9
lines changed

3 files changed

+82
-9
lines changed

src/main/java/org/modelio/module/attacktreedesigner/command/wizard/AttackTreeDiagramWizard.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.modelio.api.module.context.IModuleContext;
1313
import org.modelio.api.module.contributor.AbstractWizardContributor;
1414
import org.modelio.api.module.contributor.ElementDescriptor;
15-
import org.modelio.api.module.contributor.diagramcreation.IDiagramWizardContributor;
1615
import org.modelio.metamodel.diagrams.AbstractDiagram;
1716
import org.modelio.metamodel.diagrams.StaticDiagram;
1817
import org.modelio.metamodel.mmextensions.infrastructure.ExtensionNotFoundException;
@@ -32,37 +31,37 @@
3231
/**
3332
* @author ebrosse
3433
*/
35-
public class AttackTreeDiagramWizard extends AbstractWizardContributor implements IDiagramWizardContributor {
34+
public class AttackTreeDiagramWizard extends AbstractWizardContributor {
3635
@Override
3736
public AbstractDiagram actionPerformed(ModelElement owner, String diagramName, String description) {
3837
IModuleContext moduleContext = AttackTreeDesignerModule.getInstance().getModuleContext();
3938
IModelingSession session = moduleContext.getModelingSession();
4039
String name = Messages.getString ("Ui.Command.AttackTreeDiagramExplorerCommand.Label");
4140
StaticDiagram diagram = null;
42-
41+
4342
try( ITransaction transaction = session.createTransaction(Messages.getString ("Info.Session.Create", "AttackTree Diagram"))){
44-
43+
4544
diagram = session.getModel().createStaticDiagram(name, owner, IAttackTreeDesignerPeerModule.MODULE_NAME, AttackTreeStereotypes.ATTACK_TREE_DIAGRAM);
46-
45+
4746
if (diagram != null) {
4847
IDiagramService ds = moduleContext.getModelioServices().getDiagramService();
4948
try( IDiagramHandle handler = ds.getDiagramHandle(diagram);){
5049
IDiagramDG dg = handler.getDiagramNode();
51-
50+
5251
for (IStyleHandle style : ds.listStyles()){
5352
if (style.getName().equals("sysml")){
5453
dg.setStyle(style);
5554
break;
5655
}
5756
}
58-
57+
5958
handler.save();
6059
handler.close();
6160
}
62-
61+
6362
moduleContext.getModelioServices().getEditionService().openEditor(diagram);
6463
}
65-
64+
6665
transaction.commit ();
6766
} catch (ExtensionNotFoundException e) {
6867
moduleContext.getLogService().error(e);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
AttackTreePaletteGroup.AttackTree = Attack Tree
3+
AttackTreePaletteGroup.Freedrawing = Free Drawing
4+
AttackTreePaletteGroup.NotesAndConstraints = Notes and Constraints
5+
6+
Info.Session.Create = Create {0}
7+
Info.Session.UpdateModel = Update Model
8+
Info.Session.Delete = Delete {0}
9+
10+
Ui.Command.AttackTreeDiagramExplorerCommand.Label = Attack Tree Diagram
11+
Ui.Command.AttackTreeDiagramExplorerCommand.Name = Attack Tree Diagram
12+
Ui.Property.Name.Name = Name
13+
Ui.Property.Reference.Name = Reference
14+
Ui.Property.TypeCondition.Name = Type
15+
16+
17+
Ui.Dialog.SelectXMLFileImport.Label = Select an XML file to import
18+
Ui.Dialog.SelectDirectoryImport.Label = Select a directory to import
19+
Ui.Dialog.SelectDirectoryExport.Label = Select a directory to export
20+
Ui.Dialog.NoSelectedElement.Label = No selected element!
21+
Ui.Dialog.NoSelectedElementAdd.Message = No element has been selected to add custom tag
22+
Ui.Dialog.EmptyName.Label = Empty name field!
23+
Ui.Dialog.EmptyName.Message = The property name field is empty
24+
Ui.Dialog.EmptyValue.Label = Empty value field!
25+
Ui.Dialog.EmptyValue.Message = The property value field is empty
26+
Ui.Dialog.AddCustomTag.Label = Add a new Custom Tag property
27+
Ui.Dialog.CustomTagName.Label = Provide the name and the value of your property
28+
Ui.Field.CustomTagName.Label = Property name:
29+
Ui.Field.CustomTagValue.Label = Property value:
30+
Ui.Button.Cancel.Label = Cancel
31+
Ui.Button.OK.Label = OK
32+
Ui.Dialog.existingName.Label = Already existing name!
33+
Ui.Dialog.existingName.Message = This property name is already existing
34+
Ui.Dialog.noSelectedElement.Message = No element has been selected to remove custom tag
35+
Ui.Dialog.NoSelectedTagRemove.Message = No element has been selected to remove from custom properties list
36+
Ui.Dialog.NoDiagramFound.Label = No Diagram Found!
37+
Ui.Dialog.NoDiagramFound.Message = Sorry! We could not find the diagram of the referenced tree
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
AttackTreePaletteGroup.AttackTree = Attack Tree
3+
AttackTreePaletteGroup.Freedrawing = Free Drawing
4+
AttackTreePaletteGroup.NotesAndConstraints = Notes and Constraints
5+
6+
Info.Session.Create = Create {0}
7+
Info.Session.UpdateModel = Update Model
8+
Info.Session.Delete = Delete {0}
9+
10+
Ui.Command.AttackTreeDiagramExplorerCommand.Label = Attack Tree Diagram
11+
Ui.Command.AttackTreeDiagramExplorerCommand.Name = Attack Tree Diagram
12+
Ui.Property.Name.Name = Name
13+
Ui.Property.Reference.Name = Reference
14+
Ui.Property.TypeCondition.Name = Type
15+
16+
17+
Ui.Dialog.SelectXMLFileImport.Label = Select an XML file to import
18+
Ui.Dialog.SelectDirectoryImport.Label = Select a directory to import
19+
Ui.Dialog.SelectDirectoryExport.Label = Select a directory to export
20+
Ui.Dialog.NoSelectedElement.Label = No selected element!
21+
Ui.Dialog.NoSelectedElementAdd.Message = No element has been selected to add custom tag
22+
Ui.Dialog.EmptyName.Label = Empty name field!
23+
Ui.Dialog.EmptyName.Message = The property name field is empty
24+
Ui.Dialog.EmptyValue.Label = Empty value field!
25+
Ui.Dialog.EmptyValue.Message = The property value field is empty
26+
Ui.Dialog.AddCustomTag.Label = Add a new Custom Tag property
27+
Ui.Dialog.CustomTagName.Label = Provide the name and the value of your property
28+
Ui.Field.CustomTagName.Label = Property name:
29+
Ui.Field.CustomTagValue.Label = Property value:
30+
Ui.Button.Cancel.Label = Cancel
31+
Ui.Button.OK.Label = OK
32+
Ui.Dialog.existingName.Label = Already existing name!
33+
Ui.Dialog.existingName.Message = This property name is already existing
34+
Ui.Dialog.noSelectedElement.Message = No element has been selected to remove custom tag
35+
Ui.Dialog.NoSelectedTagRemove.Message = No element has been selected to remove from custom properties list
36+
Ui.Dialog.NoDiagramFound.Label = No Diagram Found!
37+
Ui.Dialog.NoDiagramFound.Message = Sorry! We could not find the diagram of the referenced tree

0 commit comments

Comments
 (0)