Class NodePresentationUtil
- java.lang.Object
 - 
- jetbrains.mps.smodel.presentation.NodePresentationUtil
 
 
- 
public class NodePresentationUtil extends Object
This class provides utility methods for default presentation logic for referenced nodes. Here is some implementation notes how presentation text is calculated: 1) default presentation: - custom text by overriding BC#getPresentation() or ISmartReferent#getPresentation(context) - name from INamedConcept - special presentation for smart. refs. TODO should be removed - concept alias 2) matching text: - custom text by overriding ISmartReferent#getMatchingText(context) - resolveInfo from IResolveInfo TODO IResolveInfo now uses mostly to separate matchingText and visibleMatchingText - default presentation 3) visible matching text: - custom text by overriding ISmartReferent#getVisibleMatchingText(context) - default presentation 4) description text: - custom text by overriding ISmartReferent#getDescriptionText(context) - {conceptName} ( {where} ) These facilities should be used only in editor-runtime for specifying the textual presentation of referenced node in completion, etc. Other subsystems should not rely on it and useSNode.getPresentation()orSNode.getName()instead. TODO Should be moved to editor-runtime? 
- 
- 
Constructor Summary
Constructors Constructor Description NodePresentationUtil() 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static StringdescriptionText(SAbstractConcept concept)static StringdescriptionText(SAbstractConcept concept, boolean referentPresentation)Deprecated.usedescriptionText(SAbstractConcept)insteadstatic StringdescriptionText(SNode node)static StringdescriptionText(SNode node, boolean referent_presentation)Deprecated.usedescriptionText(SNode)instead.static StringdescriptionText(SNode node, SNode context)static StringgetAliasOrConceptName(SNode node)static intgetFontStyle(SNode referenceNode, SNode referentNode)static StringgetPathToRoot(SNode node)static StringgetRoleInParentOrConceptName(SNode node)static intgetSortPriority(SNode referenceNode, SNode referentNode)static booleanisLocalTo(SNode referenceNode, SNode referentNode)static StringmatchingText(SAbstractConcept concept)static StringmatchingText(SAbstractConcept concept, boolean referentPresentation)Deprecated.usematchingText(SAbstractConcept)instead.static StringmatchingText(SNode node)Deprecated.This method provides a visible matching text instead of real matching text, that might be confusing.static StringmatchingText(SNode node, boolean referent_presentation)Deprecated.This method provides a visible matching text instead of real matching text, that might be confusing.static StringmatchingText(SNode node, boolean referent_presentation, boolean visible)static StringmatchingText(SNode node, SNode context)Provides a text that will be matched with user-typed pattern in completion menu.static StringmatchingText(SNode node, SNode context, boolean visible)It's preferred to usematchingText(SNode, SNode)orvisibleMatchingText(SNode, SNode)instead.static Stringpresentation(SNode node, SNode context)Provides a text that should be shown in editor to present a referenced node.static StringvisibleMatchingText(SNode node, SNode context)Provides a text that presents given node in completion menu. 
 - 
 
- 
- 
Method Detail
- 
presentation
public static String presentation(@NotNull SNode node, @Nullable SNode context)
Provides a text that should be shown in editor to present a referenced node. 
- 
matchingText
public static String matchingText(SAbstractConcept concept)
 
- 
matchingText
@Deprecated public static String matchingText(SAbstractConcept concept, boolean referentPresentation)
Deprecated.usematchingText(SAbstractConcept)instead. 
- 
matchingText
@Deprecated public static String matchingText(SNode node)
Deprecated.This method provides a visible matching text instead of real matching text, that might be confusing. Should be replaced withvisibleMatchingText(SNode, SNode). 
- 
matchingText
@Deprecated public static String matchingText(SNode node, boolean referent_presentation)
Deprecated.This method provides a visible matching text instead of real matching text, that might be confusing. Should be replaced withvisibleMatchingText(SNode, SNode). 
- 
matchingText
@Deprecated public static String matchingText(SNode node, boolean referent_presentation, boolean visible)
 
- 
matchingText
public static String matchingText(@NotNull SNode node, @Nullable SNode context)
Provides a text that will be matched with user-typed pattern in completion menu. 
- 
matchingText
public static String matchingText(@NotNull SNode node, @Nullable SNode context, boolean visible)
It's preferred to usematchingText(SNode, SNode)orvisibleMatchingText(SNode, SNode)instead. 
- 
visibleMatchingText
public static String visibleMatchingText(@NotNull SNode node, @Nullable SNode context)
Provides a text that presents given node in completion menu. This text also can be used for matching with user-typed pattern, if there is no necessity to facilitate the separation between real matching text and visible matching text. 
- 
descriptionText
public static String descriptionText(SAbstractConcept concept)
 
- 
descriptionText
@Deprecated public static String descriptionText(SAbstractConcept concept, boolean referentPresentation)
Deprecated.usedescriptionText(SAbstractConcept)instead 
- 
descriptionText
@Deprecated public static String descriptionText(SNode node, boolean referent_presentation)
Deprecated.usedescriptionText(SNode)instead. 
 - 
 
 -