public class JavaStructuralSearchProfile extends StructuralSearchProfile
Modifier and Type | Field and Description |
---|---|
static PatternContext |
DEFAULT_CONTEXT |
static PatternContext |
MEMBER_CONTEXT |
EP_NAME, PATTERN_PLACEHOLDER
Constructor and Description |
---|
JavaStructuralSearchProfile() |
Modifier and Type | Method and Description |
---|---|
void |
checkReplacementPattern(Project project,
ReplaceOptions options) |
void |
checkSearchPattern(CompiledPattern pattern) |
void |
compile(PsiElement[] elements,
GlobalCompilingVisitor globalVisitor) |
PsiCodeFragment |
createCodeFragment(Project project,
java.lang.String text,
java.lang.String contextId) |
CompiledPattern |
createCompiledPattern() |
PsiElementVisitor |
createMatchingVisitor(GlobalMatchingVisitor globalVisitor) |
PsiElement [] |
createPatternTree(java.lang.String text,
PatternTreeContext context,
LanguageFileType fileType,
Language language,
java.lang.String contextId,
Project project,
boolean physical) |
PsiElement |
extendMatchedByDownUp(PsiElement targetNode) |
PsiElement |
extendMatchOnePsiFile(PsiElement file) |
java.lang.String |
getAlternativeText(PsiElement node,
java.lang.String previousText) |
java.lang.String |
getCodeFragmentText(PsiFile fragment)
This method is called while holding a read action.
|
java.util.List<MatchPredicate> |
getCustomPredicates(MatchVariableConstraint constraint,
java.lang.String name,
MatchOptions options) |
LanguageFileType |
getDefaultFileType(LanguageFileType currentDefaultFileType) |
NodeFilter |
getLexicalNodesFilter() |
java.lang.String |
getMeaningfulText(PsiElement element) |
java.util.List<PatternContext> |
getPatternContexts() |
Configuration[] |
getPredefinedTemplates() |
PsiElement |
getPresentableElement(PsiElement element) |
StructuralReplaceHandler |
getReplaceHandler(Project project,
ReplaceOptions replaceOptions) |
java.util.Collection<java.lang.String> |
getReservedWords() |
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,
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 |
isDocCommentOwner(PsiElement match) |
boolean |
isIdentifier(PsiElement element) |
boolean |
isMyLanguage(Language language) |
void |
provideAdditionalReplaceOptions(PsiElement node,
ReplaceOptions options,
ReplacementBuilder builder) |
boolean |
shouldShowProblem(PsiErrorElement error) |
PsiElement |
updateCurrentNode(PsiElement targetNode) |
canBeVarDelimiter, createPatternTree, detectFileType, getContext, getPlaceholderVarName, isApplicableConstraint, isApplicableContextConfiguration
public static final PatternContext DEFAULT_CONTEXT
public static final PatternContext MEMBER_CONTEXT
public java.lang.String getText(PsiElement match, int start, int end)
getText
in class StructuralSearchProfile
public java.lang.String getTypedVarString(PsiElement element)
getTypedVarString
in class StructuralSearchProfile
public java.lang.String getMeaningfulText(PsiElement element)
getMeaningfulText
in class StructuralSearchProfile
public java.lang.String getAlternativeText(PsiElement node, java.lang.String previousText)
getAlternativeText
in class StructuralSearchProfile
public PsiElement updateCurrentNode(PsiElement targetNode)
updateCurrentNode
in class StructuralSearchProfile
public PsiElement extendMatchedByDownUp(PsiElement targetNode)
extendMatchedByDownUp
in class StructuralSearchProfile
public PsiElement extendMatchOnePsiFile(PsiElement file)
extendMatchOnePsiFile
in class StructuralSearchProfile
public PsiElement getPresentableElement(PsiElement element)
getPresentableElement
in class StructuralSearchProfile
public void compile(PsiElement[] elements, GlobalCompilingVisitor globalVisitor)
compile
in class StructuralSearchProfile
public PsiElementVisitor createMatchingVisitor(GlobalMatchingVisitor globalVisitor)
createMatchingVisitor
in class StructuralSearchProfile
public NodeFilter getLexicalNodesFilter()
getLexicalNodesFilter
in class StructuralSearchProfile
public CompiledPattern createCompiledPattern()
createCompiledPattern
in class StructuralSearchProfile
public java.util.List<MatchPredicate> getCustomPredicates(MatchVariableConstraint constraint, java.lang.String name, MatchOptions options)
getCustomPredicates
in class StructuralSearchProfile
public boolean isMyLanguage(Language language)
isMyLanguage
in class StructuralSearchProfile
public StructuralReplaceHandler getReplaceHandler(Project project, ReplaceOptions replaceOptions)
getReplaceHandler
in class StructuralSearchProfile
public PsiElement [] createPatternTree(java.lang.String text, PatternTreeContext context, LanguageFileType fileType, Language language, java.lang.String contextId, Project project, boolean physical)
createPatternTree
in class StructuralSearchProfile
public java.lang.Class<? extends TemplateContextType> getTemplateContextTypeClass()
getTemplateContextTypeClass
in class StructuralSearchProfile
public java.util.List<PatternContext> getPatternContexts()
getPatternContexts
in class StructuralSearchProfile
public PsiCodeFragment createCodeFragment(Project project, java.lang.String text, java.lang.String contextId)
createCodeFragment
in class StructuralSearchProfile
public java.lang.String getCodeFragmentText(PsiFile fragment)
StructuralSearchProfile
getCodeFragmentText
in class StructuralSearchProfile
public boolean shouldShowProblem(PsiErrorElement error)
shouldShowProblem
in class StructuralSearchProfile
public void checkSearchPattern(CompiledPattern pattern)
checkSearchPattern
in class StructuralSearchProfile
public void checkReplacementPattern(Project project, ReplaceOptions options)
checkReplacementPattern
in class StructuralSearchProfile
public LanguageFileType getDefaultFileType(LanguageFileType currentDefaultFileType)
getDefaultFileType
in class StructuralSearchProfile
public Configuration[] getPredefinedTemplates()
getPredefinedTemplates
in class StructuralSearchProfile
public void provideAdditionalReplaceOptions(PsiElement node, ReplaceOptions options, ReplacementBuilder builder)
provideAdditionalReplaceOptions
in class StructuralSearchProfile
public void handleSubstitution(ParameterInfo info, MatchResult match, java.lang.StringBuilder result, ReplacementInfo replacementInfo)
handleSubstitution
in class StructuralSearchProfile
public void handleNoSubstitution(ParameterInfo info, java.lang.StringBuilder result)
handleNoSubstitution
in class StructuralSearchProfile
public boolean isIdentifier(PsiElement element)
isIdentifier
in class StructuralSearchProfile
public java.util.Collection<java.lang.String> getReservedWords()
getReservedWords
in class StructuralSearchProfile
public boolean isDocCommentOwner(PsiElement match)
isDocCommentOwner
in class StructuralSearchProfile
public boolean isApplicableConstraint(java.lang.String constraintName, PsiElement variableNode, boolean completePattern, boolean target)
StructuralSearchProfile
isApplicableConstraint
in class StructuralSearchProfile
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 search