ChangeCommand problem... [message #597602] |
Fri, 10 April 2009 12:13 |
Sorin Fagateanu![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=cyron_16%40yahoo.com) Messages: 46 Registered: July 2009 |
Member |
|
|
Hello all,
I have another problem.
I have a in the eclipse's Project Explorer a model file,that when I expand
it I can see in the tree packages ,clases,operations,attributes
etc...,this being done with the emf generation.
#1 comm
I have made myself a command for renaming a Package and it look something
like:
EditingDomain editingDomain = AdapterFactoryEditingDomain.
getEditingDomainFor(package);
CompoundCommand command = new CompoundCommand();
command.append(SetCommand.create(editingDomain, package
,UMLPackage.eINSTANCE.getNamedElement_Name(), newName));
editingDomain.getCommandStack().execute(command);
After calling this it automaticaly updates the name in the tree.
#2 comm
I have made another command for adding a steretype and setting a value
and it looks like:
Runnable runnable = new Runnable() {
public void run() {
package.applyStereotype(MyStereotype);
package.setValue(MyStereotype, myInt, 5);
}
};
EditingDomain editingDomain = AdapterFactoryEditingDomain.
getEditingDomainFor(package);
CompoundCommand command = new CompoundCommand();
command.append(new ChangeCommand(editingDomain, runnable));
editingDomain.getCommandStack().execute(command);
However, when I call this comand, in the tree ,the package's label isn't
updated like I would have expected (something like : <<MyStereotipe>>
PackageName )
At the next rename it updates the label in the tree to show also the
"<<MyStereotype>>".
My problems are the following :
1. the label of package isnt't updated when applying the second command.
I have observed the in the case of renaming ,when it enter's the "set"
method it also triggers the "notify" which iterates thru all the adapters
including the PackageImplAdatpter which calls my content/label provider.
And i have observed that in the case of applying stereotype, in the
notify,it doesn't have a PackageImplAdapter,which it means that no changes
are done.
2.in case of the second command,I cant undo the command.I would have
expected in the Edit menu to appear something like Undo "#2 comm".
If someone has got any ideas I would be very grateful.
Thank you in advance!
|
|
|
Powered by
FUDForum. Page generated in 0.02887 seconds