public abstract class StructuralSearchProfile
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static ExtensionPointName<StructuralSearchProfile> |
EP_NAME |
protected static java.lang.String |
PATTERN_PLACEHOLDER |
Constructor and Description |
---|
StructuralSearchProfile() |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeVarDelimiter(PsiElement element) |
void |
checkReplacementPattern(Project project,
ReplaceOptions options) |
void |
checkSearchPattern(CompiledPattern pattern) |
abstract void |
compile(PsiElement[] elements,
GlobalCompilingVisitor globalVisitor) |
PsiCodeFragment |
createCodeFragment(Project project,
java.lang.String text,
java.lang.String contextId) |
abstract CompiledPattern |
createCompiledPattern() |
abstract PsiElementVisitor |
createMatchingVisitor(GlobalMatchingVisitor globalVisitor) |
PsiElement[] |
createPatternTree(java.lang.String text,
PatternContextInfo contextInfo,
LanguageFileType fileType,
Language language,
Project project,
boolean physical) |
PsiElement[] |
createPatternTree(java.lang.String text,
PatternTreeContext context,
LanguageFileType fileType,
Language language,
java.lang.String contextId,
Project project,
boolean physical) |
LanguageFileType |
detectFileType(PsiElement context) |
PsiElement |
extendMatchedByDownUp(PsiElement node) |
PsiElement |
extendMatchOnePsiFile(PsiElement file) |
java.lang.String |
getAlternativeText(PsiElement element,
java.lang.String previousText) |
java.lang.String |
getCodeFragmentText(PsiFile fragment)
This method is called while holding a read action.
|
protected java.lang.String |
getContext(java.lang.String pattern,
Language language,
java.lang.String contextId) |
java.util.List<MatchPredicate> |
getCustomPredicates(MatchVariableConstraint constraint,
java.lang.String name,
MatchOptions options) |
LanguageFileType |
getDefaultFileType(LanguageFileType fileType) |
abstract NodeFilter |
getLexicalNodesFilter() |
java.lang.String |
getMeaningfulText(PsiElement element) |
java.util.List<PatternContext> |
getPatternContexts() |
protected java.lang.String |
getPlaceholderVarName() |
Configuration[] |
getPredefinedTemplates() |
PsiElement |
getPresentableElement(PsiElement element) |
StructuralReplaceHandler |
getReplaceHandler(Project project,
ReplaceOptions replaceOptions) |
java.util.Collection<java.lang.String> |
getReservedWords() |
abstract java.lang.Class<? extends TemplateContextType> |
getTemplateContextTypeClass() |
java.lang.String |
getText(PsiElement match,
int start,
int end) |
java.lang.String |
getTypedVarString(PsiElement element) |
void |
handleNoSubstitution(ParameterInfo info,
java.lang.StringBuilder result) |
void |
handleSubstitution(ParameterInfo info,
MatchResult match,
java.lang.StringBuilder result,
ReplacementInfo replacementInfo) |
boolean |
isApplicableConstraint(java.lang.String constraintName,
java.util.List<? extends PsiElement> nodes,
boolean completePattern,
boolean target) |
boolean |
isApplicableConstraint(java.lang.String constraintName,
PsiElement variableNode,
boolean completePattern,
boolean target)
Override this method to influence which UI controls are shown when editing the constraints of the specified variable.
|
boolean |
isApplicableContextConfiguration(Configuration configuration) |
boolean |
isDocCommentOwner(PsiElement match) |
boolean |
isIdentifier(PsiElement element) |
abstract boolean |
isMyLanguage(Language language) |
void |
provideAdditionalReplaceOptions(PsiElement node,
ReplaceOptions options,
ReplacementBuilder builder) |
boolean |
shouldShowProblem(PsiErrorElement error) |
PsiElement |
updateCurrentNode(PsiElement node) |
public static final ExtensionPointName<StructuralSearchProfile> EP_NAME
protected static final java.lang.String PATTERN_PLACEHOLDER
public abstract void compile(PsiElement[] elements, GlobalCompilingVisitor globalVisitor)
public abstract PsiElementVisitor createMatchingVisitor(GlobalMatchingVisitor globalVisitor)
public abstract NodeFilter getLexicalNodesFilter()
public abstract CompiledPattern createCompiledPattern()
public java.util.List<MatchPredicate> getCustomPredicates(MatchVariableConstraint constraint, java.lang.String name, MatchOptions options)
public abstract boolean isMyLanguage(Language language)
public PsiElement[] createPatternTree(java.lang.String text, PatternTreeContext context, LanguageFileType fileType, Language language, java.lang.String contextId, Project project, boolean physical)
public PsiElement[] createPatternTree(java.lang.String text, PatternContextInfo contextInfo, LanguageFileType fileType, Language language, Project project, boolean physical)
public java.util.List<PatternContext> getPatternContexts()
protected java.lang.String getPlaceholderVarName()
protected java.lang.String getContext(java.lang.String pattern, Language language, java.lang.String contextId)
public PsiCodeFragment createCodeFragment(Project project, java.lang.String text, java.lang.String contextId)
public java.lang.String getCodeFragmentText(PsiFile fragment)
public abstract java.lang.Class<? extends TemplateContextType> getTemplateContextTypeClass()
public LanguageFileType detectFileType(PsiElement context)
public StructuralReplaceHandler getReplaceHandler(Project project, ReplaceOptions replaceOptions)
public void checkSearchPattern(CompiledPattern pattern)
public void checkReplacementPattern(Project project, ReplaceOptions options)
public boolean shouldShowProblem(PsiErrorElement error)
public boolean canBeVarDelimiter(PsiElement element)
public java.lang.String getText(PsiElement match, int start, int end)
public java.lang.String getTypedVarString(PsiElement element)
public java.lang.String getMeaningfulText(PsiElement element)
public java.lang.String getAlternativeText(PsiElement element, java.lang.String previousText)
public PsiElement updateCurrentNode(PsiElement node)
public PsiElement extendMatchedByDownUp(PsiElement node)
public PsiElement extendMatchOnePsiFile(PsiElement file)
public LanguageFileType getDefaultFileType(LanguageFileType fileType)
public Configuration[] getPredefinedTemplates()
public void provideAdditionalReplaceOptions(PsiElement node, ReplaceOptions options, ReplacementBuilder builder)
public void handleSubstitution(ParameterInfo info, MatchResult match, java.lang.StringBuilder result, ReplacementInfo replacementInfo)
public void handleNoSubstitution(ParameterInfo info, java.lang.StringBuilder result)
public boolean isIdentifier(PsiElement element)
public java.util.Collection<java.lang.String> getReservedWords()
public boolean isDocCommentOwner(PsiElement match)
public PsiElement getPresentableElement(PsiElement element)
public boolean isApplicableConstraint(java.lang.String constraintName, PsiElement variableNode, boolean completePattern, boolean target)
constraintName
- the name of the constraint controls for which applicability is considered.
See UIUtil
for predefined constraint namesvariableNode
- the psi element corresponding to the current variablecompletePattern
- true, if the current variableNode encompasses the complete pattern. The variableNode can also be null in this case.target
- true, if the current variableNode is the target of the searchpublic final boolean isApplicableConstraint(java.lang.String constraintName, java.util.List<? extends PsiElement> nodes, boolean completePattern, boolean target)
public boolean isApplicableContextConfiguration(Configuration configuration)