mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Remove action from recent panel UI list
This commit is contained in:
@@ -45,6 +45,7 @@ public class ReopenProjectAction extends AnAction implements DumbAware {
|
||||
presentation.setDescription(projectPath);
|
||||
}
|
||||
|
||||
public Boolean IsRemoved = false;
|
||||
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
@@ -61,6 +62,7 @@ public class ReopenProjectAction extends AnAction implements DumbAware {
|
||||
if (Messages.showDialog(project, "The path " + FileUtil.toSystemDependentName(myProjectPath) + " does not exist.\n" +
|
||||
"If it is on a removable or network drive, please make sure that the drive is connected.",
|
||||
"Reopen Project", new String[]{"OK", "&Remove From List"}, 0, Messages.getErrorIcon()) == 1) {
|
||||
IsRemoved = true;
|
||||
RecentProjectsManager.getInstance().removePath(myProjectPath);
|
||||
}
|
||||
return;
|
||||
|
||||
+10
-2
@@ -122,8 +122,16 @@ public class RecentProjectPanel extends JPanel {
|
||||
if (Registry.is("removable.welcome.screen.projects") && rectInListCoordinatesContains(cellBounds, event.getPoint())) {
|
||||
removeRecentProjectAction.actionPerformed(null);
|
||||
} else if (selection != null) {
|
||||
((AnAction)selection).actionPerformed(
|
||||
AnActionEvent.createFromInputEvent((AnAction)selection, event, ActionPlaces.WELCOME_SCREEN));
|
||||
AnAction selectedAction = (AnAction) selection;
|
||||
AnActionEvent actionEvent = AnActionEvent.createFromInputEvent(selectedAction, event, ActionPlaces.WELCOME_SCREEN);
|
||||
selectedAction.actionPerformed(actionEvent);
|
||||
|
||||
// remove action from list if needed
|
||||
if (selectedAction instanceof ReopenProjectAction) {
|
||||
if (((ReopenProjectAction)selectedAction).IsRemoved) {
|
||||
ListUtil.removeSelectedItems(myList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user