Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Creating a Usage programmatically
Creating a Usage programmatically [message #471979] Wed, 28 March 2007 16:22 Go to next message
Eclipse UserFriend
Originally posted by: jlemmett.cc.hut.fi

Hi,

I can easily create an InterfaceRealization between a component and an
interface by

component.createInterfaceRealization(name, contract);

but I can't seem to figure out how to create a Usage between a component
and an interface. Any help would be appreciated

Janne
Re: Creating a Usage programmatically [message #471981 is a reply to message #471979] Wed, 28 March 2007 17:30 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Janne,

This is your lucky day...

A fix was committed for this the other day. See this bug for details on
how to create such a thing...
https://bugs.eclipse.org/bugs/show_bug.cgi?id=173726

The fix should be part of the official API starting in the build after
tomorrow.
This is your workaround..

Usage usage = (Usage) package_.createPackagedElement(
null, UMLPackage.Literals.USAGE);

usage.getClients().add(namedElement);
usage.getSuppliers().add(supplier);



Regards,

- James.

"Janne Lemmetti" <jlemmett@cc.hut.fi> wrote in message
news:eue4oi$sud$1@build.eclipse.org...
> Hi,
>
> I can easily create an InterfaceRealization between a component and an
> interface by
>
> component.createInterfaceRealization(name, contract);
>
> but I can't seem to figure out how to create a Usage between a component
> and an interface. Any help would be appreciated
>
> Janne
Re: Creating a Usage programmatically [message #604108 is a reply to message #471979] Wed, 28 March 2007 17:30 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Janne,

This is your lucky day...

A fix was committed for this the other day. See this bug for details on
how to create such a thing...
https://bugs.eclipse.org/bugs/show_bug.cgi?id=173726

The fix should be part of the official API starting in the build after
tomorrow.
This is your workaround..

Usage usage = (Usage) package_.createPackagedElement(
null, UMLPackage.Literals.USAGE);

usage.getClients().add(namedElement);
usage.getSuppliers().add(supplier);



Regards,

- James.

"Janne Lemmetti" <jlemmett@cc.hut.fi> wrote in message
news:eue4oi$sud$1@build.eclipse.org...
> Hi,
>
> I can easily create an InterfaceRealization between a component and an
> interface by
>
> component.createInterfaceRealization(name, contract);
>
> but I can't seem to figure out how to create a Usage between a component
> and an interface. Any help would be appreciated
>
> Janne
Previous Topic:WrappedException: feature eGenericType not found while loading model
Next Topic:declaring and using a template class
Goto Forum:
  


Current Time: Thu Apr 18 15:03:44 GMT 2024

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

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

Back to the top