Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Query With Documentprovider extending StorageDocumentprovider
Query With Documentprovider extending StorageDocumentprovider [message #224343] Sat, 04 April 2009 11:24 Go to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hello All..

In my gmf project any changes to model file is not enabling save option.

I had my old project where the my XXXDocumentProvider was extending
StorageDocumentProvider.

And changes made to model file using Impl.SetXX Methods was enabling save
button.

But upgradation of eclipse and gmf version save button is not enabling the
save button..

And now my XXXDocumentProvider is extending AbstractDocumentProvider.

Please help me...Or is any way to make editor dirty on a operation.

Regards
Govind R
Re: Query With Documentprovider extending StorageDocumentprovider [message #224400 is a reply to message #224343] Mon, 06 April 2009 11:02 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

inner class XXXDocumentProvider.ResourceSetModificationListener is responsible
for marking and editor dirty on any modifications. The precondition is: "setTrackingModification(true)"
mode should be correctly supported by al the resources used by this diagram
editor. You can try debugging this class to see why diagram editor was not
marked as dirty.

-----------------
Alex Shatalin
Re: Query With Documentprovider extending StorageDocumentprovider [message #224892 is a reply to message #224400] Wed, 08 April 2009 11:57 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex,

i found that both my diagram and model file are resource which are coming
in notifyChanged of createEditingDomain() method
ie.setTrackingModification(true) is true.

But what i found was when i set the first value using Impl.setMethod say
setName() is notifyChanged(Notification notification) of
ResourceSetModificationListener is called and its shows
nextResource.isModified() is true.

and when i call again one Impl.setMethod say setAddress. at that time
nextResource.isModified() is false. i am setting the both name and address
in okPressed of Dailog.




The same code is working i n my old gmf version.

Please help as i dont want to revert back t my old version.

Regards
Govind R
Re: Query With Documentprovider extending StorageDocumentprovider [message #224915 is a reply to message #224892] Wed, 08 April 2009 12:14 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

Try determining the reason of setting back "isModified" property to false...
It looks strange - i doubt there is an error in this place in EMF...

-----------------
Alex Shatalin
Re: Query With Documentprovider extending StorageDocumentprovider [message #225000 is a reply to message #224915] Wed, 08 April 2009 15:16 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex

EMF is wrong means is that my e-core model is wrong?
One More thing when i am setting other attribute say address ie. setAddress

I need to put that in try-catch block as after setName nothing gets
executes.why is i need to put in try-catch

Regards
Govind
Re: Query With Documentprovider extending StorageDocumentprovider [message #225015 is a reply to message #225000] Wed, 08 April 2009 16:19 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

Is tehre any excaptions thrown?

-----------------
Alex Shatalin
Re: Query With Documentprovider extending StorageDocumentprovider [message #225023 is a reply to message #225015] Wed, 08 April 2009 18:16 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex.


Ya get IllegalStateException:Cannot modify write transaction exception.

But this used to come in my old version but editor was dirty.

What exactly happens when we call setMethod .ie.. its sets new value to
attribute and nofify is called. but nothing excecutes after this.


Regards
Govind R
Re: Query With Documentprovider extending StorageDocumentprovider [message #225133 is a reply to message #225023] Thu, 09 April 2009 11:15 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

> Ya get IllegalStateException:Cannot modify write transaction
> exception.
You have to use transation. Try subclassing AbstractTransactionalCommand
+ execute it using IOperationHistory.execute().

> But this used to come in my old version but editor was dirty.
This is strange - transactions should be used to modify model in GMF.

-----------------
Alex Shatalin
Previous Topic:Howto add multiplicities on a relation
Next Topic:How to run the example made by GMF editor as a independent program?
Goto Forum:
  


Current Time: Fri Apr 26 07:23:47 GMT 2024

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

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

Back to the top