Example usage for com.intellij.openapi.actionSystem ActionPlaces DOCK_MENU

List of usage examples for com.intellij.openapi.actionSystem ActionPlaces DOCK_MENU

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem ActionPlaces DOCK_MENU.

Prototype

String DOCK_MENU

To view the source code for com.intellij.openapi.actionSystem ActionPlaces DOCK_MENU.

Click Source Link

Usage

From source file:com.intellij.ui.mac.MacDockDelegate.java

License:Apache License

public void updateRecentProjectsMenu() {
    final AnAction[] recentProjectActions = RecentProjectsManagerBase.getInstance()
            .getRecentProjectsActions(false);
    recentProjectsMenu.removeAll();/*from   ww  w  .  j  a v a 2  s . c o m*/

    for (final AnAction action : recentProjectActions) {
        MenuItem menuItem = new MenuItem(((ReopenProjectAction) action).getProjectName());
        menuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                action.actionPerformed(new AnActionEvent(null, DataManager.getInstance().getDataContext(null),
                        ActionPlaces.DOCK_MENU, action.getTemplatePresentation(), ActionManager.getInstance(),
                        0));
            }
        });
        recentProjectsMenu.add(menuItem);
    }
}