|Re: class type in palette [message #1697206 is a reply to message #1697040]
||Tue, 02 June 2015 12:54
|| Christian Damus
Registered: July 2009
Everything is possible with code! :-)
But, to be more precise, yes, you can contribute any number of 'advice'
particles to an element-type to configure new instances with as complex
a structure as you need.
By "instances", do you mean specifically "instance specifications" as
modeled in UML? If so, I would suggest that the classes for which they
model instances should rather be in a library model than in a profile.
The classes in a profile are really only intended to be used as types
for the attributes of stereotypes, as complex extensions of the UML
metamodel. Putting model elements in a profile that should be
referenced by instance specifications or anything else in a normal
"user model" would be mixing meta-levels in a confusing way.
On 2015-06-01 07:19:59 +0000, Markus Schuss said:
> Thanks for the help, I'll try that. One more question though to make
> sure we are on the same page ^^.
> Will it be possible to create a property with all the ports in place or
> is this not possible? (basically I want to define the classes and their
> ports in a profile or similar and only create instances of those
> Also could you provide a link to the help (I'm new to this, sorry)
> Thanks in advance,
|Re: class type in palette [message #1697789 is a reply to message #1697331]
||Mon, 08 June 2015 13:33
|| Christian Damus
Registered: July 2009
First, I should comment that you could hardly be misusing UML: the UML
is intentionally designed to be useful for every conceivable purpose.
(I may just be kidding)
Library models are probably best used as repositories for
domain-specific concepts that need to be referenced by the users'
models. For example, they might contain classes that are intended as
the types of properties of the user's own classes or as generals of the
user's classes. (libraries can contain anything else than classes, of
course; this is just an obvious example)
To register a library model for use in the import dialog, just add an
extension on the org.eclipse.papyrus.uml.extensionpoints.UMLLibrary
point. It's very like registering a profile, which I think you have
As far as the palette is concerned, yes it is naturally going to be a
good deal more complex than what you can do with the palette
customization tools provided out-of-the-box by Papyrus. You have used
post-actions to apply stereotypes to new model elements. The GMF
Run-time's "Element Types" framework implements a generalization of the
concept of the post-action, called "advice" on the
CreateElementRequest, that lets you attach arbitrary code to the
creation of a new element. Open the AbstractEditHelperAdvice class in
the JDT's Hierarchy view to see several examples in Papyrus of these
kinds of advices. Some of them I am sure will advise the creation of
new elements and hopefully provide a guide for your situation.
On 2015-06-03 08:30:24 +0000, Markus Schuss said:
> Thanks again for your help. I think I somewhat start to understand how
> to implement what I need. But to clarify me problem a bit: I am
> basically misusing papyrus to create a UI for a program of mine. Simply
> put I wrote something very similar to Matlab Simulink. While I do
> depend on some annotations like MARTE mostly I just needed a tool that
> would allow me to create a representation of my system. I am basically
> misusing UML right now to achieve this by having a separate library
> (just a model with all the classes that I can simulate in it) that I
> import into my model and then add them as properties to a "top" class
> (which serves to have some element which when parsing the uml als xml
> gives me the full structure of the system including connectors.).
> Currently for the sake of "ease of use" I wanted to just use the import
> ->registered package (which I would also welcome some pointers how to
> do that) to add the library to the project and then (I only ever seen
> this by using the add profile) add a selection of predefined models
> (the classes from the library) to the palette.
> Sadly I am at this point completely lost on how to even begin
> developing something like this. I have previously added my own classes
> with predefined annotations (using postactions) to the palette via
> plugin but never anything that actually contained "code". If you have a
> link to the online help I would greatly appreciate it (so far I found
> the wiki and the documentation in the git, but nothing... structured)
> Once again Thanks in advance for any help
Powered by FUDForum
. Page generated in 0.02173 seconds