Community
Participate
Working Groups
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.
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
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.
Created attachment 170201 [details] Patch using CheckboxTableViewer
(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.
(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!).
Created attachment 170369 [details] Initial patch
Created attachment 170516 [details] Initial patch
(In reply to comment #7) > Created an attachment (id=170516) [details] > Initial patch applied in r1742. Thanks!
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
(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 :)
Created attachment 170760 [details] Add diagram categories into NewPapyrusProjectWizard
(In reply to comment #11) > Created an attachment (id=170760) [details] > Add diagram categories into NewPapyrusProjectWizard Applied in r1772 :)
Fixed