use of com.intellij.lang.properties.projectView.CustomResourceBundlePropertiesFileNode in project intellij-community by JetBrains.
the class AddNewPropertyFileAction method update.
@Override
public void update(AnActionEvent e) {
final Navigatable[] data = CommonDataKeys.NAVIGATABLE_ARRAY.getData(e.getDataContext());
if (data != null && data.length == 1) {
if (data[0] instanceof ResourceBundleNode || data[0] instanceof CustomResourceBundlePropertiesFileNode) {
final ResourceBundle resourceBundle = (ResourceBundle) ((ProjectViewNode) data[0]).getValue();
LOG.assertTrue(resourceBundle != null);
if (CreateResourceBundleDialogComponent.getResourceBundlePlacementDirectory(resourceBundle) != null) {
e.getPresentation().setEnabledAndVisible(true);
return;
}
}
}
e.getPresentation().setEnabledAndVisible(false);
}
Aggregations