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, isApplicableContextConfigurationpublic 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 StructuralSearchProfilepublic java.lang.String getTypedVarString(PsiElement element)
getTypedVarString in class StructuralSearchProfilepublic java.lang.String getMeaningfulText(PsiElement element)
getMeaningfulText in class StructuralSearchProfilepublic java.lang.String getAlternativeText(PsiElement node, java.lang.String previousText)
getAlternativeText in class StructuralSearchProfilepublic PsiElement updateCurrentNode(PsiElement targetNode)
updateCurrentNode in class StructuralSearchProfilepublic PsiElement extendMatchedByDownUp(PsiElement targetNode)
extendMatchedByDownUp in class StructuralSearchProfilepublic PsiElement extendMatchOnePsiFile(PsiElement file)
extendMatchOnePsiFile in class StructuralSearchProfilepublic PsiElement getPresentableElement(PsiElement element)
getPresentableElement in class StructuralSearchProfilepublic void compile(PsiElement[] elements, GlobalCompilingVisitor globalVisitor)
compile in class StructuralSearchProfilepublic PsiElementVisitor createMatchingVisitor(GlobalMatchingVisitor globalVisitor)
createMatchingVisitor in class StructuralSearchProfilepublic NodeFilter getLexicalNodesFilter()
getLexicalNodesFilter in class StructuralSearchProfilepublic CompiledPattern createCompiledPattern()
createCompiledPattern in class StructuralSearchProfilepublic java.util.List<MatchPredicate> getCustomPredicates(MatchVariableConstraint constraint, java.lang.String name, MatchOptions options)
getCustomPredicates in class StructuralSearchProfilepublic boolean isMyLanguage(Language language)
isMyLanguage in class StructuralSearchProfilepublic StructuralReplaceHandler getReplaceHandler(Project project, ReplaceOptions replaceOptions)
getReplaceHandler in class StructuralSearchProfilepublic PsiElement [] createPatternTree(java.lang.String text, PatternTreeContext context, LanguageFileType fileType, Language language, java.lang.String contextId, Project project, boolean physical)
createPatternTree in class StructuralSearchProfilepublic java.lang.Class<? extends TemplateContextType> getTemplateContextTypeClass()
getTemplateContextTypeClass in class StructuralSearchProfilepublic java.util.List<PatternContext> getPatternContexts()
getPatternContexts in class StructuralSearchProfilepublic PsiCodeFragment createCodeFragment(Project project, java.lang.String text, java.lang.String contextId)
createCodeFragment in class StructuralSearchProfilepublic java.lang.String getCodeFragmentText(PsiFile fragment)
StructuralSearchProfilegetCodeFragmentText in class StructuralSearchProfilepublic boolean shouldShowProblem(PsiErrorElement error)
shouldShowProblem in class StructuralSearchProfilepublic void checkSearchPattern(CompiledPattern pattern)
checkSearchPattern in class StructuralSearchProfilepublic void checkReplacementPattern(Project project, ReplaceOptions options)
checkReplacementPattern in class StructuralSearchProfilepublic LanguageFileType getDefaultFileType(LanguageFileType currentDefaultFileType)
getDefaultFileType in class StructuralSearchProfilepublic Configuration[] getPredefinedTemplates()
getPredefinedTemplates in class StructuralSearchProfilepublic void provideAdditionalReplaceOptions(PsiElement node, ReplaceOptions options, ReplacementBuilder builder)
provideAdditionalReplaceOptions in class StructuralSearchProfilepublic void handleSubstitution(ParameterInfo info, MatchResult match, java.lang.StringBuilder result, ReplacementInfo replacementInfo)
handleSubstitution in class StructuralSearchProfilepublic void handleNoSubstitution(ParameterInfo info, java.lang.StringBuilder result)
handleNoSubstitution in class StructuralSearchProfilepublic boolean isIdentifier(PsiElement element)
isIdentifier in class StructuralSearchProfilepublic java.util.Collection<java.lang.String> getReservedWords()
getReservedWords in class StructuralSearchProfilepublic boolean isDocCommentOwner(PsiElement match)
isDocCommentOwner in class StructuralSearchProfilepublic boolean isApplicableConstraint(java.lang.String constraintName,
PsiElement variableNode,
boolean completePattern,
boolean target)
StructuralSearchProfileisApplicableConstraint in class StructuralSearchProfileconstraintName - 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