Search in sources :

Example 1 with RenamingSupport

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);
}
Also used : RenamingSupport(org.eclipse.che.ide.api.resources.RenamingSupport) Resource(org.eclipse.che.ide.api.resources.Resource)

Aggregations

RenamingSupport (org.eclipse.che.ide.api.resources.RenamingSupport)1 Resource (org.eclipse.che.ide.api.resources.Resource)1