public static DefaultActionGroup createPopupActionGroup(
     final Project project,
     final TodoPanelSettings settings,
     Consumer<TodoFilter> todoFilterConsumer) {
   TodoFilter[] filters = TodoConfiguration.getInstance().getTodoFilters();
   DefaultActionGroup group = new DefaultActionGroup();
   group.add(
       new TodoFilterApplier(
           IdeBundle.message("action.todo.show.all"),
           IdeBundle.message("action.description.todo.show.all"),
           null,
           settings,
           todoFilterConsumer));
   for (TodoFilter filter : filters) {
     group.add(
         new TodoFilterApplier(filter.getName(), null, filter, settings, todoFilterConsumer));
   }
   group.addSeparator();
   group.add(
       new AnAction(
           IdeBundle.message("action.todo.edit.filters"),
           IdeBundle.message("action.todo.edit.filters"),
           AllIcons.General.Settings) {
         @Override
         public void actionPerformed(AnActionEvent e) {
           final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
           util.editConfigurable(project, new TodoConfigurable());
         }
       });
   return group;
 }
Example #2
0
  /* Invoked by reflection */
  TodoView(Project project, ProjectLevelVcsManager manager) {
    myProject = project;
    myVCSManager = manager;
    myCurrentPanelSettings = new TodoPanelSettings();
    myAllPanelSettings = new TodoPanelSettings();
    myChangeListTodosPanelSettings = new TodoPanelSettings();

    myVCSManager.addVcsListener(myVcsListener);

    final MyPropertyChangeListener myPropertyChangeListener = new MyPropertyChangeListener();
    TodoConfiguration.getInstance().addPropertyChangeListener(myPropertyChangeListener, this);

    MessageBusConnection connection = myProject.getMessageBus().connect(this);
    connection.subscribe(AppTopics.FILE_TYPES, new MyFileTypeListener());
  }