|
Re: class type in palette [message #1696590 is a reply to message #1696480] |
Wed, 27 May 2015 11:54 |
|
Hi, Markus,
What do you mean by adding your models and classes to the palette? The
palette provides tools that create new elements of various kinds. It
doesn't hold actual model content.
Are you looking for a "template" capability to simplify repeated
creation of more complex structures, as tools like OmniGraffle and
Visio have? That can be accomplished with the palette customization
framework described in the on-line help. It would boil down defining
GMF element-types that represent your "template" patterns with
edit-helpers that build instances of them. (I use "template" in scare
quotes to distinguish the generic concept from specific UML Template
construct)
HTH,
Christian
On 2015-05-26 15:37:13 +0000, Markus Schuss said:
> Hi,
>
> basically instead of drawing my models/classes from the model explorer
> I want to create a plugin that adds them to the palette.
> I am using eclipse mars and have model synchronization enabled via css
> therefore when I pull in a class from the model explorer I get either a
> class or a property with all the ports displayed.
> Is it even possible to achieve this using the palette and if so is
> there some documentation for this?
>
> Thanks in advance,
> Markus
|
|
|
|
Re: class type in palette [message #1697206 is a reply to message #1697040] |
Tue, 02 June 2015 12:54 |
|
Hi, Markus,
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.
Cheers,
Christian
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
> classes)
>
> Also could you provide a link to the help (I'm new to this, sorry)
>
> Thanks in advance,
> Markus
|
|
|
|
Re: class type in palette [message #1697789 is a reply to message #1697331] |
Mon, 08 June 2015 13:33 |
|
Hi, Markus,
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
already done.
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.
HTH,
Christian
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
> Markus
|
|
|
Powered by
FUDForum. Page generated in 0.04424 seconds