FlattenModulesToggleAction (Runnable update) { return new FlattenModulesToggleAction(myProject, () -> DependencyUISettings.getInstance().UI_SHOW_MODULES, () -> !DependencyUISettings.getInstance().UI_SHOW_MODULE_GROUPS, value -> { DependencyUISettings.getInstance().UI_SHOW_MODULE_GROUPS = !value; update.run(); }); }