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_ARRAYEMPTY_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, waitfixSilentlygetElementToMakeWritableprotected 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()
IntentionActiongetText in interface IntentionActionIntentionAction.isAvailable(Project, Editor, PsiFile)public java.lang.String getFamilyName()
IntentionActiongetFamilyName in interface IntentionActiongetFamilyName 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 - Projectdescriptor - problem reported by the tool which provided this quick fix actionpublic boolean isAvailable(Project project, Editor editor, PsiFile file)
IntentionActionisAvailable in interface IntentionActionproject - 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
IntentionActionIntentionAction.startInWriteAction() returns true, this method is also called
inside write action.invoke in interface IntentionActionproject - the project in which the intention is invoked.editor - the editor in which the intention is invoked.file - the file open in the editor.IncorrectOperationExceptionpublic 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()
IntentionActionfalse 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 IntentionActionstartInWriteAction in interface WriteActionAwaretrue if the intention requires a write action, false otherwise.public boolean showHint(Editor editor)
HintActionIntentionAction.isAvailable(Project, Editor, PsiFile) is checked to be true.showHint in interface HintActionpublic static void runActionOverSeveralAttributeValuesAfterLettingUserSelectTheNeededOne(java.lang.String [] namespacesToChooseFrom,
Project project,
CreateNSDeclarationIntentionFix.StringToAttributeProcessor onSelection,
java.lang.String title,
IntentionAction requestor,
Editor editor)
throws IncorrectOperationException
IncorrectOperationExceptionpublic static void processExternalUris(CreateNSDeclarationIntentionFix.MetaHandler metaHandler, PsiFile file, CreateNSDeclarationIntentionFix.ExternalUriProcessor processor)