当前页面:
在线文档首页 >
NetBeans API Javadoc (Current Development Version)
ActionsImplementationProvider (Refactoring API) - NetBeans API Javadoc (Current Development Version)
org.netbeans.modules.refactoring.spi.ui
Class ActionsImplementationProvider
java.lang.Object
org.netbeans.modules.refactoring.spi.ui.ActionsImplementationProvider
public abstract class ActionsImplementationProvider
- extends Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ActionsImplementationProvider
public ActionsImplementationProvider()
canRename
public boolean canRename(Lookup lookup)
- Parameters:
lookup
- current context
- Returns:
- true if provider can handle rename
doRename
public void doRename(Lookup lookup)
- Parameters:
lookup
- current context
canFindUsages
public boolean canFindUsages(Lookup lookup)
- Parameters:
lookup
- current context
- Returns:
- true if provider can handle find usages
doFindUsages
public void doFindUsages(Lookup lookup)
- Parameters:
lookup
- current context
canDelete
public boolean canDelete(Lookup lookup)
- Parameters:
lookup
- current context
- Returns:
- true if provider can handle delete
doDelete
public void doDelete(Lookup lookup)
- Parameters:
lookup
- current context
canMove
public boolean canMove(Lookup lookup)
- Parameters:
lookup
- current context
- Returns:
- true if provider can handle move
doMove
public void doMove(Lookup lookup)
- Parameters:
lookup
- current context
canCopy
public boolean canCopy(Lookup lookup)
- Parameters:
lookup
- current context
- Returns:
- true if provider can handle copy
doCopy
public void doCopy(Lookup lookup)
- Parameters:
lookup
- current context