Survive on missing actions; slightly better diagnostics

This commit is contained in:
Roman Shevchenko
2011-08-16 21:52:37 +02:00
parent 3f1d983f67
commit 55bf72c4a4
2 changed files with 10 additions and 4 deletions
@@ -334,4 +334,9 @@ public final class Presentation implements Cloneable {
public void setWeight(double weight) {
myWeight = weight;
}
@Override
public String toString() {
return myText + " (" + myDescription + ")";
}
}
@@ -178,8 +178,11 @@ public class Utils{
private static boolean hasVisibleChildren(ActionGroup group, PresentationFactory factory, DataContext context, String place) {
AnActionEvent event = new AnActionEvent(null, context, place, factory.getPresentation(group), ActionManager.getInstance(), 0);
event.setInjectedContext(group.isInInjectedContext());
AnAction[] children = group.getChildren(event);
for (AnAction anAction : children) {
for (AnAction anAction : group.getChildren(event)) {
if (anAction == null) {
LOG.error("Null action found in group " + group + ", " + factory.getPresentation(group));
continue;
}
if (anAction instanceof Separator) {
continue;
}
@@ -188,8 +191,6 @@ public class Utils{
continue;
}
LOG.assertTrue(anAction != null, "Null action found in group " + group);
final Presentation presentation = factory.getPresentation(anAction);
updateGroupChild(context, place, anAction, presentation);
if (anAction instanceof ActionGroup) {