Package jetbrains.mps.scope
Class ListScope
- java.lang.Object
 - 
- jetbrains.mps.scope.Scope
 - 
- jetbrains.mps.scope.ListScope
 
 
 
- 
public abstract class ListScope extends Scope
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ListScopeforNamedElements(Iterable<SNode> elements)static ListScopeforResolvableElements(Iterable<SNode> elements)Scope of elements that can be resolved by either IResolveInfo#resolveInfo, INamedConcept#name or BC#getPresentation() Introduced as a counterpart to returning list of nodes in ConstraintFunction_ReferentSearchScope_FactoryIterable<SNode>getAvailableElements(String prefix)Returns all available elements in the scope.abstract StringgetName(SNode child)StringgetReferenceText(SNode contextNode, SNode node)Creates textual reference for scope element.SNoderesolve(SNode contextNode, String refText)Resolves element by reference text. 
 - 
 
- 
- 
Method Detail
- 
resolve
public SNode resolve(SNode contextNode, @NotNull String refText)
Description copied from class:ScopeResolves element by reference text. Invariant: getReferenceText(contextNode, resolve(contextNode, refText)) == refText 
- 
getAvailableElements
public Iterable<SNode> getAvailableElements(@Nullable String prefix)
Description copied from class:ScopeReturns all available elements in the scope.- Specified by:
 getAvailableElementsin classScope- Parameters:
 prefix- (if not null) filters out elements whose reference text doesn't start with prefix- Returns:
 - list of nodes in the scope
 
 
- 
getReferenceText
public String getReferenceText(SNode contextNode, SNode node)
Description copied from class:ScopeCreates textual reference for scope element. If element has no textual representation for the reference, returns null. Invariant: resolve(contextNode, getReferenceText(contextNode, node)) == node- Specified by:
 getReferenceTextin classScope- Parameters:
 contextNode- source node for the reference, or its nearest parent node (if source node is unavailable)node- element from the current scope (contains(node) == true)- Returns:
 - reference text for the node element in the current scope
 
 
- 
forResolvableElements
public static ListScope forResolvableElements(Iterable<SNode> elements)
Scope of elements that can be resolved by either IResolveInfo#resolveInfo, INamedConcept#name or BC#getPresentation() Introduced as a counterpart to returning list of nodes in ConstraintFunction_ReferentSearchScope_Factory 
 - 
 
 -