Creating Custom extract action
I am trying to create a custom extract action using the following class
public class RefactoringSupportProvider extends com.intellij.lang.refactoring.RefactoringSupportProvider {
@Nullable
@Override
public RefactoringActionHandler getIntroduceConstantHandler() {
return new ExtractHandler();
}
}
The flow in Intellij is : Refactor -----> extract -----> constant (refer to attachment)
I want to change 'constant' to 'custom extract' so that flow becomes like : Refactor -----> extract -----> custom extract
Any suggestions how to do that?
Attachment(s):
Screen Shot 2015-03-31 at 10.54.43 AM.png
Please sign in to leave a comment.
If you want to create a custom refactoring, you don't need to touch RefactoringSupportProvider at all. Simply implement your own AnAction and add it to the correct action group (the ID is IntroduceActionGroup).
Thanks for the suggestion.
I tried creating an action in plugin.xml, it works as expected.
But Is there any way to disable that action for specific files ?