Skip to main content



      Home
Home » Modeling » EMF » Disabling EMF notification in a compound command
Disabling EMF notification in a compound command [message #419724] Wed, 04 June 2008 02:07 Go to next message
Eclipse UserFriend
I would like to disable EMF notifications as part of a compound set command. I have a compound command, where I set a member of a list as "selected" (and the previous member unselected)

I would like to turn off the EMF notifications when I set the member "unselected"

For example, I have an abstract command with the construcor:

public SetMemberSelectedCmd(App app, Member member) {
EList<MyList> myList = app.getChain();
for (Member member: myList) {
if (member.getSelected())
append (new SetCommand(domain, member, Package.eINSTANCE.getMember_Selected, new Boolean(false));
}

append (new SetCommand(domain, member, Package.eINSTANCE.getMember_Selected, new Boolean(true));

}
Re: Disabling EMF notification in a compound command [message #419731 is a reply to message #419724] Wed, 04 June 2008 08:04 Go to previous message
Eclipse UserFriend
Charles,

Comments below.

Charles Martin wrote:
> I would like to disable EMF notifications as part of a compound set command. I have a compound command, where I set a member of a list as "selected" (and the previous member unselected)
>
> I would like to turn off the EMF notifications when I set the member "unselected"
>
> For example, I have an abstract command with the construcor:
>
> public SetMemberSelectedCmd(App app, Member member) {
> EList<MyList> myList = app.getChain();
> for (Member member: myList) {
> if (member.getSelected())
> append (new SetCommand(domain, member, Package.eINSTANCE.getMember_Selected, new Boolean(false));
>
Package.Literals.MEMBER_SELECTED would work well. Boolean.FALSE is
better too. You could create an inner class for SetCommand, and
override doExecute, doUndo, and doRedo so that you do
member.eSetDeliver(false)/member.eSetDeliver(true) around the call to
super (probably using a try finally to ensure that it can't get
permanently messed up).
> }
>
> append (new SetCommand(domain, member, Package.eINSTANCE.getMember_Selected, new Boolean(true));
>
> }
>
Previous Topic:Customizing CopyCommand to avoid controlled sub-models
Next Topic:Escaping special chars in eAnnotations via Rose
Goto Forum:
  


Current Time: Sat Jul 05 10:41:46 EDT 2025

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

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

Back to the top