Use of MAkeMethodStaticProcessor

Hello,

 

I am trying to use MakeMethodStatic refactoring operation in a plugin but I could not use it because I didn't know how to put the right parameters. So, please could you help me by an example,

 

Best refards

2 comments

Code sample from AbstractMakeStaticDialog:

final Settings settings = new Settings(
isReplaceUsages(),
isMakeClassParameter() ? getClassParameterName() : null,
getVariableData(),
isGenerateDelegate()
);
if (myMember instanceof PsiMethod) {
invokeRefactoring(new MakeMethodStaticProcessor(getProject(), (PsiMethod)myMember, settings));
}
else {
invokeRefactoring(new MakeClassStaticProcessor(getProject(), (PsiClass)myMember, settings));
}

Anna

0

Please sign in to leave a comment.