Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Synchronized or not, that's a problem
Synchronized or not, that's a problem [message #729100] Sun, 25 September 2011 03:50 Go to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
Hey everybody , now i have two requirments when developing a modeling tool based on gmf
1.i need to realize my own property dialog (not property sheet) where i could set the property of the models by MyOwnCommand extending AbstractTransactionalCommand. In MyOwnCommand i use eSet to set the property of the model~ so in order to show the change in the diagram ,Gen Diagram **DiagramEditPart -->Diagram-->Synchronized should be set to true in the Gen Model...

2.i need to realize a funtion that i could drag an exsiting element from the Project Explor to other diagrams opend in the Editor ..I know this funtion can refer to Copy & Paste and Unsynchronized Diagram.. ie Gen Diagram **DiagramEditPart -->Diagram-->Synchronized should be set to false here..

So it conflicts each other, and i dont know other solution to realize this.. Could anybody be helpful here.. thanks sooooo much:)
Re: Synchronized or not, that's a problem [message #729174 is a reply to message #729100] Sun, 25 September 2011 09:53 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
Is it possible to realize the first function to update the visual diagram through code when the model property is changed ,while Gen Diagram **DiagramEditPart -->Diagram-->Synchronized could be set false?
Re: Synchronized or not, that's a problem [message #729471 is a reply to message #729100] Mon, 26 September 2011 09:29 Go to previous messageGo to next message
Christian Smietana is currently offline Christian Smietana
Messages: 11
Registered: February 2011
Junior Member
This is no contradiction, you can drag and drop objects fro the project explorer to a synchronized diagram. In this case, a "shortcut" is put onto the diagram, i.e. the object gets a little decorator icon which shows that the object is from a different diagram. Look in the gmf FAQ and documentation for "shortcuts" and how to configure them.
Re: Synchronized or not, that's a problem [message #729898 is a reply to message #729471] Tue, 27 September 2011 08:43 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
Hey thank you Christian Smietana so much for your tip. this is exactly what i want in my application.. but now i can only realize this "shortcut" thing by adding an right-click action .. what should i do if i want to drag and drop ?
Re: Synchronized or not, that's a problem [message #729900 is a reply to message #729471] Tue, 27 September 2011 08:49 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
And i have another problem about this.. can i realize this shortcut through different diagrams whose underlying ecore models are different from each other..? or do i have to use shared editdoamin to achieve this?
Re: Synchronized or not, that's a problem [message #734040 is a reply to message #729900] Thu, 06 October 2011 13:35 Go to previous messageGo to next message
Christian Smietana is currently offline Christian Smietana
Messages: 11
Registered: February 2011
Junior Member
To the first question: drag and drop from project explorer should work out of the box if you have configured shortcuts correctly. However, you can drag and drop only an object that is not yet contained in the diagram (but then, you can drag and drop it as many times that you want). This might be the reason why it doesn't work in your case. Or, there is some problem in the configuration, but at the moment I have no idea about it.

To the second question: I think it's possible. But in any case, for shortcuts to work, you need a corresponding configuration for that domain object in the mapping model.
Re: Synchronized or not, that's a problem [message #734176 is a reply to message #729900] Thu, 06 October 2011 23:34 Go to previous messageGo to next message
Michael Golubev is currently offline Michael Golubev
Messages: 373
Registered: July 2009
Senior Member
Cindy wrote on Tue, 27 September 2011 04:49
And i have another problem about this.. can i realize this shortcut through different diagrams whose underlying ecore models are different from each other..? or do i have to use shared editdoamin to achieve this?


Cindy,

You don't need anything specific to allow elements from any DiagramA to be shortcutted at any DiagramB, provided that you have configured getContainsShortcutsTo() and getShortcutsProvidedFor() properly (which you have probably done, based on your comments above).

If it does not work, place representative part of your GMF models here or into new bugzilla.

Regards,
Michael "Borlander" Golubev
Eclipse Committer (GMF, UML2Tools)
at Montages Think Tank, Prague, Czech Republic
Montages AG, Z├╝rich, Switzerland
Re: Synchronized or not, that's a problem [message #734314 is a reply to message #734040] Fri, 07 October 2011 12:45 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
hey i follow this to configure my gen..
http://www.jevon.org/wiki/GMF_Drag_Drop?sid=021e51fe1b1f8bbe8408bcc9eab3894a
actually i can make a shortcut through right-click --> create shortcut.. and select the model element from other files.. it did succeeded.. but i failed when i tried to drag the same element to another diagram.. i dont know where is wrong..

and could you give me some more detail on corresponding configuration for that domain object in the mapping model? thanks a lot:)
Re: Synchronized or not, that's a problem [message #734316 is a reply to message #734176] Fri, 07 October 2011 12:50 Go to previous message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
hey as i replied to Christian Smietana above , i think the configuration of getContainsShortcutsTo() and getShortcutsProvidedFor() is right otherwise i would not scceeded in adding shortcut by right-click -> create shortcut.. but when i tried to drag it from the project explore, there would be a forbidding notation(a circle with a slash in)...
Previous Topic:Second Palette for DiagramEditor
Next Topic:Shared editing domain but not domain instance?
Goto Forum:
  


Current Time: Fri Oct 24 21:40:14 GMT 2014

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

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