Clean API

This commit is contained in:
Evgeniy.Stepanov
2017-01-25 10:50:00 +01:00
parent 7fe46438f6
commit 8c7858ce3e
2 changed files with 7 additions and 3 deletions
@@ -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();
@@ -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);
}
}