mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'idea90' of git.labs.intellij.net:idea/community into idea90
This commit is contained in:
@@ -231,7 +231,7 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable,
|
||||
setBeforeRunTasks(configuration, tasks);
|
||||
}
|
||||
|
||||
void checkRecentsLimit() {
|
||||
void checkRecentsLimit() {
|
||||
while (getTempConfigurations().length > getConfig().getRecentsLimit()) {
|
||||
for (Iterator<Map.Entry<String, RunnerAndConfigurationSettingsImpl>> it = myConfigurations.entrySet().iterator(); it.hasNext();) {
|
||||
Map.Entry<String, RunnerAndConfigurationSettingsImpl> entry = it.next();
|
||||
@@ -351,7 +351,7 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable,
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
addConfigurationElement(parentNode, runnerAndConfigurationSettings);
|
||||
}
|
||||
|
||||
@@ -440,17 +440,33 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable,
|
||||
public void readExternal(final Element parentNode) throws InvalidDataException {
|
||||
clear();
|
||||
|
||||
final Comparator<Element> comparator = new Comparator<Element>() {
|
||||
public int compare(Element a, Element b) {
|
||||
final boolean aDefault = Boolean.valueOf(a.getAttributeValue("default", "false"));
|
||||
final boolean bDefault = Boolean.valueOf(b.getAttributeValue("default", "false"));
|
||||
return aDefault == bDefault ? 0 : aDefault ? -1 : 1;
|
||||
}
|
||||
};
|
||||
|
||||
final List children = parentNode.getChildren();
|
||||
final List<Element> sortedElements = new ArrayList<Element>();
|
||||
for (final Object aChildren : children) {
|
||||
final Element element = (Element)aChildren;
|
||||
if (loadConfiguration(element, false) == null && Comparing.strEqual(element.getName(), CONFIGURATION)) {
|
||||
if (Comparing.strEqual(element.getName(), CONFIGURATION)) {
|
||||
sortedElements.add(element);
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(sortedElements, comparator); // ensure templates are loaded first!
|
||||
|
||||
for (final Element element : sortedElements) {
|
||||
if (loadConfiguration(element, false) == null) {
|
||||
if (myUnloadedElements == null) myUnloadedElements = new ArrayList<Element>(2);
|
||||
myUnloadedElements.add(element);
|
||||
}
|
||||
}
|
||||
|
||||
myOrder.readExternal(parentNode);
|
||||
|
||||
mySelectedConfig = parentNode.getAttributeValue(SELECTED_ATTR);
|
||||
}
|
||||
|
||||
@@ -551,7 +567,7 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable,
|
||||
@Nullable
|
||||
private static ConfigurationFactory findFactoryOfTypeByName(final ConfigurationType type, final String factoryName) {
|
||||
if (factoryName == null) return null;
|
||||
|
||||
|
||||
if (type instanceof UnknownConfigurationType) {
|
||||
return type.getConfigurationFactories()[0];
|
||||
}
|
||||
|
||||
+15
-11
@@ -19,17 +19,16 @@ import com.intellij.ide.AppLifecycleListener;
|
||||
import com.intellij.ide.highlighter.WorkspaceFileType;
|
||||
import com.intellij.ide.impl.ProjectUtil;
|
||||
import com.intellij.ide.startup.impl.StartupManagerImpl;
|
||||
import com.intellij.notification.*;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.*;
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx;
|
||||
import com.intellij.openapi.application.impl.ApplicationImpl;
|
||||
import com.intellij.openapi.components.ExportableApplicationComponent;
|
||||
import com.intellij.openapi.components.StateStorage;
|
||||
import com.intellij.openapi.components.TrackingPathMacroSubstitutor;
|
||||
import com.intellij.openapi.components.impl.stores.*;
|
||||
import com.intellij.openapi.components.impl.stores.IComponentStore;
|
||||
import com.intellij.openapi.components.impl.stores.IProjectStore;
|
||||
import com.intellij.openapi.components.impl.stores.StorageUtil;
|
||||
import com.intellij.openapi.components.impl.stores.XmlElementStorage;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
@@ -45,7 +44,6 @@ import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileEvent;
|
||||
@@ -66,7 +64,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
@@ -597,7 +594,10 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt
|
||||
for (String component : components) {
|
||||
message += component + "\n";
|
||||
}
|
||||
message += "Shutdown IDEA?";
|
||||
|
||||
final boolean canRestart = ApplicationManager.getApplication().isRestartCapable();
|
||||
message += "Would you like to " + (canRestart ? "restart " : "shutdown ");
|
||||
message += ApplicationNamesInfo.getInstance().getProductName() + "?";
|
||||
|
||||
if (Messages.showYesNoDialog(message,
|
||||
"Application Configuration Reload", Messages.getQuestionIcon()) == 0) {
|
||||
@@ -607,9 +607,13 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt
|
||||
((XmlElementStorage)stateStorage).disableSaving();
|
||||
}
|
||||
}
|
||||
ApplicationManagerEx.getApplicationEx().exit(true);
|
||||
if (canRestart) {
|
||||
ApplicationManagerEx.getApplicationEx().restart();
|
||||
}
|
||||
else {
|
||||
ApplicationManagerEx.getApplicationEx().exit(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return reloadOk[0];
|
||||
|
||||
Reference in New Issue
Block a user