int (@NotNull Object value) { if (value instanceof ActionWrapper actionWrapper) { if ((ApplicationManager.getApplication().isDispatchThread() || actionWrapper.hasPresentation()) && actionWrapper.isAvailable()) { return 0; } return 2; } if (value instanceof OptionDescription) { if (value instanceof BooleanOptionDescription) return 1; return 3; } throw new IllegalArgumentException(value.getClass() + " - " + value); }