@OpenApiAll
public class HyperlinkUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
HyperlinkUtils.DisplayableHyperlinkText
Value holder for hyperlink text
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HYPERLINK_MODEL_ACTIVE_TAG |
static java.lang.String |
HYPERLINK_MODEL_TAG |
static java.lang.String |
HYPERLINK_OWNER |
static java.lang.String |
HYPERLINK_TEXT_ACTIVE_TAG |
static java.lang.String |
HYPERLINK_TEXT_TAG |
Constructor and Description |
---|
HyperlinkUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addHyperlink(Element element,
Hyperlink hyperlink)
Adds given hyperlink as tagged value to the element.
|
static Hyperlink |
createHyperlink(java.lang.String text,
java.lang.String url)
Creates hyperlink from given string url in the given project.
|
static Hyperlink |
createHyperlink(java.lang.String text,
java.lang.String url,
Project context)
Creates hyperlink from given string url in the given project.
|
static com.nomagic.magicdraw.hyperlinks.ElementHyperlink |
findHyperlinkToElement(Element owner,
Element hyperlinkedElement)
Finds hyperlink to a given element on the given element (owner).
|
static Hyperlink |
getActiveHyperlink(Element element)
Returns active hyperlink of the element
|
static java.util.Collection<Hyperlink> |
getAllHyperlinks(Element element)
Returns hyperlinks of the element.
|
static java.util.Map<Element,Hyperlink> |
getAllHyperlinksToElement(BaseElement targetElement)
Collects information about all hyperlinks pointing to the given target element.
|
static HyperlinkUtils.DisplayableHyperlinkText |
getDisplayableHyperlinkText(Hyperlink hyperlink)
Return information about hyperlink text.
|
static javax.swing.Icon |
getIcon(Hyperlink hyperlink)
Return hyperlink icon
|
(package private) static Slot |
getMainSlot(Element owner) |
static java.lang.String |
getURL(BaseElement element)
Get URL of mdel:// protocol for a given element.
|
static java.lang.String |
getURLWithVersion(BaseElement element)
Get URL of mdel:// protocol for a given element.
|
static boolean |
hasActiveHyperlink(Element element)
Returns active hyperlink of the element
|
static boolean |
hasHyperlink(Element element)
Check if element has hyperlink(s).
|
(package private) static boolean |
hasHyperlinkSlot(InstanceSpecification element) |
static boolean |
isActiveHyperlink(Element element,
Hyperlink hyperlink)
Check given hyperlink is marked as active on the given element
|
static void |
makeActive(Element element,
Hyperlink hyperlink)
Make given hyperlink as active on a given element
|
static void |
removeActive(Element element)
Remove active hyperlink from a given element
|
static void |
removeHyperlink(Element element,
Hyperlink hyperlink)
Remove given hyperlink from the element.
|
public static final java.lang.String HYPERLINK_TEXT_TAG
public static final java.lang.String HYPERLINK_TEXT_ACTIVE_TAG
public static final java.lang.String HYPERLINK_MODEL_TAG
public static final java.lang.String HYPERLINK_MODEL_ACTIVE_TAG
public static final java.lang.String HYPERLINK_OWNER
public static java.lang.String getURL(BaseElement element)
element
- the given elementpublic static java.lang.String getURLWithVersion(BaseElement element)
getURL(BaseElement)
.element
- the given element@Nonnull public static java.util.Collection<Hyperlink> getAllHyperlinks(@Nonnull Element element)
element
- given element@Nonnull public static java.util.Map<Element,Hyperlink> getAllHyperlinksToElement(@Nonnull BaseElement targetElement)
targetElement
- targetElementpublic static void removeActive(@Nonnull Element element)
element
- elementpublic static void makeActive(@Nonnull Element element, @Nonnull Hyperlink hyperlink)
element
- given elementhyperlink
- given hyperlink@Nonnull public static Hyperlink createHyperlink(@CheckForNull java.lang.String text, @CheckForNull java.lang.String url, @CheckForNull Project context)
text
- given texturl
- hyperlink urlcontext
- project as context@Nonnull public static Hyperlink createHyperlink(@CheckForNull java.lang.String text, @CheckForNull java.lang.String url)
text
- given texturl
- hyperlink url@CheckForNull public static Hyperlink getActiveHyperlink(@Nonnull Element element)
element
- given elementpublic static boolean hasActiveHyperlink(@Nonnull Element element)
element
- given elementpublic static boolean hasHyperlink(@Nonnull Element element)
element
- elementpublic static boolean isActiveHyperlink(@Nonnull Element element, @Nonnull Hyperlink hyperlink)
element
- elementhyperlink
- hyperlink@CheckForNull public static com.nomagic.magicdraw.hyperlinks.ElementHyperlink findHyperlinkToElement(@Nonnull Element owner, @Nonnull Element hyperlinkedElement)
owner
- owner of the hyperlinkhyperlinkedElement
- element to which hyperlink is created@CheckForNull public static javax.swing.Icon getIcon(Hyperlink hyperlink)
hyperlink
- hyperlink@Nonnull public static HyperlinkUtils.DisplayableHyperlinkText getDisplayableHyperlinkText(@CheckForNull Hyperlink hyperlink)
hyperlink
- hyperlinkpublic static void removeHyperlink(@Nonnull Element element, @Nonnull Hyperlink hyperlink)
element
- elementhyperlink
- hyperlinkpublic static boolean addHyperlink(@Nonnull Element element, @Nonnull Hyperlink hyperlink)
element
- elementhyperlink
- hyperlink to addstatic boolean hasHyperlinkSlot(@CheckForNull InstanceSpecification element)