Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340842 - Openin a user contributed editor in AbstractDrillDownFeature
Summary: Openin a user contributed editor in AbstractDrillDownFeature
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.8.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Indigo M7 theme_round_offs
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-24 07:46 EDT by Ali AKAR CLA
Modified: 2011-06-24 09:14 EDT (History)
2 users (show)

See Also:
michael.wenz: indigo+


Attachments
A patch for the suggested solution (1.49 KB, application/octet-stream)
2011-03-24 07:46 EDT, Ali AKAR CLA
michael.wenz: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ali AKAR CLA 2011-03-24 07:46:55 EDT
Created attachment 191817 [details]
A patch for the suggested solution

At the end of the AbstractDrillDownFeature#execute(ICustomContext), the Graphiti WorkbenchService is asked to open the diagram editor. If we want to open our own contributed editor, we should override the execute method and duplicate the code then just modify the last line to open our editor.

I think that its better to call from the execute an another method like 'openDiagramEditor' to open the diagram editor. So the user can just override this method instead of override the execute one.

Please see the attached patch.
Comment 1 Michael Wenz CLA 2011-03-24 08:06:20 EDT
Good point and thanks for the patch! This should in fact be opened up.

One disadvantage I see with the solution you proposed is that the user of that method will need to delegate to Graphiti internal functionality to open the diagram editor or re-write the opening of the editor by himself.

An alternative I see would be providing an additional method in workbench service that also takes the editor id which is provided by a protected method in AbstractDrillDownFeature were the user can override that id so that his editor will be opened.

What would you think of that solution?

Michae
Comment 2 Ali AKAR CLA 2011-03-24 08:37:10 EDT
It's a good idea !

I think that we can combine both ideas by adding getEditorID and OpenDiagramEditor in AbstractDrillDownFeature. This will cover 2 use cases:

- Users looking to open their contributed editor in the active Workbench Window will just need to override AbstractDrillDownFeature#getEditorID.

- Users looking to open their contributed editor in a new window or not the active one will override the AbstractDrillDownFeature#OpenDiagramEditor
In this case, users will have their own opening behavior already done and will not delegate or use Graphiti internal service.



Ali
Comment 3 Michael Wenz CLA 2011-03-25 09:00:28 EDT
I have just submitted the combination of the two patches to head.

Thanks again for the suggestion and the patch!

Michael
Comment 4 Ali AKAR CLA 2011-03-25 09:59:05 EDT
Great Michael, Thank you too !
Comment 5 Michael Wenz CLA 2011-06-24 09:14:11 EDT
Part of Graphiti Indigo 0.8.0