diff --git a/platform/lang-impl/src/com/intellij/application/options/InitialConfigurationDialog.java b/platform/lang-impl/src/com/intellij/application/options/InitialConfigurationDialog.java
index 2c7ef8801929..5df38fa51864 100644
--- a/platform/lang-impl/src/com/intellij/application/options/InitialConfigurationDialog.java
+++ b/platform/lang-impl/src/com/intellij/application/options/InitialConfigurationDialog.java
@@ -284,7 +284,7 @@ public class InitialConfigurationDialog extends DialogWrapper {
private static boolean matchesPlatform(Keymap keymap) {
final String name = keymap.getName();
if (KeymapManager.DEFAULT_IDEA_KEYMAP.equals(name)) {
- return !SystemInfo.isMac && !SystemInfo.isLinux;
+ return SystemInfo.isWindows;
}
else if (KeymapManager.MAC_OS_X_KEYMAP.equals(name) || "Mac OS X 10.5+".equals(name)) {
return SystemInfo.isMac;
diff --git a/platform/platform-api/src/com/intellij/ui/ScreenUtil.java b/platform/platform-api/src/com/intellij/ui/ScreenUtil.java
index b227d68469cf..0de33ee14d96 100644
--- a/platform/platform-api/src/com/intellij/ui/ScreenUtil.java
+++ b/platform/platform-api/src/com/intellij/ui/ScreenUtil.java
@@ -116,7 +116,7 @@ public class ScreenUtil {
private static Insets calcInsets(GraphicsConfiguration gc) {
Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
- if (SystemInfo.isLinux && GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices().length > 1) {
+ if (SystemInfo.isXWindow && GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices().length > 1) {
return fixGlobalInsets(gc.getBounds(), insets);
}
return insets;
diff --git a/platform/platform-impl/src/com/intellij/execution/process/RunnerMediator.java b/platform/platform-impl/src/com/intellij/execution/process/RunnerMediator.java
index a72ce100a38d..15cd965cd8a5 100644
--- a/platform/platform-impl/src/com/intellij/execution/process/RunnerMediator.java
+++ b/platform/platform-impl/src/com/intellij/execution/process/RunnerMediator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2012 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.
@@ -68,7 +68,7 @@ public class RunnerMediator {
*
*/
public ProcessHandler createProcess(@NotNull GeneralCommandLine commandLine) throws ExecutionException {
- if (isWindows()) {
+ if (SystemInfo.isWindows) {
injectRunnerCommand(commandLine);
}
@@ -87,8 +87,8 @@ public class RunnerMediator {
}
@Nullable
- private String getRunnerPath() {
- if (isWindows()) {
+ private static String getRunnerPath() {
+ if (SystemInfo.isWindows) {
final String path = System.getenv("IDEA_RUNNERW");
if (path != null && new File(path).exists()) {
return path;
@@ -103,7 +103,7 @@ public class RunnerMediator {
}
}
- private void injectRunnerCommand(@NotNull GeneralCommandLine commandLine) {
+ private static void injectRunnerCommand(@NotNull GeneralCommandLine commandLine) {
final String path = getRunnerPath();
if (path != null) {
commandLine.getParametersList().addAt(0, commandLine.getExePath());
@@ -111,28 +111,27 @@ public class RunnerMediator {
}
}
+ /** @deprecated use {@link SystemInfo#isUnix} (to remove in IDEA 13) */
public static boolean isUnix() {
- return SystemInfo.isLinux || SystemInfo.isMac;
+ return SystemInfo.isUnix;
}
+ /** @deprecated use {@link SystemInfo#isWindows} (to remove in IDEA 13) */
public static boolean isWindows() {
- if (File.separatorChar == '\\') {
- return true;
- }
- return false;
+ return SystemInfo.isWindows;
}
/**
* Destroys process tree: in case of windows via imitating ctrl+break, in case of unix via sending sig_kill to every process in tree.
- * @param process to kill with all subprocesses
+ * @param process to kill with all sub-processes.
*/
public static boolean destroyProcess(Process process) {
try {
- if (isWindows()) {
+ if (SystemInfo.isWindows) {
sendCtrlBreakThroughStream(process);
return true;
}
- else if (isUnix()) {
+ else if (SystemInfo.isUnix) {
return UnixProcessManager.sendSigKillToProcessTree(process);
}
else {
@@ -145,14 +144,8 @@ public class RunnerMediator {
}
}
- /**
- *
- */
public static class CustomDestroyProcessHandler extends ColoredProcessHandler {
-
-
- public CustomDestroyProcessHandler(@NotNull Process process,
- @NotNull GeneralCommandLine commandLine) {
+ public CustomDestroyProcessHandler(@NotNull Process process, @NotNull GeneralCommandLine commandLine) {
super(process, commandLine.getCommandLineString());
}
diff --git a/platform/platform-impl/src/com/intellij/ide/ClipboardSynchronizer.java b/platform/platform-impl/src/com/intellij/ide/ClipboardSynchronizer.java
index 93dc80afd7c8..19e954176a6e 100644
--- a/platform/platform-impl/src/com/intellij/ide/ClipboardSynchronizer.java
+++ b/platform/platform-impl/src/com/intellij/ide/ClipboardSynchronizer.java
@@ -47,7 +47,7 @@ import java.util.Set;
*
* - for Macs we perform synchronization with system clipboard on a separate thread and schedule it when IDEA frame is activated
* or Copy/Cut action in Swing component is invoked, and use native method calls to access system clipboard lock-free (?);
- * - for Linux we temporary set short timeout and check for available formats (which should be fast if a clipboard owner is alive).
+ * - for X Window we temporary set short timeout and check for available formats (which should be fast if a clipboard owner is alive).
*
*
*
@@ -73,8 +73,8 @@ public class ClipboardSynchronizer implements ApplicationComponent {
else if (Patches.SLOW_GETTING_CLIPBOARD_CONTENTS && SystemInfo.isMac) {
myClipboardHandler = new MacClipboardHandler();
}
- else if (Patches.SLOW_GETTING_CLIPBOARD_CONTENTS && SystemInfo.isLinux) {
- myClipboardHandler = new LinuxClipboardHandler();
+ else if (Patches.SLOW_GETTING_CLIPBOARD_CONTENTS && SystemInfo.isXWindow) {
+ myClipboardHandler = new XWinClipboardHandler();
}
else {
myClipboardHandler = new ClipboardHandler();
@@ -304,7 +304,7 @@ public class ClipboardSynchronizer implements ApplicationComponent {
return result;
}
- private static class LinuxClipboardHandler extends ClipboardHandler {
+ private static class XWinClipboardHandler extends ClipboardHandler {
private static final FlavorTable FLAVOR_MAP = (FlavorTable)SystemFlavorMap.getDefaultFlavorMap();
private volatile Transferable myCurrentContent = null;
diff --git a/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java b/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java
index 44e9fc5431a1..b04f500e2fc8 100644
--- a/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java
+++ b/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java
@@ -422,7 +422,7 @@ public final class LafManagerImpl extends LafManager implements ApplicationCompo
private boolean checkLookAndFeel(final UIManager.LookAndFeelInfo lafInfo, final boolean confirm) {
String message = null;
- if (lafInfo.getName().contains("GTK") && SystemInfo.isLinux && !SystemInfo.isJavaVersionAtLeast("1.6.0_12")) {
+ if (lafInfo.getName().contains("GTK") && SystemInfo.isXWindow && !SystemInfo.isJavaVersionAtLeast("1.6.0_12")) {
message = IdeBundle.message("warning.problem.laf.1");
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java b/platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java
index 0846c94b283e..dabf0f21b10d 100644
--- a/platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java
+++ b/platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java
@@ -547,7 +547,7 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme {
private static String getDefaultFontName() {
if (SystemInfo.isMacOSSnowLeopard) return "Menlo";
- if (SystemInfo.isLinux) {
+ if (SystemInfo.isXWindow) {
for (Font font : GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts()) {
if ("DejaVu Sans Mono".equals(font.getName())) {
return font.getFontName();
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/DefaultKeymap.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/DefaultKeymap.java
index d9840e39b9eb..f1ecd44b3fa1 100644
--- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/DefaultKeymap.java
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/DefaultKeymap.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2012 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.
@@ -88,7 +88,7 @@ public class DefaultKeymap {
if (SystemInfo.isMac) {
return KeymapManager.MAC_OS_X_KEYMAP;
}
- else if (SystemInfo.isLinux) {
+ else if (SystemInfo.isXWindow) {
return KeymapManager.X_WINDOW_KEYMAP;
}
else {
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcher.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcher.java
index 0bd8463fc6e8..545500d48df3 100644
--- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcher.java
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcher.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2012 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.
@@ -139,7 +139,7 @@ public final class IdeMouseEventDispatcher {
}
}
- if (SystemInfo.isLinux && e.isPopupTrigger() && e.getButton() != 3) {
+ if (SystemInfo.isXWindow && e.isPopupTrigger() && e.getButton() != 3) {
// we can do better than silly triggering popup on everything but left click
resetPopupTrigger(e);
}
diff --git a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java
index 63896a69f2d6..e036a1beb2ff 100644
--- a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java
+++ b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java
@@ -1126,7 +1126,7 @@ public class AbstractPopup implements JBPopup {
private PopupComponent.Factory getFactory(boolean forceHeavyweight, boolean forceDialog) {
boolean noFocus = !myFocusable || !myRequestFocus;
- boolean cannotBeDialog = noFocus && SystemInfo.isLinux;
+ boolean cannotBeDialog = noFocus && SystemInfo.isXWindow;
if (!cannotBeDialog && (isPersistent() || forceDialog)) {
return new PopupComponent.Factory.Dialog();
diff --git a/platform/util/src/com/intellij/openapi/util/SystemInfo.java b/platform/util/src/com/intellij/openapi/util/SystemInfo.java
index d6a50cf0b273..0d4e0795bd16 100644
--- a/platform/util/src/com/intellij/openapi/util/SystemInfo.java
+++ b/platform/util/src/com/intellij/openapi/util/SystemInfo.java
@@ -65,7 +65,7 @@ public class SystemInfo extends SystemInfoRt {
public static final boolean isMacIntel64 = isMac && "x86_64".equals(OS_ARCH);
/** @deprecated use {@linkplain #hasXdgOpen()} (to remove in IDEA 13) */
- public static final boolean hasXdgOpen = isLinux;
+ public static final boolean hasXdgOpen = isXWindow;
private static final NotNullLazyValue ourHasXdgOpen = new AtomicNotNullLazyValue() {
@NotNull
@Override
diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java
index a60ff1b034c7..9e311d9c7a72 100644
--- a/platform/util/src/com/intellij/util/ui/UIUtil.java
+++ b/platform/util/src/com/intellij/util/ui/UIUtil.java
@@ -74,7 +74,7 @@ public class UIUtil {
@NotNull
@Override
protected Boolean compute() {
- if (!SystemInfo.isLinux) {
+ if (!SystemInfo.isXWindow) {
return false;
}
try {
diff --git a/plugins/devkit/src/run/PluginRunConfiguration.java b/plugins/devkit/src/run/PluginRunConfiguration.java
index f8fe6a24f2e7..c52358584da6 100644
--- a/plugins/devkit/src/run/PluginRunConfiguration.java
+++ b/plugins/devkit/src/run/PluginRunConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2012 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.
@@ -138,7 +138,7 @@ public class PluginRunConfiguration extends RunConfigurationBase implements Modu
vm.defineProperty("apple.laf.useScreenMenuBar", "true");
}
- if (SystemInfo.isLinux) {
+ if (SystemInfo.isXWindow) {
if (VM_PARAMETERS == null || !VM_PARAMETERS.contains("-Dsun.awt.disablegrab")) {
vm.defineProperty("sun.awt.disablegrab", "true"); // See http://devnet.jetbrains.net/docs/DOC-1142
}
diff --git a/xml/impl/src/com/intellij/ide/browsers/BrowsersConfiguration.java b/xml/impl/src/com/intellij/ide/browsers/BrowsersConfiguration.java
index 6ea712744ba0..81ede1c506c1 100644
--- a/xml/impl/src/com/intellij/ide/browsers/BrowsersConfiguration.java
+++ b/xml/impl/src/com/intellij/ide/browsers/BrowsersConfiguration.java
@@ -66,18 +66,18 @@ public class BrowsersConfiguration implements PersistentStateComponent
private final String myName;
private final String myWindowsPath;
- private final String myLinuxPath;
+ private final String myUnixPath;
private final String myMacPath;
private final Icon myIcon;
BrowserFamily(final String name,
@NonNls final String windowsPath,
- @NonNls final String linuxPath,
+ @NonNls final String unixPath,
@NonNls final String macPath,
final Icon icon) {
myName = name;
myWindowsPath = windowsPath;
- myLinuxPath = linuxPath;
+ myUnixPath = unixPath;
myMacPath = macPath;
myIcon = icon;
}
@@ -92,12 +92,12 @@ public class BrowsersConfiguration implements PersistentStateComponent
if (SystemInfo.isWindows) {
return myWindowsPath;
}
- else if (SystemInfo.isLinux) {
- return myLinuxPath;
- }
else if (SystemInfo.isMac) {
return myMacPath;
}
+ else if (SystemInfo.isUnix) {
+ return myUnixPath;
+ }
return null;
}