Search in sources :

Example 1 with CustomResourceBundlePropertiesFileNode

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);
}
Also used : ResourceBundleNode(com.intellij.lang.properties.projectView.ResourceBundleNode) CustomResourceBundlePropertiesFileNode(com.intellij.lang.properties.projectView.CustomResourceBundlePropertiesFileNode) ResourceBundle(com.intellij.lang.properties.ResourceBundle) Navigatable(com.intellij.pom.Navigatable)

Aggregations

ResourceBundle (com.intellij.lang.properties.ResourceBundle)1 CustomResourceBundlePropertiesFileNode (com.intellij.lang.properties.projectView.CustomResourceBundlePropertiesFileNode)1 ResourceBundleNode (com.intellij.lang.properties.projectView.ResourceBundleNode)1 Navigatable (com.intellij.pom.Navigatable)1