Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312472

Summary: [Diagrams] Inconsistency in default names of diagrams
Product: [Modeling] Papyrus Reporter: Tatiana Fesenko <tatiana.fesenko>
Component: DiagramAssignee: Project Inbox <mdt-papyrus-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: cedric.dumoulin, tatiana.fesenko, thibault.landre
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Tatiana Fesenko CLA 2010-05-11 13:33:05 EDT
New diagrams are named inconsistently:
Activity diagram has 'model' as a default name
Class diagram - 'ClassDiagram'
Composite diagram - 'CompositeDiagram'
Sequence diagram - 'model' 
UseCase diagram - 'UseCaseDiagram'
Comment 1 Cedric Dumoulin CLA 2010-05-11 15:20:11 EDT
This is not a Sash Editor issue :-).
The name of a diagram is set in the diagram creation command. Each diagram has its own creation command, extending a common one.
Comment 2 Tatiana Fesenko CLA 2010-06-07 11:35:50 EDT
(In reply to comment #1)
> This is not a Sash Editor issue :-).
> The name of a diagram is set in the diagram creation command. Each diagram has
> its own creation command, extending a common one.

OK. If the user creates a SequenceDiagram, and then creates an Activity diagram the default name suggestion will be "SequenceDiagram" (for an Activity diagram). The reason is that CreateBehavioredClassifierDiagramCommand overrides runAsTransaction method and in the overriden method name of a container is used as a default value for diagram name:
protected void runAsTransaction(...) {
 if(name == null && container instanceof NamedElement) {
   setName(((NamedElement)container).getName());
...
   name = openDiagramNameDialog(getName());
...
	
The code was put as a fix for a bug 308904 .
Comment 3 Yann Tanguy CLA 2010-06-26 12:49:04 EDT
Default name set to "NewDiagram" in every diagram (r2098).
Comment 4 Camille Letavernier CLA 2013-06-25 10:46:58 EDT
The diagrams are initialized with a consistent name; I close this task