mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-21 14:37:45 +07:00
extract RecentProjectsManager and move to platform-api
This commit is contained in:
+4
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,13 +24,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
@State(
|
||||
name = "RecentProjectsManager",
|
||||
storages = {
|
||||
@Storage(file = StoragePathMacros.APP_CONFIG + "/other.xml", roamingType = RoamingType.DISABLED),
|
||||
@Storage(file = StoragePathMacros.APP_CONFIG + "/other.xml"),
|
||||
@Storage(file = StoragePathMacros.APP_CONFIG + "/recentProjects.xml", roamingType = RoamingType.DISABLED)
|
||||
},
|
||||
storageChooser = LastStorageChooserForWrite.class
|
||||
)
|
||||
public class RecentProjectsManager extends RecentProjectsManagerBase {
|
||||
public RecentProjectsManager(MessageBus messageBus) {
|
||||
public class RecentProjectsManagerImpl extends RecentProjectsManagerBase {
|
||||
public RecentProjectsManagerImpl(MessageBus messageBus) {
|
||||
super(messageBus);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
package com.intellij.ide.util.projectWizard;
|
||||
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.components.StorageScheme;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -93,7 +93,7 @@ public class WizardContext extends UserDataHolderBase {
|
||||
if (myProjectFileDirectory != null) {
|
||||
return myProjectFileDirectory;
|
||||
}
|
||||
final String lastProjectLocation = RecentProjectsManagerBase.getInstance().getLastProjectCreationLocation();
|
||||
final String lastProjectLocation = RecentProjectsManager.getInstance().getLastProjectCreationLocation();
|
||||
if (lastProjectLocation != null) {
|
||||
return lastProjectLocation.replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.ide;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class RecentProjectsManager {
|
||||
public static RecentProjectsManager getInstance() {
|
||||
return ServiceManager.getService(RecentProjectsManager.class);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public abstract String getLastProjectCreationLocation();
|
||||
|
||||
public abstract void setLastProjectCreationLocation(@Nullable String lastProjectLocation);
|
||||
|
||||
public abstract void clearNameCache();
|
||||
|
||||
public abstract void updateLastProjectPath();
|
||||
|
||||
public abstract String getLastProjectPath();
|
||||
|
||||
public abstract void removePath(@Nullable String path);
|
||||
|
||||
/**
|
||||
* @param addClearListItem whether the "Clear List" action should be added to the end of the list.
|
||||
*/
|
||||
public abstract AnAction[] getRecentProjectsActions(boolean addClearListItem);
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.Separator;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
@@ -34,7 +33,7 @@ import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.impl.SystemDock;
|
||||
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.messages.MessageBus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -46,14 +45,14 @@ import java.util.*;
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public abstract class RecentProjectsManagerBase implements ProjectManagerListener, PersistentStateComponent<RecentProjectsManagerBase.State> {
|
||||
public static RecentProjectsManagerBase getInstance() {
|
||||
return ServiceManager.getService(RecentProjectsManagerBase.class);
|
||||
public abstract class RecentProjectsManagerBase extends RecentProjectsManager implements ProjectManagerListener, PersistentStateComponent<RecentProjectsManagerBase.State> {
|
||||
public static RecentProjectsManagerBase getInstanceEx() {
|
||||
return (RecentProjectsManagerBase)RecentProjectsManager.getInstance();
|
||||
}
|
||||
|
||||
public static class State {
|
||||
public List<String> recentPaths = ContainerUtil.newArrayList();
|
||||
public List<String> openPaths = ContainerUtil.newArrayList();
|
||||
public List<String> recentPaths = new SmartList<String>();
|
||||
public List<String> openPaths = new SmartList<String>();
|
||||
public Map<String, String> names = ContainerUtil.newLinkedHashMap();
|
||||
public String lastPath;
|
||||
|
||||
@@ -72,11 +71,6 @@ public abstract class RecentProjectsManagerBase implements ProjectManagerListene
|
||||
recentPaths.remove(index);
|
||||
}
|
||||
}
|
||||
|
||||
void removePath(String path) {
|
||||
recentPaths.remove(path);
|
||||
names.remove(path);
|
||||
}
|
||||
}
|
||||
|
||||
private final Object myStateLock = new Object();
|
||||
@@ -98,30 +92,34 @@ public abstract class RecentProjectsManagerBase implements ProjectManagerListene
|
||||
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
if (state.lastPath != null && !new File(state.lastPath).exists()) {
|
||||
state.lastPath = null;
|
||||
}
|
||||
if (state.lastPath != null) {
|
||||
File lastFile = new File(state.lastPath);
|
||||
if (lastFile.isDirectory() && !new File(lastFile, Project.DIRECTORY_STORE_FOLDER).exists()) {
|
||||
state.lastPath = null;
|
||||
}
|
||||
}
|
||||
myState = state;
|
||||
}
|
||||
|
||||
public void removePath(final String path) {
|
||||
if (path == null) return;
|
||||
@Override
|
||||
public void removePath(@Nullable String path) {
|
||||
if (path == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (myStateLock) {
|
||||
if (SystemInfo.isFileSystemCaseSensitive) {
|
||||
myState.removePath(path);
|
||||
myState.recentPaths.remove(path);
|
||||
myState.names.remove(path);
|
||||
}
|
||||
else {
|
||||
for (String p : ArrayUtil.toStringArray(myState.recentPaths)) {
|
||||
if (path.equalsIgnoreCase(p)) {
|
||||
myState.removePath(path);
|
||||
for (Iterator<String> iterator = myState.recentPaths.iterator(); iterator.hasNext(); ) {
|
||||
if (path.equalsIgnoreCase(iterator.next())) {
|
||||
iterator.remove();
|
||||
myState.names.remove(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,30 +129,32 @@ public abstract class RecentProjectsManagerBase implements ProjectManagerListene
|
||||
/**
|
||||
* @return a path pointing to a directory where the last project was created or null if not available
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public String getLastProjectCreationLocation() {
|
||||
return myState.lastProjectLocation;
|
||||
}
|
||||
|
||||
public void setLastProjectCreationLocation(String lastProjectLocation) {
|
||||
myState.lastProjectLocation = lastProjectLocation;
|
||||
@Override
|
||||
public void setLastProjectCreationLocation(@Nullable String lastProjectLocation) {
|
||||
myState.lastProjectLocation = StringUtil.nullize(lastProjectLocation, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastProjectPath() {
|
||||
synchronized (myStateLock) {
|
||||
return myState.lastPath;
|
||||
}
|
||||
return myState.lastPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLastProjectPath() {
|
||||
final Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
|
||||
synchronized (myStateLock) {
|
||||
myState.openPaths.clear();
|
||||
if (openProjects.length == 0) {
|
||||
myState.lastPath = null;
|
||||
myState.openPaths = Collections.emptyList();
|
||||
}
|
||||
else {
|
||||
myState.lastPath = getProjectPath(openProjects[openProjects.length - 1]);
|
||||
myState.openPaths = ContainerUtil.newArrayList();
|
||||
for (Project openProject : openProjects) {
|
||||
String path = getProjectPath(openProject);
|
||||
if (path != null) {
|
||||
@@ -182,9 +182,7 @@ public abstract class RecentProjectsManagerBase implements ProjectManagerListene
|
||||
return duplicates;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param addClearListItem whether the "Clear List" action should be added to the end of the list.
|
||||
*/
|
||||
@Override
|
||||
public AnAction[] getRecentProjectsActions(boolean addClearListItem) {
|
||||
final Set<String> paths;
|
||||
synchronized (myStateLock) {
|
||||
@@ -200,7 +198,7 @@ public abstract class RecentProjectsManagerBase implements ProjectManagerListene
|
||||
paths.remove(null);
|
||||
paths.removeAll(openedPaths);
|
||||
|
||||
List<AnAction> actions = new ArrayList<AnAction>();
|
||||
List<AnAction> actions = new SmartList<AnAction>();
|
||||
Set<String> duplicates = getDuplicateProjectNames(openedPaths, paths);
|
||||
for (final String path : paths) {
|
||||
String projectName = getProjectName(path);
|
||||
@@ -308,6 +306,7 @@ public abstract class RecentProjectsManagerBase implements ProjectManagerListene
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearNameCache() {
|
||||
myNameCache.clear();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.intellij.ide;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -46,6 +45,7 @@ public class ReopenProjectAction extends AnAction implements DumbAware {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
final int modifiers = e.getModifiers();
|
||||
final boolean forceOpenInNewFrame = (modifiers & InputEvent.CTRL_MASK) != 0 || (modifiers & InputEvent.SHIFT_MASK) != 0;
|
||||
@@ -54,11 +54,11 @@ 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) {
|
||||
RecentProjectsManagerBase.getInstance().removePath(myProjectPath);
|
||||
RecentProjectsManager.getInstance().removePath(myProjectPath);
|
||||
}
|
||||
return;
|
||||
}
|
||||
RecentProjectsManagerBase.getInstance().doOpenProject(myProjectPath, project, forceOpenInNewFrame);
|
||||
RecentProjectsManagerBase.getInstanceEx().doOpenProject(myProjectPath, project, forceOpenInNewFrame);
|
||||
}
|
||||
|
||||
public String getProjectPath() {
|
||||
|
||||
@@ -15,12 +15,11 @@
|
||||
*/
|
||||
package com.intellij.ide.actions;
|
||||
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.impl.ProjectUtil;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
@@ -29,15 +28,17 @@ import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame;
|
||||
import com.intellij.projectImport.ProjectAttachProcessor;
|
||||
|
||||
public class CloseProjectAction extends AnAction implements DumbAware {
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
|
||||
assert project != null;
|
||||
|
||||
ProjectUtil.closeAndDispose(project);
|
||||
RecentProjectsManagerBase.getInstance().updateLastProjectPath();
|
||||
RecentProjectsManager.getInstance().updateLastProjectPath();
|
||||
WelcomeFrame.showIfNoProjectOpened();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent event){
|
||||
Presentation presentation = event.getPresentation();
|
||||
Project project = event.getData(CommonDataKeys.PROJECT);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.ide.actions;
|
||||
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.idea.ActionsBundle;
|
||||
import com.intellij.openapi.actionSystem.ActionGroup;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
@@ -32,13 +32,15 @@ public class RecentProjectsGroup extends ActionGroup implements DumbAware {
|
||||
presentation.setText(ActionsBundle.message(SystemInfo.isMac ? "group.reopen.mac.text": "group.reopen.win.text"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public AnAction[] getChildren(@Nullable AnActionEvent e) {
|
||||
return RecentProjectsManagerBase.getInstance().getRecentProjectsActions(true);
|
||||
return RecentProjectsManager.getInstance().getRecentProjectsActions(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent event) {
|
||||
Presentation presentation = event.getPresentation();
|
||||
presentation.setEnabled(RecentProjectsManagerBase.getInstance().getRecentProjectsActions(true).length > 0);
|
||||
presentation.setEnabled(RecentProjectsManager.getInstance().getRecentProjectsActions(true).length > 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.intellij.ide.impl;
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.highlighter.ProjectFileType;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
@@ -76,7 +76,7 @@ public class ProjectUtil {
|
||||
LOG.info(e);
|
||||
return;
|
||||
}
|
||||
RecentProjectsManagerBase.getInstance().setLastProjectCreationLocation(path.replace(File.separatorChar, '/'));
|
||||
RecentProjectsManager.getInstance().setLastProjectCreationLocation(path.replace(File.separatorChar, '/'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -276,7 +276,7 @@ public class ProjectUtil {
|
||||
}
|
||||
|
||||
public static String getBaseDir() {
|
||||
final String lastProjectLocation = RecentProjectsManagerBase.getInstance().getLastProjectCreationLocation();
|
||||
final String lastProjectLocation = RecentProjectsManager.getInstance().getLastProjectCreationLocation();
|
||||
if (lastProjectLocation != null) {
|
||||
return lastProjectLocation.replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package com.intellij.openapi.project.impl;
|
||||
|
||||
import com.intellij.diagnostic.PluginException;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.ide.startup.StartupManagerEx;
|
||||
@@ -349,7 +349,7 @@ public class ProjectImpl extends PlatformComponentManagerImpl implements Project
|
||||
catch (IOException e) {
|
||||
LOG.info("Unable to store project name to: " + nameFile.getPath());
|
||||
}
|
||||
RecentProjectsManagerBase.getInstance().clearNameCache();
|
||||
RecentProjectsManager.getInstance().clearNameCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-3
@@ -19,7 +19,7 @@ import com.intellij.CommonBundle;
|
||||
import com.intellij.conversion.ConversionResult;
|
||||
import com.intellij.conversion.ConversionService;
|
||||
import com.intellij.ide.AppLifecycleListener;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.impl.ProjectUtil;
|
||||
import com.intellij.ide.plugins.PluginManager;
|
||||
import com.intellij.ide.startup.impl.StartupManagerImpl;
|
||||
@@ -29,8 +29,11 @@ import com.intellij.openapi.application.*;
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx;
|
||||
import com.intellij.openapi.application.impl.ApplicationImpl;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.openapi.components.impl.stores.*;
|
||||
import com.intellij.openapi.components.impl.stores.ComponentStoreImpl;
|
||||
import com.intellij.openapi.components.impl.stores.ComponentStoreImpl.ReloadComponentStoreStatus;
|
||||
import com.intellij.openapi.components.impl.stores.FileBasedStorage;
|
||||
import com.intellij.openapi.components.impl.stores.StateStorageManager;
|
||||
import com.intellij.openapi.components.impl.stores.StorageUtil;
|
||||
import com.intellij.openapi.components.store.StateStorageBase;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
@@ -124,7 +127,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements PersistentSt
|
||||
|
||||
/** @noinspection UnusedParameters*/
|
||||
public ProjectManagerImpl(@NotNull VirtualFileManager virtualFileManager,
|
||||
RecentProjectsManagerBase recentProjectsManager,
|
||||
RecentProjectsManager recentProjectsManager,
|
||||
ProgressManager progressManager) {
|
||||
myProgressManager = progressManager;
|
||||
Application app = ApplicationManager.getApplication();
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.ui.playback.util;
|
||||
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.openapi.project.*;
|
||||
import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.openapi.ui.playback.PlaybackContext;
|
||||
@@ -44,7 +44,7 @@ public class ProjectPlaybackCall {
|
||||
}
|
||||
|
||||
public static AsyncResult<String> openLastProject(final PlaybackContext context) {
|
||||
return openProject(context, RecentProjectsManagerBase.getInstance().getLastProjectPath());
|
||||
return openProject(context, RecentProjectsManager.getInstance().getLastProjectPath());
|
||||
}
|
||||
|
||||
public static AsyncResult<String> openProject(final PlaybackContext context, final String path) {
|
||||
|
||||
+3
-2
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.wm.impl.welcomeScreen;
|
||||
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.ReopenProjectAction;
|
||||
import com.intellij.openapi.actionSystem.ActionPlaces;
|
||||
@@ -54,7 +55,7 @@ public class RecentProjectPanel extends JPanel {
|
||||
public RecentProjectPanel(WelcomeScreen screen) {
|
||||
super(new BorderLayout());
|
||||
|
||||
final AnAction[] recentProjectActions = RecentProjectsManagerBase.getInstance().getRecentProjectsActions(false);
|
||||
final AnAction[] recentProjectActions = RecentProjectsManager.getInstance().getRecentProjectsActions(false);
|
||||
|
||||
myPathShortener = new UniqueNameBuilder<ReopenProjectAction>(SystemProperties.getUserHome(), File.separator, 40);
|
||||
for (AnAction action : recentProjectActions) {
|
||||
@@ -112,7 +113,7 @@ public class RecentProjectPanel extends JPanel {
|
||||
"Remove Recent Project",
|
||||
Messages.getQuestionIcon());
|
||||
if (rc == Messages.OK) {
|
||||
final RecentProjectsManagerBase manager = RecentProjectsManagerBase.getInstance();
|
||||
RecentProjectsManager manager = RecentProjectsManagerBase.getInstance();
|
||||
for (Object projectAction : selection) {
|
||||
manager.removePath(((ReopenProjectAction)projectAction).getProjectPath());
|
||||
}
|
||||
|
||||
+7
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.wm.impl.welcomeScreen;
|
||||
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
@@ -27,22 +27,22 @@ import javax.swing.*;
|
||||
|
||||
/**
|
||||
* This action is not visible in the UI but we keep it available to let users invoke it from keyboard.
|
||||
*
|
||||
* @author pti
|
||||
* Date: Mar 2, 2005
|
||||
*/
|
||||
public class RecentProjectsAction extends WelcomePopupAction {
|
||||
@Override
|
||||
protected void fillActions(final DefaultActionGroup group) {
|
||||
final AnAction[] recentProjectActions = RecentProjectsManagerBase.getInstance().getRecentProjectsActions(false);
|
||||
final AnAction[] recentProjectActions = RecentProjectsManager.getInstance().getRecentProjectsActions(false);
|
||||
for (AnAction action : recentProjectActions) {
|
||||
group.add(action);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTextForEmpty() {
|
||||
return UIBundle.message("welcome.screen.recent.projects.action.no.recent.projects.to.display.action.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getCaption() {
|
||||
return "";
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class RecentProjectsAction extends WelcomePopupAction {
|
||||
|
||||
@Override
|
||||
public void update(final AnActionEvent e) {
|
||||
e.getPresentation().setVisible(RecentProjectsManagerBase.getInstance().getRecentProjectsActions(false).length > 0);
|
||||
e.getPresentation().setVisible(RecentProjectsManager.getInstance().getRecentProjectsActions(false).length > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
*/
|
||||
package com.intellij.platform;
|
||||
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.idea.ActionsBundle;
|
||||
import com.intellij.internal.statistic.UsageTrigger;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
@@ -97,7 +96,7 @@ public class NewDirectoryProjectAction extends AnAction implements DumbAware {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
RecentProjectsManagerBase.getInstance().setLastProjectCreationLocation(location.getParent());
|
||||
RecentProjectsManager.getInstance().setLastProjectCreationLocation(location.getParent());
|
||||
final Object finalSettings = settings;
|
||||
return PlatformProjectOpenProcessor.doOpenProject(baseDir, null, false, -1, new ProjectOpenedCallback() {
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package com.intellij.ui.mac;
|
||||
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.ReopenProjectAction;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.ActionPlaces;
|
||||
@@ -35,7 +35,6 @@ import java.lang.reflect.Method;
|
||||
* @author Denis Fokin
|
||||
*/
|
||||
public class MacDockDelegate implements SystemDock.Delegate {
|
||||
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.ui.mac.MacDockDelegate");
|
||||
|
||||
private static boolean initialized = false;
|
||||
@@ -57,8 +56,9 @@ public class MacDockDelegate implements SystemDock.Delegate {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRecentProjectsMenu () {
|
||||
final AnAction[] recentProjectActions = RecentProjectsManagerBase.getInstance().getRecentProjectsActions(false);
|
||||
final AnAction[] recentProjectActions = RecentProjectsManager.getInstance().getRecentProjectsActions(false);
|
||||
recentProjectsMenu.removeAll();
|
||||
|
||||
for (final AnAction action : recentProjectActions) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,19 +15,19 @@
|
||||
*/
|
||||
package com.intellij.ui.win;
|
||||
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.ReopenProjectAction;
|
||||
import com.intellij.idea.StartupUtil;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.wm.impl.SystemDock;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author Denis Fokin
|
||||
*/
|
||||
public class WinDockDelegate implements SystemDock.Delegate {
|
||||
|
||||
private static final String javaExe = System.getProperty("java.home") + File.separatorChar + "bin" + File.separatorChar + "javaw.exe";
|
||||
private static final String argsToExecute = " -classpath \"" +
|
||||
PathManager.getJarPathForClass(SocketControlHelper.class) +
|
||||
@@ -40,8 +40,9 @@ public class WinDockDelegate implements SystemDock.Delegate {
|
||||
|
||||
private WinDockDelegate() {}
|
||||
|
||||
@Override
|
||||
public void updateRecentProjectsMenu () {
|
||||
final AnAction[] recentProjectActions = RecentProjectsManagerBase.getInstance().getRecentProjectsActions(false);
|
||||
final AnAction[] recentProjectActions = RecentProjectsManager.getInstance().getRecentProjectsActions(false);
|
||||
RecentTasks.clear();
|
||||
Task[] tasks = new Task[recentProjectActions.length];
|
||||
for (int i = 0; i < recentProjectActions.length; i ++) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<xi:include href="/META-INF/VcsExtensions.xml" xpointer="xpointer(/idea-plugin/extensions/*)"/>
|
||||
<xi:include href="/META-INF/LangExtensions.xml" xpointer="xpointer(/idea-plugin/extensions/*)"/>
|
||||
|
||||
<applicationService serviceInterface="com.intellij.ide.RecentProjectsManagerBase"
|
||||
<applicationService serviceInterface="com.intellij.ide.RecentProjectsManager"
|
||||
serviceImplementation="com.intellij.ide.RecentDirectoryProjectsManagerEx"/>
|
||||
|
||||
<applicationService serviceInterface="com.intellij.packageDependencies.DependenciesVisitorFactory"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<xi:include href="/META-INF/PlatformExtensions.xml" xpointer="xpointer(/idea-plugin/extensions/*)"/>
|
||||
<xi:include href="/META-INF/VcsExtensions.xml" xpointer="xpointer(/idea-plugin/extensions/*)"/>
|
||||
|
||||
<applicationService serviceInterface="com.intellij.ide.RecentProjectsManagerBase"
|
||||
<applicationService serviceInterface="com.intellij.ide.RecentProjectsManager"
|
||||
serviceImplementation="com.intellij.ide.RecentDirectoryProjectsManager"/>
|
||||
|
||||
<applicationService serviceInterface="com.intellij.codeStyle.CodeStyleFacade"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.jetbrains.python.edu;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
@@ -33,7 +33,7 @@ public class StudyInitialConfigurator {
|
||||
final PropertiesComponent propertiesComponent,
|
||||
FileTypeManager fileTypeManager,
|
||||
final ProjectManagerEx projectManager,
|
||||
RecentProjectsManagerBase recentProjectsManager) {
|
||||
RecentProjectsManager recentProjectsManager) {
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED, false)) {
|
||||
final File file = new File(getCoursesRoot(), "introduction_course.zip");
|
||||
final File newCourses = new File(PathManager.getConfigPath(), "courses");
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.intellij.codeInsight.intention.IntentionActionBean;
|
||||
import com.intellij.codeInsight.intention.IntentionManager;
|
||||
import com.intellij.ide.AppLifecycleListener;
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.SelectInTarget;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
@@ -86,7 +86,7 @@ public class PyCharmEduInitialConfigurator {
|
||||
final PropertiesComponent propertiesComponent,
|
||||
FileTypeManager fileTypeManager,
|
||||
final ProjectManagerEx projectManager,
|
||||
RecentProjectsManagerBase recentProjectsManager) {
|
||||
RecentProjectsManager recentProjectsManager) {
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED, false)) {
|
||||
propertiesComponent.setValue(CONFIGURED, "true");
|
||||
propertiesComponent.setValue("toolwindow.stripes.buttons.info.shown", "true");
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
*/
|
||||
package com.jetbrains.python.newProject.actions;
|
||||
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.util.projectWizard.WebProjectTemplate;
|
||||
import com.intellij.internal.statistic.UsageTrigger;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
@@ -134,7 +133,7 @@ public class GenerateProjectCallback implements NullableConsumer<AbstractProject
|
||||
String generatorName = generator == null ? "empty" : ConvertUsagesUtil.ensureProperKey(generator.getName());
|
||||
UsageTrigger.trigger("NewDirectoryProjectAction." + generatorName);
|
||||
|
||||
RecentProjectsManagerBase.getInstance().setLastProjectCreationLocation(location.getParent());
|
||||
RecentProjectsManager.getInstance().setLastProjectCreationLocation(location.getParent());
|
||||
|
||||
return PlatformProjectOpenProcessor.doOpenProject(baseDir, null, false, -1, new ProjectOpenedCallback() {
|
||||
@Override
|
||||
|
||||
@@ -111,8 +111,8 @@
|
||||
<compiler implementation="com.intellij.packaging.impl.compiler.ArtifactsCompiler" id="artifactsCompiler"/>
|
||||
<gotoRelatedProvider implementation="com.intellij.testIntegration.GotoTestRelatedProvider"/>
|
||||
|
||||
<applicationService serviceInterface="com.intellij.ide.RecentProjectsManagerBase"
|
||||
serviceImplementation="com.intellij.ide.RecentProjectsManager"/>
|
||||
<applicationService serviceInterface="com.intellij.ide.RecentProjectsManager"
|
||||
serviceImplementation="com.intellij.ide.RecentProjectsManagerImpl"/>
|
||||
|
||||
<applicationService serviceInterface="com.intellij.util.descriptors.ConfigFileFactory"
|
||||
serviceImplementation="com.intellij.util.descriptors.impl.ConfigFileFactoryImpl"/>
|
||||
|
||||
Reference in New Issue
Block a user