use of com.intellij.lang.properties.projectView.ResourceBundleNode 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);
}
use of com.intellij.lang.properties.projectView.ResourceBundleNode in project intellij-community by JetBrains.
the class ResourcesFavoriteNodeProvider method getFavoriteNodes.
@Override
public Collection<AbstractTreeNode> getFavoriteNodes(final DataContext context, final ViewSettings viewSettings) {
final Project project = CommonDataKeys.PROJECT.getData(context);
if (project == null) {
return null;
}
final ResourceBundle[] resourceBundles = ResourceBundle.ARRAY_DATA_KEY.getData(context);
//on bundles nodes
if (resourceBundles != null) {
final Collection<AbstractTreeNode> result = new ArrayList<>();
for (ResourceBundle bundle : resourceBundles) {
result.add(new ResourceBundleNode(project, bundle, viewSettings));
}
return result;
}
return null;
}
Aggregations