Bug 325618 - [Palette] Papyrus shall enable to use detached palette
Summary: [Palette] Papyrus shall enable to use detached palette
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.10.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.0.0   Edit
Assignee: Cedric Dumoulin CLA
QA Contact:
URL:
Whiteboard: Usability
Keywords: plan, usability
Depends on:
Blocks:
 
Reported: 2010-09-17 12:12 EDT by Cedric Dumoulin CLA
Modified: 2014-07-22 10:15 EDT (History)
0 users

See Also:
rschnekenburger: indigo-
rschnekenburger: juno+
cedric.dumoulin: luna+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Dumoulin CLA 2010-09-17 12:12:59 EDT
When a palette is detached from its diagram, and then the current diagram is switched, the detached palette doesn't switch (to the palette of the newly selected diagram).

Some comments:
The palette can be view in a viewer.
The viewer switch the palette when the main editor switch. It doesn't switch when sashpage switch.
It need to switch when sashpage switch.

How it works:
- The Viewer ask the current editor for a getAdapter(PalettePage.class)

- GMF implements the adapter in org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.
- The provided adapter is  org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.CustomPalettePage

- The Viewer implementation is: org.eclipse.gef.ui.views.palette.PaletteView
- It maintain 1 PageRec for each part.
- It is not refreshed if the part is not changed
- There is no callable method allowing refresh of the page

- Initialization trace :
Thread [main] (Suspended (breakpoint at line 376 in DiagramEditorWithFlyOutPalette))	
	UmlClassDiagramForMultiEditor(DiagramEditorWithFlyOutPalette).getAdapter(Class) line: 376	
	UmlClassDiagramForMultiEditor(DiagramDocumentEditor).getAdapter(Class) line: 116	
	UmlClassDiagramForMultiEditor(UMLDiagramEditor).getAdapter(Class) line: 182	
	Util.getAdapter(Object, Class) line: 110	
	PapyrusMultiDiagramEditor(AbstractMultiPageSashEditor).getAdapter(Class) line: 198	
	PapyrusMultiDiagramEditor(CoreMultiDiagramEditor).getAdapter(Class) line: 414	
	PaletteView.doCreatePage(IWorkbenchPart) line: 96	
	PaletteView(PageBookView).createPage(IWorkbenchPart) line: 410	
	PaletteView(PageBookView).partActivated(IWorkbenchPart) line: 767	
	PaletteView(PageBookView).showBootstrapPart() line: 936	
	PaletteView(PageBookView).createPartControl(Composite) line: 507	
	PaletteView.createPartControl(Composite) line: 78	

Solution 1:
Modify PaletteViewer in order to let it accept pages coming from sub-editors
Hard to do !


Solution 2:
Provide a detached palette in the main editor, and let it listen to sashWindow event. When the current subeditor change, let it change the detached palette. 
The detached palette can use a PageBookView.

Solution 3
Subclass PaletteViewer in order to let it use nested parts when it is a MultiEditor, and listen to switch events from the main sashEditor.
Comment 1 Remi Schnekenburger CLA 2012-02-13 09:59:14 EST
posponed to version 0.9
Comment 2 Camille Letavernier CLA 2014-07-22 10:15:16 EDT
This has been implemented recently

I close the task