Skip to main content



      Home
Home » Modeling » Graphiti » Change DefaultpersistencyBehavior
Change DefaultpersistencyBehavior [message #1266441] Fri, 07 March 2014 08:17 Go to next message
Eclipse UserFriend
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 08:33 Go to previous messageGo to next message
Eclipse UserFriend
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 09:22 Go to previous messageGo to next message
Eclipse UserFriend
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 10:00] by Moderator

Re: Change DefaultpersistencyBehavior [message #1268477 is a reply to message #1266487] Mon, 10 March 2014 10:50 Go to previous messageGo to next message
Eclipse UserFriend
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 16:45 Go to previous messageGo to next message
Eclipse UserFriend
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 03:54 Go to previous message
Eclipse UserFriend
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: Sun Sep 14 17:39:39 EDT 2025

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

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

Back to the top