Extending UML2Tools diagram editor user interface [message #474560] |
Sat, 05 July 2008 16:47 |
Eclipse User |
|
|
|
Originally posted by: marian-misc.rainer-harbach.eu
Hello!
For a specific task I need the ability to quickly and easily toggle the
isUnique property of an association in the UML2Tools diagram editor.
As far as I know this is not possible at the moment and needs to be done
in the UML2 model editor.
Because of this I would like to extend the diagram editor's user interface
for this specific task.
I would be glad if anybody had some hints regarding this (for example
where to look in the source code).
Thanks,
Marian
|
|
|
|
Re: Extending UML2Tools diagram editor user interface [message #474682 is a reply to message #474566] |
Sun, 13 July 2008 19:48 |
Eclipse User |
|
|
|
Originally posted by: marian-misc.rainer-harbach.eu
Hello!
Thanks for your reply!
I checked out the ...clazz.action package from CVS. If I understand you
correctly your suggestion is to use the ChangeAssociationKind class as a
"template" to implement a new action for the context menu, is that correct?
Unfortunately I am unfamiliar yet with Eclipse plugin development. How can
I run my code? When I try to run plugin.xml as an Eclipse application I
get a launch error "BundleContext is no longer valid". I would be glad if
you could point me to a good tutorial regarding plugin development.
Thanks,
Marian
|
|
|
|
Re: Extending UML2Tools diagram editor user interface [message #475290 is a reply to message #474689] |
Mon, 11 August 2008 19:41 |
Eclipse User |
|
|
|
Originally posted by: marian-misc.rainer-harbach.eu
Hello!
Thanks for your help, I managed to add new entries to the context menu. I
am now having problems implementing the new command. As you suggested, I
took changing association kind as a template. As far as I understand, the
action itself is implemented in ChangeAssociationKind and
ChangeAssociationKindCommand, is this correct? I adapted them to create
new classes ChangeAssociationUniqueness/..Command, but all entries in my
new context menu group are greyed out. Is there any documentation
available on how creating Commands is supposed to work?
Thanks,
Marian
|
|
|
Re: Extending UML2Tools diagram editor user interface [message #475292 is a reply to message #475290] |
Thu, 14 August 2008 07:59 |
Tatiana Fesenko Messages: 530 Registered: July 2009 |
Senior Member |
|
|
Hello Marian,
Unfortunately, I don't know if any documentation on CreateCommand or SetValueCommand
exists.
However, I tried to create simple action to set to isUnique property 'true'
value:
protected Command getCommand() {
Association association = getAssociation();
if (association == null) {
return UnexecutableCommand.INSTANCE;
}
return new ICommandProxy(new SetValueCommand(new SetRequest(AssociationEndConvention.getSourceEnd(association ),
UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique(), true)));
}
It works fine.
There is no common advice for the case, if I were you at the same situation
I would have debugged the code in YourAction#getCommand() and SetValueCommand.
I hope it will help.
Best regards,
Tanya.
> Hello!
> Thanks for your help, I managed to add new entries to the context
> menu. I
> am now having problems implementing the new command. As you suggested,
> I
> took changing association kind as a template. As far as I understand,
> the
> action itself is implemented in ChangeAssociationKind and
> ChangeAssociationKindCommand, is this correct? I adapted them to
> create
> new classes ChangeAssociationUniqueness/..Command, but all entries in
> my
> new context menu group are greyed out. Is there any documentation
> available on how creating Commands is supposed to work?
> Thanks,
> Marian
|
|
|
|
|
Re: Extending UML2Tools diagram editor user interface [message #621258 is a reply to message #474566] |
Sun, 13 July 2008 19:48 |
Eclipse User |
|
|
|
Originally posted by: marian-misc.rainer-harbach.eu
Hello!
Thanks for your reply!
I checked out the ...clazz.action package from CVS. If I understand you
correctly your suggestion is to use the ChangeAssociationKind class as a
"template" to implement a new action for the context menu, is that correct?
Unfortunately I am unfamiliar yet with Eclipse plugin development. How can
I run my code? When I try to run plugin.xml as an Eclipse application I
get a launch error "BundleContext is no longer valid". I would be glad if
you could point me to a good tutorial regarding plugin development.
Thanks,
Marian
|
|
|
|
Re: Extending UML2Tools diagram editor user interface [message #622602 is a reply to message #474689] |
Mon, 11 August 2008 19:41 |
Eclipse User |
|
|
|
Originally posted by: marian-misc.rainer-harbach.eu
Hello!
Thanks for your help, I managed to add new entries to the context menu. I
am now having problems implementing the new command. As you suggested, I
took changing association kind as a template. As far as I understand, the
action itself is implemented in ChangeAssociationKind and
ChangeAssociationKindCommand, is this correct? I adapted them to create
new classes ChangeAssociationUniqueness/..Command, but all entries in my
new context menu group are greyed out. Is there any documentation
available on how creating Commands is supposed to work?
Thanks,
Marian
|
|
|
Re: Extending UML2Tools diagram editor user interface [message #622604 is a reply to message #475290] |
Thu, 14 August 2008 07:59 |
Tatiana Fesenko Messages: 530 Registered: July 2009 |
Senior Member |
|
|
Hello Marian,
Unfortunately, I don't know if any documentation on CreateCommand or SetValueCommand
exists.
However, I tried to create simple action to set to isUnique property 'true'
value:
protected Command getCommand() {
Association association = getAssociation();
if (association == null) {
return UnexecutableCommand.INSTANCE;
}
return new ICommandProxy(new SetValueCommand(new SetRequest(AssociationEndConvention.getSourceEnd(association ),
UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique(), true)));
}
It works fine.
There is no common advice for the case, if I were you at the same situation
I would have debugged the code in YourAction#getCommand() and SetValueCommand.
I hope it will help.
Best regards,
Tanya.
> Hello!
> Thanks for your help, I managed to add new entries to the context
> menu. I
> am now having problems implementing the new command. As you suggested,
> I
> took changing association kind as a template. As far as I understand,
> the
> action itself is implemented in ChangeAssociationKind and
> ChangeAssociationKindCommand, is this correct? I adapted them to
> create
> new classes ChangeAssociationUniqueness/..Command, but all entries in
> my
> new context menu group are greyed out. Is there any documentation
> available on how creating Commands is supposed to work?
> Thanks,
> Marian
|
|
|
|
Powered by
FUDForum. Page generated in 0.06348 seconds