Search in sources :

Example 1 with NewRecentProjectPanel

use of com.intellij.openapi.wm.impl.welcomeScreen.NewRecentProjectPanel in project intellij-community by JetBrains.

the class ManageRecentProjectsAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    Disposable disposable = Disposer.newDisposable();
    NewRecentProjectPanel panel = new NewRecentProjectPanel(disposable);
    JList list = UIUtil.findComponentOfType(panel, JList.class);
    JBPopup popup = JBPopupFactory.getInstance().createComponentPopupBuilder(panel, list).setTitle("Recent Projects").setFocusable(true).setRequestFocus(true).setMayBeParent(true).setMovable(true).createPopup();
    Disposer.register(popup, disposable);
    Project project = e.getRequiredData(CommonDataKeys.PROJECT);
    popup.showCenteredInCurrentWindow(project);
}
Also used : Disposable(com.intellij.openapi.Disposable) Project(com.intellij.openapi.project.Project) NewRecentProjectPanel(com.intellij.openapi.wm.impl.welcomeScreen.NewRecentProjectPanel) JBPopup(com.intellij.openapi.ui.popup.JBPopup)

Aggregations

Disposable (com.intellij.openapi.Disposable)1 Project (com.intellij.openapi.project.Project)1 JBPopup (com.intellij.openapi.ui.popup.JBPopup)1 NewRecentProjectPanel (com.intellij.openapi.wm.impl.welcomeScreen.NewRecentProjectPanel)1