[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.mdt.uml2] Re: Support for multi-language documentation
|
Hi Francis,
I believe you are looking for UMLUtil.getStereotype() or
UMLUtil.getBaseElement().
Pass in the stereotype application (DynamicEObject) as the parameter.
>From the corresponding UML element, you can navigate to the values and
attributes.
If you are trying to get and set stereotype values, have a look at the
getting started article for profiles from the wiki page.
HTH.
- James.
"Francis" <fgavino@xxxxxxxxx> wrote in message
news:22cb30f9ac7190dd5f47eff920c568c5$1@xxxxxxxxxxxxxxxxxx
> Thank you James and Christian for your inputs. I apologize for indirectly
> asking for an opinion for RSA. I'll just work with the support team about
> it.
> I guess if there's no built-in support in RSx for that, I have to create a
> custom way of doing it (and maybe create a nice properties view editor to
> support it).
> Going back to one of my technical problems, how do I resolve the
> DynamicEObjectImpl class when I try to get the value of the stereotype
> property whose type is a UML Class (and then I also need to get the values
> of the class attributes)? Can someone point me to the right direction?
> Thanks.
>
> /Francis
>
>
> James Bruck wrote:
>
>
>> Hi Francis,
>
>> Unfortunately, the UML2Util.getString(...) with the localize parameter
>> set to true will not always work for RSA.
>
>> RSA uses GMF style pathmaps that map pathmap schema to the exact location
>> of the resource. The UML2Util.getString uses UML2Util.getResourceBundle
>> that expects the pathmap schema to be mapped to a platform schema when
>> the given URI is normalized. This will not work for RSA. RSA uses the
>> MSL layer that is capable of performing the translations. I would
>> recommend using API provided by RSA's MSL layer to obtain reliable
>> translations.
>
>> In fact, looking at the UML2Util.getResourceBundle() it would seem that
>> getting translated strings, for some of the standard stereotypes for
>> example, would not work with a standalone opensource UML application
>> since we would use URI conververter to map pathmap schemas to exact jar
>> locations on the disk.
>
>
>> HTH
>
>> - James.
>
>
>
>
>> "Christian W. Damus" <cdamus@xxxxxxxxxxxxx> wrote in message
>> news:g6se6p$10g$1@xxxxxxxxxxxxxxxxxxxx
>>> Hi, Francis,
>>>
>>> I can't speak for RSA, but the MDT UML2 API provides a
>>> UML2Util::getString(...) API that will retrieve a localized string from
>>> the *.properties file accompanying the Resource that contains the
>>> contextual element passed to the getString(...) operation.
>>>
>>> This is used in the implementation of the NamedElement::getLabel() API
>>> for localized names, but works with any old string key in the
>>> *.properties file. Just be sure to match the *.properties file name
>>> with the file name of your model (without the extension).
>>>
>>> You could, then, simply implement the Eclipse PDE convention of
>>>
>>> %key
>>>
>>> as the text of your documentation field, strip off the % sign, and look
>>> up the key in the *.properties file using getString.
>>>
>>> HTH,
>>>
>>> Christian
>>>
>>>
>>> Francis wrote:
>>>> Hi,
>>>>
>>>> I'm using RSA as my UML tool, and I need to be able to define
>>>> descriptions of some UML elements (E.g., a UML Class) in different
>>>> languages. There's only one documentation property for a given element,
>>>> and to be able to enter the descriptions I have to use delimiters of
>>>> some sort, with the language/locale code as the key. This is not a user
>>>> friendly way and is prone to mistyping the language code. There has to
>>>> be a better way of doing this...
>>>> First thing I tried, is I defined a UML Class in my profile, that
>>>> contains 2 attributes: 1) language code (enumeration), and 2)
>>>> description text. Then I set this as the type for my Stereotype
>>>> property. It works, but the support for this type of structure is not
>>>> nice. Adding a new description using the Properties view is a pain, and
>>>> I have trouble getting the values programmatically because I get a
>>>> DynamicEObjectImpl and I don't know how to get the actual values. :(
>>>> Anyone has a better idea? Will there be built-in support for this in
>>>> the future?
>>>>
>>>> Thanks,
>>>> Francis
>>>>
>
>