ElementReferenceInTexts Missing

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

ElementReferenceInTexts Missing

Postby nnorwood@mitre.org » Thu Oct 24, 2019 11:07 am

Hello,
I would like to use the the ElementReferenceInTexts class described here https://docs.nomagic.com/display/MD190/Element+Referencing+in+Texts and in the javadocs here http://jdocs.nomagic.com/190/com/nomagic/magicdraw/elementreferenceintext/ElementReferencingInTexts.html. However, the example does not exist in my MagicDraw Installation/openapi/examples directory and my IDE cannot resolve the following import
Code: Select all
import com.nomagic.magicdraw.elementreferenceintext.ElementReferencingInTexts


Does this class exist in a different JAR that you can provide or can you point me to where it might be in my MagicDraw install directory so I can add it to my CLASSPATH?

Thank you,
Nathan
nnorwood@mitre.org
Forum Beginner
Forum Beginner
 
Posts: 45
Posts Rating:3
Joined: Tue Jun 17, 2014 11:19 am

Re: ElementReferenceInTexts Missing

Postby nnorwood@mitre.org » Tue Oct 29, 2019 12:27 pm

So I was able to do this by manually manipulating the HTML string of my text. Not sure if it is the "right" way of doing things but it works for now.

Code: Select all
public static String addReferenceLinkToString(String text, Element refElement){
     String aTag = "<a href=\"mdel://" + refElement.getID() + "\"erit:display=\"CUSTOM_TEXT\" erit:update=\"AUTOMATIC_UPDATE\">";
     String linkedText = aTag + text + "</a>";

     return TextUtils.toFullHtml(linkedText);
}
nnorwood@mitre.org
Forum Beginner
Forum Beginner
 
Posts: 45
Posts Rating:3
Joined: Tue Jun 17, 2014 11:19 am


Return to Programmatic Extendibility

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron