Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Change DefaultpersistencyBehavior
Change DefaultpersistencyBehavior [message #1266441] Fri, 07 March 2014 13:17 Go to next message
Nickie woo is currently offline Nickie wooFriend
Messages: 21
Registered: February 2014
Junior Member
Hi

I want to load up some resources other than just the diagram resources when it load up
anyone know how to accomplish this ?

Thanks in advance !
Re: Change DefaultpersistencyBehavior [message #1266453 is a reply to message #1266441] Fri, 07 March 2014 13: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
Nikie,

if you have references from your diagram into these other resources, that
should happen automatically as soon as EMF follows such a reference
(triggered e.g. by getting the association).

In case you want to add independent resources you can override
DefaultPersistencyBehavior.loadDiagram and load your resources into the
editor's resource set there.

Michael
Re: Change DefaultpersistencyBehavior [message #1266487 is a reply to message #1266453] Fri, 07 March 2014 14:22 Go to previous messageGo to next message
Nickie woo is currently offline Nickie wooFriend
Messages: 21
Registered: February 2014
Junior Member
Hi
thank you for your answer.
I also found this thread to be very helpful in case someone else is having the same problem

http://www.eclipse.org/forums/index.php/t/441641/

[Updated on: Fri, 07 March 2014 15:00]

Report message to a moderator

Re: Change DefaultpersistencyBehavior [message #1268477 is a reply to message #1266487] Mon, 10 March 2014 14:50 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,

you need to override DiagramEditor, change createDiagramBehavior to create a
custom DiagramBehavior instance, that has a changed
createPersistencyBehavior method that creates your
DiagramPersistencyBehavior. The DiagramEditor subclass must be registered as
an Eclipse editor in plugin.xml.

Sorry, this sounds rather complicated, but we don not have injection in
Eclipse 3, so we need to start in the editor when we exchange default
behaviors...

Michael
Re: Change DefaultpersistencyBehavior [message #1278044 is a reply to message #1268477] Wed, 26 March 2014 20:45 Go to previous messageGo to next message
Anil tanneru is currently offline Anil tanneruFriend
Messages: 21
Registered: March 2014
Junior Member
Hi Mike,

I created the Custom Editor Class, which overrides the createDiagramBehaviour() for customDiagramBehaviour.And then overrided createPersistanceBehaviour in CustomDiagramBehavior Class.And added this to *.ui.editors extension in plugin.xml.

Overrided save()method in CustomPersistanceBehaviour Class.My CustomEditor class not at all getting invoked.
Re: Change DefaultpersistencyBehavior [message #1279078 is a reply to message #1278044] Fri, 28 March 2014 07:54 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Probably you have the extension .diagram for you file? In that case there is
now more than one editor registered for that file and it is not easy to
foresee which editor is opened. Either you do an open with on that file and
choose your editor or provide a custom open editor action or change the file
extension so that your editor is the only one registered for that extension.

Michael
Previous Topic:Check if an object has been already created
Next Topic:CustomEditor not getting invoked in Graphiti *.ui.editors extension
Goto Forum:
  


Current Time: Thu Mar 28 20:22:46 GMT 2024

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

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

Back to the top