From 8c7858ce3e71cd81a8a82ce718d84dbb759fa73d Mon Sep 17 00:00:00 2001 From: "Evgeniy.Stepanov" Date: Mon, 23 Jan 2017 13:22:42 +0100 Subject: [PATCH] Clean API --- .../src/com/intellij/ide/ReopenProjectAction.java | 8 ++++++-- .../openapi/wm/impl/welcomeScreen/RecentProjectPanel.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/ReopenProjectAction.java b/platform/platform-impl/src/com/intellij/ide/ReopenProjectAction.java index f66c8c890255..cd7841a28184 100644 --- a/platform/platform-impl/src/com/intellij/ide/ReopenProjectAction.java +++ b/platform/platform-impl/src/com/intellij/ide/ReopenProjectAction.java @@ -34,6 +34,7 @@ import java.io.File; public class ReopenProjectAction extends AnAction implements DumbAware { private final String myProjectPath; private final String myProjectName; + private boolean myIsRemoved = false; public ReopenProjectAction(final String projectPath, final String projectName, final String displayName) { myProjectPath = projectPath; @@ -45,7 +46,6 @@ public class ReopenProjectAction extends AnAction implements DumbAware { presentation.setDescription(projectPath); } - public Boolean IsRemoved = false; @Override public void actionPerformed(AnActionEvent e) { @@ -62,7 +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; + myIsRemoved = true; RecentProjectsManager.getInstance().removePath(myProjectPath); } return; @@ -78,6 +78,10 @@ public class ReopenProjectAction extends AnAction implements DumbAware { public String getProjectPath() { return myProjectPath; } + + public boolean isRemoved() { + return myIsRemoved; + } public String getProjectName() { final RecentProjectsManager mgr = RecentProjectsManager.getInstance(); diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java index bb91ed0c1883..3745d972eb4b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectPanel.java @@ -128,7 +128,7 @@ public class RecentProjectPanel extends JPanel { // remove action from list if needed if (selectedAction instanceof ReopenProjectAction) { - if (((ReopenProjectAction)selectedAction).IsRemoved) { + if (((ReopenProjectAction)selectedAction).isRemoved()) { ListUtil.removeSelectedItems(myList); } }