| Create your own provider of this class and register it in META-INF services, if you want to
create your own implementations of refactorin actions.
For instance Java module wants to have refactoring rename action for java files.
So Java Refactoring module must implement 2 methods.
public boolean canRename(Lookup lookup) {
Node[] nodes = lookup.lookupAll(Node.class);
if (..one node selected and the node belongs to java...)
return true;
else
return false;
}
public void doRename(Lookup selectedNodes) {
Node[] nodes = lookup.lookupAll(Node.class);
final FileObject fo = getFileFromNode(nodes[0]);
UI.openRefactoringUI(new RenameRefactoringUI(fo);
}
For help on creating and registering actions
See Refactoring FAQ
author: Jan Becicka |