Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Loading diagram provider when graphiti editor is to open
Loading diagram provider when graphiti editor is to open [message #625777] Wed, 22 September 2010 10:25 Go to next message
Ashwani Kr Sharma is currently offline Ashwani Kr SharmaFriend
Messages: 119
Registered: July 2009
Location: Bangalore, India
Senior Member

Hi,

I have a use-case where i am opening the graphiti editor on a model file but keeping the diagram file in temp location.
Hence, user can not save his changes across IDE sessions.

Problem:
When i open the file using graphiti editor, i want to create the Diagram in the temp URI and then instantiate DiagramProvider.

How can i hook into open process of default graphiti editor ?

Regards,
Ashwani Kr Sharma
Re: Loading diagram provider when graphiti editor is to open [message #625890 is a reply to message #625777] Wed, 22 September 2010 10:33 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hi Ashwani,

you could do this in several ways, e.g. by implementing your own
DiagramEditorInput object (subclassing that class) that does the file
handling in the temp directory. Another way would be subclassing
DiagramEditor and overriding the init method (or any other method used
during initialization).

Regards,
Michael


"Ashwani Kr Sharma" <ashw.kumar@gmail.com> wrote in message
news:i7cldf$8l3$1@news.eclipse.org...
> Hi,
>
> I have a use-case where i am opening the graphiti editor on a model file
> but keeping the diagram file in temp location.
> Hence, user can not save his changes across IDE sessions.
>
> Problem: When i open the file using graphiti editor, i want to create the
> Diagram in the temp URI and then instantiate DiagramProvider.
>
> How can i hook into open process of default graphiti editor ?
>
> Regards,
> Ashwani Kr Sharma
Re: Loading diagram provider when graphiti editor is to open [message #625913 is a reply to message #625890] Wed, 22 September 2010 10:53 Go to previous messageGo to next message
Ashwani Kr Sharma is currently offline Ashwani Kr SharmaFriend
Messages: 119
Registered: July 2009
Location: Bangalore, India
Senior Member

Thanks Michael.

The approach of overriding DiagramEditor is understood.
About the other approach of creating my own input. In that case where will I set the input to the editor ?
I think for that i will need to create an action where i do it, or still override DiagramEditor and replace the input from FileEditorInput to mine in the init() method.

Regards,
Ashwani Kr Sharma

[Updated on: Wed, 22 September 2010 11:03]

Report message to a moderator

Re: Loading diagram provider when graphiti editor is to open [message #626137 is a reply to message #625913] Wed, 22 September 2010 11:26 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Right. You would create your editor input object and pass it to the
DiagramEditor. This could e.g. be done in an action that can be triggered
from a project explorer. In that case no overriding of the editor should be
necessary.

Regards,
Michael


"Ashwani Kr Sharma" <ashw.kumar@gmail.com> wrote in message
news:i7cn1v$bjl$1@news.eclipse.org...
> Thanks Michael.
>
> The approach of overriding DiagramEditor is understood.
> About the other approach of creating my own input. I that case where will
> set the input to the editor ?
> I think in that i will need to create an action where i do it, or still
> override DiagramEditor and replace the input from FileEditorInput to mine
> in the init() method.
>
> Regards,
> Ashwani Kr Sharma
Previous Topic:Put one shape above another using dnd
Next Topic:Rendering decorators for connections
Goto Forum:
  


Current Time: Thu Apr 25 21:36:42 GMT 2024

Powered by FUDForum. Page generated in 0.03248 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top