public class CreateNSDeclarationIntentionFix extends java.lang.Object implements HintAction, LocalQuickFix
Modifier and Type | Class and Description |
---|---|
static interface |
CreateNSDeclarationIntentionFix.ExternalUriProcessor |
static interface |
CreateNSDeclarationIntentionFix.MetaHandler |
static interface |
CreateNSDeclarationIntentionFix.StringToAttributeProcessor |
static class |
CreateNSDeclarationIntentionFix.TagMetaHandler |
EMPTY_ARRAY
EMPTY_ARRAY
Modifier | Constructor and Description |
---|---|
protected |
CreateNSDeclarationIntentionFix(PsiElement element,
java.lang.String namespacePrefix) |
|
CreateNSDeclarationIntentionFix(PsiElement element,
java.lang.String namespacePrefix,
XmlToken token) |
Modifier and Type | Method and Description |
---|---|
void |
applyFix(Project project,
ProblemDescriptor descriptor)
Called to apply the fix.
|
static CreateNSDeclarationIntentionFix |
createFix(PsiElement element,
java.lang.String namespacePrefix) |
java.lang.String |
getFamilyName()
Returns the name of the family of intentions.
|
java.lang.String |
getText()
Returns text to be shown in the list of available actions, if this action
is available.
|
static java.lang.String |
getUnboundNamespaceForPrefix(java.lang.String prefix,
XmlFile xmlFile,
java.util.Set<java.lang.String> namespaces)
Given a prefix in a file and a set of candidate namespaces, returns the namespace that matches the prefix (if any)
as determined by the
XmlSchemaProvider.getDefaultPrefix(String, XmlFile)
implementations |
void |
invoke(Project project,
Editor editor,
PsiFile file)
Called when user invokes intention.
|
boolean |
isAvailable(Project project,
Editor editor,
PsiFile file)
Checks whether this intention is available at a caret offset in the file.
|
static void |
processExternalUris(CreateNSDeclarationIntentionFix.MetaHandler metaHandler,
PsiFile file,
CreateNSDeclarationIntentionFix.ExternalUriProcessor processor) |
static void |
runActionOverSeveralAttributeValuesAfterLettingUserSelectTheNeededOne(java.lang.String [] namespacesToChooseFrom,
Project project,
CreateNSDeclarationIntentionFix.StringToAttributeProcessor onSelection,
java.lang.String title,
IntentionAction requestor,
Editor editor) |
boolean |
showHint(Editor editor)
Show a popup or perform an automatic action in the given editor.
|
boolean |
startInWriteAction()
Indicate whether this action should be invoked inside write action.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fixSilently
getElementToMakeWritable
protected CreateNSDeclarationIntentionFix(PsiElement element, java.lang.String namespacePrefix)
public CreateNSDeclarationIntentionFix(PsiElement element, java.lang.String namespacePrefix, XmlToken token)
public static CreateNSDeclarationIntentionFix createFix(PsiElement element, java.lang.String namespacePrefix)
public java.lang.String getText()
IntentionAction
getText
in interface IntentionAction
IntentionAction.isAvailable(Project, Editor, PsiFile)
public java.lang.String getFamilyName()
IntentionAction
getFamilyName
in interface IntentionAction
getFamilyName
in interface QuickFix<ProblemDescriptor>
IntentionManager.registerIntentionAndMetaData(IntentionAction, String...)
public void applyFix(Project project, ProblemDescriptor descriptor)
QuickFix
Please call com.intellij.profile.codeInspection.ProjectInspectionProfileManager#fireProfileChanged()
if inspection profile is changed as result of fix.
applyFix
in interface QuickFix<ProblemDescriptor>
project
- Project
descriptor
- problem reported by the tool which provided this quick fix actionpublic boolean isAvailable(Project project, Editor editor, PsiFile file)
IntentionAction
isAvailable
in interface IntentionAction
project
- the project in which the availability is checked.editor
- the editor in which the intention will be invoked.file
- the file open in the editor.true
if the intention is available, false
otherwise.public void invoke(Project project, Editor editor, PsiFile file) throws IncorrectOperationException
IntentionAction
IntentionAction.startInWriteAction()
returns true
, this method is also called
inside write action.invoke
in interface IntentionAction
project
- the project in which the intention is invoked.editor
- the editor in which the intention is invoked.file
- the file open in the editor.IncorrectOperationException
public static java.lang.String getUnboundNamespaceForPrefix(java.lang.String prefix, XmlFile xmlFile, java.util.Set<java.lang.String> namespaces)
XmlSchemaProvider.getDefaultPrefix(String, XmlFile)
implementationspublic boolean startInWriteAction()
IntentionAction
false
if, e.g., a modal dialog is shown inside the action.
If false is returned the action itself is responsible for starting write action
when needed, by calling Application.runWriteAction(Runnable)
.startInWriteAction
in interface IntentionAction
startInWriteAction
in interface WriteActionAware
true
if the intention requires a write action, false
otherwise.public boolean showHint(Editor editor)
HintAction
IntentionAction.isAvailable(Project, Editor, PsiFile)
is checked to be true
.showHint
in interface HintAction
public static void runActionOverSeveralAttributeValuesAfterLettingUserSelectTheNeededOne(java.lang.String [] namespacesToChooseFrom, Project project, CreateNSDeclarationIntentionFix.StringToAttributeProcessor onSelection, java.lang.String title, IntentionAction requestor, Editor editor) throws IncorrectOperationException
IncorrectOperationException
public static void processExternalUris(CreateNSDeclarationIntentionFix.MetaHandler metaHandler, PsiFile file, CreateNSDeclarationIntentionFix.ExternalUriProcessor processor)