public void loadState(final State state) { synchronized (myStateLock) { myState = state; if (myState.lastPath != null && !new File(myState.lastPath).exists()) { myState.lastPath = null; } if (myState.lastPath != null) { File lastFile = new File(myState.lastPath); if (lastFile.isDirectory() && !new File(lastFile, Project.DIRECTORY_STORE_FOLDER).exists()) { myState.lastPath = null; } } } }
private void markPathRecent(String path) { synchronized (myStateLock) { myState.lastPath = path; removePath(path); myState.recentPaths.add(0, path); } }
public void updateLastProjectPath() { final Project[] openProjects = ProjectManager.getInstance().getOpenProjects(); synchronized (myStateLock) { if (openProjects.length == 0) { myState.lastPath = null; myState.openPaths = Collections.emptyList(); } else { myState.lastPath = getProjectPath(openProjects[openProjects.length - 1]); myState.openPaths = new ArrayList<String>(); for (Project openProject : openProjects) { final String path = getProjectPath(openProject); ContainerUtil.addIfNotNull(myState.openPaths, path); myState.names.put(path, getProjectDisplayName(openProject)); } } } }