use of com.intellij.ide.RecentProjectsManager in project intellij-community by JetBrains.
the class RemoveSelectedProjectsAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
RecentProjectsManager mgr = RecentProjectsManager.getInstance();
for (AnAction action : getSelectedElements(e)) {
if (action instanceof ReopenProjectAction) {
String path = ((ReopenProjectAction) action).getProjectPath();
mgr.removePath(path);
} else if (action instanceof ProjectGroupActionGroup) {
ProjectGroupActionGroup group = (ProjectGroupActionGroup) action;
for (String path : group.getGroup().getProjects()) {
mgr.removePath(path);
}
mgr.removeGroup(group.getGroup());
}
rebuildRecentProjectsList(e);
JList list = getList(e);
if (list != null) {
ScrollingUtil.ensureSelectionExists(list);
}
}
}
use of com.intellij.ide.RecentProjectsManager in project intellij-community by JetBrains.
the class MacDockDelegate method updateRecentProjectsMenu.
@Override
public void updateRecentProjectsMenu() {
RecentProjectsManager projectsManager = RecentProjectsManager.getInstance();
if (projectsManager == null)
return;
final AnAction[] recentProjectActions = projectsManager.getRecentProjectsActions(false);
recentProjectsMenu.removeAll();
for (final AnAction action : recentProjectActions) {
MenuItem menuItem = new MenuItem(((ReopenProjectAction) action).getProjectName());
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
action.actionPerformed(AnActionEvent.createFromAnAction(action, null, ActionPlaces.DOCK_MENU, DataManager.getInstance().getDataContext(null)));
}
});
recentProjectsMenu.add(menuItem);
}
}
Aggregations