use of org.eclipse.che.ide.api.resources.RenamingSupport in project che by eclipse.
the class RenameItemAction method updateInPerspective.
/** {@inheritDoc} */
@Override
public void updateInPerspective(@NotNull ActionEvent e) {
final Resource[] resources = appContext.getResources();
e.getPresentation().setVisible(true);
if (resources == null || resources.length != 1) {
e.getPresentation().setEnabled(false);
return;
}
for (RenamingSupport validator : renamingSupport) {
if (!validator.isRenameAllowed(resources[0])) {
e.getPresentation().setEnabled(false);
return;
}
}
e.getPresentation().setEnabled(true);
}
Aggregations