public class CreateAnnotationMethodFromUsageFix extends CreateFromUsageBaseFix
EMPTY_ARRAY
Constructor and Description |
---|
CreateAnnotationMethodFromUsageFix(PsiNameValuePair valuePair) |
Modifier and Type | Method and Description |
---|---|
static PsiType |
getAnnotationValueType(PsiAnnotationMemberValue value) |
protected PsiElement |
getElement() |
java.lang.String |
getFamilyName()
Returns the name of the family of intentions.
|
protected PsiNameValuePair |
getNameValuePair() |
void |
invoke(Project project,
Editor editor,
PsiFile file)
Called when user invokes intention.
|
protected boolean |
isAvailableImpl(int offset) |
protected boolean |
isValidElement(PsiElement element) |
canBeTargetClass, chooseTargetClass, filterTargetClasses, getTargetClasses, getTargetSubstitutor, getVisibility, isAllowOuterTargetClass, isAvailable, positionCursor, setupGenericParameters, setupVisibility, shouldCreateStaticMember, startInWriteAction, startTemplate, startTemplate, startTemplate
canModify, getText, setText, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getElementToMakeWritable
public CreateAnnotationMethodFromUsageFix(PsiNameValuePair valuePair)
protected boolean isAvailableImpl(int offset)
isAvailableImpl
in class CreateFromUsageBaseFix
protected PsiElement getElement()
getElement
in class CreateFromUsageBaseFix
public void invoke(Project project, Editor editor, PsiFile file) throws IncorrectOperationException
IntentionAction
IntentionAction.startInWriteAction()
returns true
, this method is also called
inside write action.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 PsiType getAnnotationValueType(PsiAnnotationMemberValue value)
protected boolean isValidElement(PsiElement element)
isValidElement
in class CreateFromUsageBaseFix
public java.lang.String getFamilyName()
IntentionAction
IntentionManager.registerIntentionAndMetaData(IntentionAction, String...)
protected PsiNameValuePair getNameValuePair()