Help with CreateChildCommand [message #922784] |
Tue, 25 September 2012 10:30 |
John M. Messages: 198 Registered: July 2010 |
Senior Member |
|
|
Hello,
I have an own action for create a children with a dialog and it works when I use the AddCommand, but I want to use the CreateChildCommand.
But it seems, that I make a mistake or something like that.
I have tried to analyze it with the debugger, but I don't get it.
The following code works:
AddCommand.create(editingDomain, ((StructuredSelection) selection).getFirstElement(), descriptor, l);
l is a collection which contains the created object.
This doesn't work:
CreateChildCommand.create(editingDomain, ((StructuredSelection) selection).getFirstElement(), descriptor, l);
Both commands are executable, but the second one only marks the editor as dirty.
I have tried to create a new descriptor with an instance of CommandParameter using nearly all parameters from the given one expect the value.
Where is my mistake?
Thanks for any advices.
|
|
|
Re: Help with CreateChildCommand [message #922887 is a reply to message #922784] |
Tue, 25 September 2012 12:30 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
John,
Comments below.
On 25/09/2012 12:30 PM, John M. wrote:
> Hello,
>
> I have an own action for create a children with a dialog and it works
> when I use the AddCommand, but I want to use the CreateChildCommand.
> But it seems, that I make a mistake or something like that.
> I have tried to analyze it with the debugger, but I don't get it.
>
> The following code works:
> AddCommand.create(editingDomain, ((StructuredSelection)
> selection).getFirstElement(), descriptor, l);
> l is a collection which contains the created object.
What is descriptor?
>
> This doesn't work:
> CreateChildCommand.create(editingDomain, ((StructuredSelection)
> selection).getFirstElement(), descriptor, l);
I can't imagine that both should work the same. If the first works, the
arguments can't possibly be right for this one.
>
> Both commands are executable, but the second one only marks the editor
> as dirty.
> I have tried to create a new descriptor with an instance of
> CommandParameter using nearly all parameters from the given one expect
> the value.
>
> Where is my mistake?
I can't guess from snippets like this.
>
> Thanks for any advices.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03068 seconds