Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » CopyToClipboardCommand makes editor dirty(Using the EMF CopyAction in a tree and the WorkspaceCommandStack makes the editor dirty)
CopyToClipboardCommand makes editor dirty [message #1814570] Fri, 13 September 2019 11:33 Go to next message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 53
Registered: February 2014
Member
Hi,

we are using TransactionalEditingDomain with a WorkspaceCommandStack.
org.eclipse.emf.edit.ui.action.CopyAction (or the used CopyCommand) makes the editor dirty.

In the editor a CommandStackListener is registered. When an event is raised, it tells the editor to check it's dirty property. The editor then calls WorkspaceCommandStack.isSaveNeeded(). Which always returns true, even for a copy command which does not change the editor's content.
In comparison the BasicCommandStack.isSaveNeeded() method asks the command whether it has changed the model.

Are we using some of the above objects in a wrong way or do we just have to create our own CopyAction, which is not added to the CommandStack. I find it weird anyway that a Copy action can be undone.

Thanks, Marcus
Re: CopyToClipboardCommand makes editor dirty [message #1814654 is a reply to message #1814570] Mon, 16 September 2019 07:16 Go to previous messageGo to next message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 53
Registered: February 2014
Member
It seems that it was fixed in the BasicCommandStack.isSaveNeeded().

It was a bug in the generated editor as well, then it was discussed here: https://www.eclipse.org/forums/index.php/t/124173/.
And it seems that afterwards the marker interface AbstractCommand.NonDirtying was introduced and used in isSaveNeeded().

Is there something missing in WorkspaceCommandStack? Shall I open a bug?
Re: CopyToClipboardCommand makes editor dirty [message #1814667 is a reply to message #1814654] Mon, 16 September 2019 08:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30685
Registered: July 2009
Senior Member
I was using the transactional framework at a customer earlier this year and I don't recall seeing such a problem. But perhaps they specialized it to avoid the problem. I wonder though if you are using the latest version. If so, yes, open a Bugzilla.
Re: CopyToClipboardCommand makes editor dirty [message #1814753 is a reply to message #1814667] Tue, 17 September 2019 12:25 Go to previous message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 53
Registered: February 2014
Member
I'm on the latest. I filed this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=551164
Previous Topic:Help Embedding EMF in a Java Based Project in Eclipse
Next Topic: How Can I apply xsd:choice element to my emf model editor.
Goto Forum:
  


Current Time: Sat Dec 07 03:57:03 GMT 2019

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

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

Back to the top