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

Bug 314614

Summary: [Wizard] Add SelectDiagramCategory Wizard page
Product: [Modeling] Papyrus Reporter: Tatiana Fesenko <tatiana.fesenko>
Component: CoreAssignee: Tatiana Fesenko <tatiana.fesenko>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ansgar.radermacher, rschnekenburger, yann.tanguy
Version: 0.7.0Flags: sebastien.gerard: iplog-
Target Milestone: 0.7.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Initial patch
sebastien.gerard: iplog+
Patch using CheckboxTableViewer
sebastien.gerard: iplog+
Initial patch
sebastien.gerard: iplog+
Initial patch
sebastien.gerard: iplog+
Categorize the existing diagrams by languages
sebastien.gerard: iplog+
Add diagram categories into NewPapyrusProjectWizard sebastien.gerard: iplog+

Description Tatiana Fesenko CLA 2010-05-27 04:10:06 EDT
Add select diagram category wizard page. This page should contain list of categories(languages) such as UML, Profile, SysML, etc. 
Diagram kinds and available templates shoould be filtered in accordance with the chosen category. For example, if the user choses Profile category, then only Profile diagram kind should be available on DiagramKindPage and only ProfileWithBasicTypes template should be displayed in the list of available templates.
Comment 1 Tatiana Fesenko CLA 2010-05-27 04:33:02 EDT
Created attachment 170149 [details]
Initial patch

The patch specifies extension point for diagram categories. Reference to a in templates and diagram kind extension point was added. 
The first page of the wizard is implemented, content of the DiagramKind is filtered in accordance with the chosen diagram category
Comment 2 Tatiana Fesenko CLA 2010-05-27 04:45:36 EDT
The challenges of implementation:
A graphical content of pages is initialized in createControl() method, which is called when the Wizard is initialized. It means that all the pages are initialized at the same time, before any of them has been displayed. So Eclipse Core doesn't provide a mechanizm to dynamically change content of a Wizard Page depending on choice made on the previos page. I discovered several solutions:
1. add a page to the wizard dinamically 

	public IWizardPage getNextPage(IWizardPage page) {
		if (page == selectTemplateWizardPage) {
			addPage(selectDiagramKindPage);
			return selectDiagramKindPage;
		}
		return super.getNextPage(page);
	}

This is an implementation used in the patch. Disadvantage of this approache is that in case the user selects, say, Profile category, then presses 'Next' (correct set of diagram kinds will be shown), the presses 'Back' and choses another category, then diagram kinds for first chosen category (in our case, Profile) will be shown.

2. Use CheckboxTableViewer in order to display a set of available diagram kinds. In this case the set should be updated every time new input is set. Input should be set in 'setVisible()' method. Disadvange of this approach is limitation in UI - we'll be stuck to this table viewer. However, the task is not standard and this is the best solution I see. I am going to switch SelectDiagramKindWizardPage to this implementation today.
Comment 3 Tatiana Fesenko CLA 2010-05-27 11:16:38 EDT
Created attachment 170201 [details]
Patch using CheckboxTableViewer
Comment 4 Ansgar Radermacher CLA 2010-05-28 05:02:15 EDT
(In reply to comment #3)
> Created an attachment (id=170201) [details]
> Patch using CheckboxTableViewer

A remark a bit of-topic: I don't like the fact that the user currently has to create an initial diagram in order to terminate the wizard. This is annoying, if I do not want to have a top-level diagram but create diagrams in sub-packages.
Comment 5 Ansgar Radermacher CLA 2010-05-28 05:36:54 EDT
(In reply to comment #3)
> Created an attachment (id=170201) [details]
> Patch using CheckboxTableViewer

See critical bug 314834. Option to "create new vs. "from template" may not appear in case of re-creation from semantic model (result: empty model!).
Comment 6 Tatiana Fesenko CLA 2010-05-28 11:44:29 EDT
Created attachment 170369 [details]
Initial patch
Comment 7 Tatiana Fesenko CLA 2010-05-31 08:45:59 EDT
Created attachment 170516 [details]
Initial patch
Comment 8 Remi Schnekenburger CLA 2010-05-31 08:53:54 EDT
(In reply to comment #7)
> Created an attachment (id=170516) [details]
> Initial patch

applied in r1742.

Thanks!
Comment 9 Tatiana Fesenko CLA 2010-05-31 09:20:37 EDT
Created attachment 170522 [details]
Categorize the existing diagrams by languages

Diagrams are categorized into follwoing languages:
UML - Activity, Class, Composite, Sequence, StateMachine, UseCase
Profile - Profile
SysML - BlockDefinition,InternalBlock, Parametric
Comment 10 Remi Schnekenburger CLA 2010-05-31 09:30:03 EDT
(In reply to comment #9)
> Created an attachment (id=170522) [details]
> Categorize the existing diagrams by languages
> 
> Diagrams are categorized into follwoing languages:
> UML - Activity, Class, Composite, Sequence, StateMachine, UseCase
> Profile - Profile
> SysML - BlockDefinition,InternalBlock, Parametric

applied in r1743.
Thanks :)
Comment 11 Tatiana Fesenko CLA 2010-06-02 05:00:38 EDT
Created attachment 170760 [details]
Add diagram categories into NewPapyrusProjectWizard
Comment 12 Remi Schnekenburger CLA 2010-06-02 05:17:55 EDT
(In reply to comment #11)
> Created an attachment (id=170760) [details]
> Add diagram categories into NewPapyrusProjectWizard

Applied in r1772 :)
Comment 13 Tatiana Fesenko CLA 2010-06-04 10:17:00 EDT
Fixed