Search in sources :

Example 1 with RenameablePackagingElement

use of com.intellij.packaging.elements.RenameablePackagingElement in project intellij-community by JetBrains.

the class RenamePackagingElementAction method update.

@Override
public void update(AnActionEvent e) {
    final LayoutTreeSelection selection = myArtifactEditor.getLayoutTreeComponent().getSelection();
    final PackagingElement<?> element = selection.getElementIfSingle();
    final boolean visible = element instanceof RenameablePackagingElement && ((RenameablePackagingElement) element).canBeRenamed();
    e.getPresentation().setEnabled(visible);
    e.getPresentation().setVisible(visible);
}
Also used : LayoutTreeSelection(com.intellij.openapi.roots.ui.configuration.artifacts.LayoutTreeSelection) RenameablePackagingElement(com.intellij.packaging.elements.RenameablePackagingElement)

Aggregations

LayoutTreeSelection (com.intellij.openapi.roots.ui.configuration.artifacts.LayoutTreeSelection)1 RenameablePackagingElement (com.intellij.packaging.elements.RenameablePackagingElement)1