mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Survive on missing actions; slightly better diagnostics
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user