mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
prefer to use SystemInfoRt
GitOrigin-RevId: 72aa33bf5d46456a63f1128c829468f373ffec84
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2d5b9fc73a
commit
6a68c1583a
@@ -11,7 +11,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
@@ -49,7 +49,7 @@ public final class EditExternallyAction extends AnAction {
|
||||
if (files != null) {
|
||||
Map<String, String> env = EnvironmentUtil.getEnvironmentMap();
|
||||
for (String varName : env.keySet()) {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
executablePath = StringUtil.replace(executablePath, "%" + varName + "%", env.get(varName), true);
|
||||
}
|
||||
else {
|
||||
@@ -60,7 +60,7 @@ public final class EditExternallyAction extends AnAction {
|
||||
File executable = new File(executablePath);
|
||||
GeneralCommandLine commandLine = new GeneralCommandLine();
|
||||
final String path = executable.exists() ? executable.getAbsolutePath() : executablePath;
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
commandLine.setExePath(ExecUtil.getOpenCommandPath());
|
||||
commandLine.addParameter("-a");
|
||||
commandLine.addParameter(path);
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.intellij.images.fileTypes;
|
||||
|
||||
import com.intellij.lang.documentation.AbstractDocumentationProvider;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileWithId;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -54,7 +40,7 @@ public class ImageDocumentationProvider extends AbstractDocumentationProvider {
|
||||
}
|
||||
try {
|
||||
String path = file1.getPath();
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
path = "/" + path;
|
||||
}
|
||||
final String url = new URI("file", null, path, null).toString();
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.NullableComputable;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -79,7 +79,7 @@ final class ImagesOptionsComponent {
|
||||
|
||||
ImagesOptionsComponent() {
|
||||
|
||||
wheelZooming.setText(ImagesBundle.message("enable.mousewheel.zooming", SystemInfo.isMac ? "Cmd" : "Ctrl"));
|
||||
wheelZooming.setText(ImagesBundle.message("enable.mousewheel.zooming", SystemInfoRt.isMac ? "Cmd" : "Ctrl"));
|
||||
|
||||
// Setup labels
|
||||
gridLineZoomFactorLabel.setLabelFor(gridLineZoomFactor);
|
||||
@@ -250,7 +250,7 @@ final class ImagesOptionsComponent {
|
||||
final String path = FileUtil.toSystemIndependentName(externalEditorPath.getText());
|
||||
return LocalFileSystem.getInstance().refreshAndFindFileByPath(path);
|
||||
});
|
||||
FileChooserDescriptor fileDescriptor = new FileChooserDescriptor(true, SystemInfo.isMac, false, false, false, false);
|
||||
FileChooserDescriptor fileDescriptor = new FileChooserDescriptor(true, SystemInfoRt.isMac, false, false, false, false);
|
||||
fileDescriptor.setShowFileSystemRoots(true);
|
||||
fileDescriptor.setTitle(ImagesBundle.message("select.external.executable.title"));
|
||||
fileDescriptor.setDescription(ImagesBundle.message("select.external.executable.message"));
|
||||
|
||||
@@ -397,7 +397,7 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements
|
||||
String compilerHome = System.getProperty(TESTS_EXTERNAL_COMPILER_HOME_PROPERTY_NAME, null);
|
||||
if (compilerHome == null) {
|
||||
File javaHome = new File(System.getProperty("java.home"));
|
||||
if (SystemInfo.isMac || !new File(javaHome.getParentFile(), "bin").exists()) {
|
||||
if (SystemInfoRt.isMac || !new File(javaHome.getParentFile(), "bin").exists()) {
|
||||
compilerHome = javaHome.getAbsolutePath();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1097,7 +1097,7 @@ public class BuildManager implements Disposable {
|
||||
cmdLine.addParameter("-Xmx" + heapSize + "m");
|
||||
}
|
||||
|
||||
if (SystemInfo.isMac && sdkVersion != null && JavaSdkVersion.JDK_1_6.equals(sdkVersion) && Registry.is("compiler.process.32bit.vm.on.mac")) {
|
||||
if (SystemInfoRt.isMac && sdkVersion != null && JavaSdkVersion.JDK_1_6.equals(sdkVersion) && Registry.is("compiler.process.32bit.vm.on.mac")) {
|
||||
// unfortunately -d32 is supported on jdk 1.6 only
|
||||
cmdLine.addParameter("-d32");
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.compiler.artifacts;
|
||||
|
||||
import com.intellij.compiler.CompilerTestUtil;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -160,7 +161,7 @@ public class ArtifactCompileScopeTest extends ArtifactCompilerTestCase {
|
||||
|
||||
private static void ensureTimeChanged() {
|
||||
//ensure that compiler will threat the file as changed. On Linux system timestamp may be rounded to multiple of 1000
|
||||
if (SystemInfo.isLinux) {
|
||||
if (SystemInfoRt.isLinux) {
|
||||
TimeoutUtil.sleep(1100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.debugger.impl;
|
||||
|
||||
import com.intellij.debugger.DebuggerBundle;
|
||||
@@ -21,7 +21,7 @@ import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.JdkUtil;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.ex.JavaSdkUtil;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -39,7 +39,7 @@ import java.util.jar.Attributes;
|
||||
*/
|
||||
public class RemoteConnectionBuilder {
|
||||
private static final Logger LOG = Logger.getInstance(RemoteConnectionBuilder.class);
|
||||
|
||||
|
||||
private final int myTransport;
|
||||
private final boolean myServer;
|
||||
private final String myAddress;
|
||||
@@ -73,7 +73,7 @@ public class RemoteConnectionBuilder {
|
||||
myQuiet = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public RemoteConnection create(JavaParameters parameters) throws ExecutionException {
|
||||
if (myCheckValidity) {
|
||||
checkTargetJPDAInstalled(parameters);
|
||||
@@ -172,7 +172,7 @@ public class RemoteConnectionBuilder {
|
||||
String versionString = jdk.getVersionString();
|
||||
throw new ExecutionException(DebuggerBundle.message("error.unsupported.jdk.version", versionString));
|
||||
}
|
||||
if (SystemInfo.isWindows && version == JavaSdkVersion.JDK_1_2) {
|
||||
if (SystemInfoRt.isWindows && version == JavaSdkVersion.JDK_1_2) {
|
||||
final VirtualFile homeDirectory = jdk.getHomeDirectory();
|
||||
if (homeDirectory == null || !homeDirectory.isValid()) {
|
||||
String versionString = jdk.getVersionString();
|
||||
@@ -258,7 +258,7 @@ public class RemoteConnectionBuilder {
|
||||
* for Target JDKs versions 1.2.x - 1.3.0 the Classic VM should be used for debugging
|
||||
*/
|
||||
private static boolean shouldForceClassicVM(Sdk jdk) {
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
return false;
|
||||
}
|
||||
if (jdk == null) return false;
|
||||
@@ -268,14 +268,14 @@ public class RemoteConnectionBuilder {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (version.startsWith("1.2") && SystemInfo.isWindows) {
|
||||
if (version.startsWith("1.2") && SystemInfoRt.isWindows) {
|
||||
return true;
|
||||
}
|
||||
version += ".0";
|
||||
if (version.startsWith("1.3.0") && SystemInfo.isWindows) {
|
||||
if (version.startsWith("1.3.0") && SystemInfoRt.isWindows) {
|
||||
return true;
|
||||
}
|
||||
if ((version.startsWith("1.3.1_07") || version.startsWith("1.3.1_08")) && SystemInfo.isWindows) {
|
||||
if ((version.startsWith("1.3.1_07") || version.startsWith("1.3.1_08")) && SystemInfoRt.isWindows) {
|
||||
return false; // fixes bug for these JDKs that it cannot start with -classic option
|
||||
}
|
||||
return DebuggerSettings.getInstance().FORCE_CLASSIC_VM;
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.intellij.openapi.projectRoots.JdkUtil;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.util.Bitness;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -172,7 +172,7 @@ public class MemoryAgentUtil {
|
||||
}
|
||||
|
||||
public static boolean isPlatformSupported() {
|
||||
return SystemInfo.isWindows || SystemInfo.isMac || SystemInfo.isLinux;
|
||||
return SystemInfoRt.isWindows || SystemInfoRt.isMac || SystemInfoRt.isLinux;
|
||||
}
|
||||
|
||||
private static boolean isIbmJdk(@NotNull JavaParameters parameters) {
|
||||
@@ -198,8 +198,8 @@ public class MemoryAgentUtil {
|
||||
|
||||
private static AgentExtractor.AgentLibraryType detectAgentKind(String jdkPath) {
|
||||
LOG.assertTrue(isPlatformSupported());
|
||||
if (SystemInfo.isLinux) return AgentExtractor.AgentLibraryType.LINUX;
|
||||
if (SystemInfo.isMac) return AgentExtractor.AgentLibraryType.MACOS;
|
||||
if (SystemInfoRt.isLinux) return AgentExtractor.AgentLibraryType.LINUX;
|
||||
if (SystemInfoRt.isMac) return AgentExtractor.AgentLibraryType.MACOS;
|
||||
JdkVersionDetector.JdkVersionInfo versionInfo = JdkVersionDetector.getInstance().detectJdkVersionInfo(jdkPath);
|
||||
if (versionInfo == null) {
|
||||
LOG.warn("Could not detect jdk bitness. x64 will be used.");
|
||||
|
||||
@@ -4,7 +4,7 @@ package com.intellij.debugger.settings;
|
||||
import com.intellij.debugger.DebuggerBundle;
|
||||
import com.intellij.debugger.memory.agent.MemoryAgentUtil;
|
||||
import com.intellij.openapi.options.ConfigurableUi;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.ui.StateRestoringCheckBox;
|
||||
import com.intellij.ui.components.panels.VerticalBox;
|
||||
@@ -27,7 +27,7 @@ class DebuggerLaunchingConfigurable implements ConfigurableUi<DebuggerSettings>
|
||||
|
||||
@Override
|
||||
public void reset(@NotNull DebuggerSettings settings) {
|
||||
if (!SystemInfo.isWindows) {
|
||||
if (!SystemInfoRt.isWindows) {
|
||||
myRbSocket.setSelected(true);
|
||||
myRbShmem.setEnabled(false);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.components.State;
|
||||
import com.intellij.openapi.components.Storage;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.classFilter.ClassFilter;
|
||||
import com.intellij.util.EventDispatcher;
|
||||
@@ -340,7 +340,7 @@ public class DebuggerSettings implements Cloneable, PersistentStateComponent<Ele
|
||||
|
||||
@Transient
|
||||
public int getTransport() {
|
||||
if (!SystemInfo.isWindows) {
|
||||
if (!SystemInfoRt.isWindows) {
|
||||
return SOCKET_TRANSPORT;
|
||||
}
|
||||
return DEBUGGER_TRANSPORT;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution.remote;
|
||||
|
||||
import com.intellij.application.options.ModuleDescriptionsComboBox;
|
||||
@@ -14,7 +14,7 @@ import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.ui.ComponentValidator;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.openapi.ui.ValidationInfo;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
import com.intellij.ui.JBColor;
|
||||
@@ -259,14 +259,14 @@ public class RemoteConfigurable extends SettingsEditor<RemoteConfiguration> {
|
||||
myModeCombo.setSelectedItem(rc.SERVER_MODE ? Mode.LISTEN : Mode.ATTACH);
|
||||
myAutoRestart.setSelected(rc.AUTO_RESTART);
|
||||
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
myTransportCombo.setSelectedItem(rc.USE_SOCKET_TRANSPORT ? Transport.SOCKET : Transport.SHMEM);
|
||||
if (!rc.USE_SOCKET_TRANSPORT) {
|
||||
myAddress.setText(rc.SHMEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
if (!SystemInfo.isWindows || rc.USE_SOCKET_TRANSPORT) {
|
||||
if (!SystemInfoRt.isWindows || rc.USE_SOCKET_TRANSPORT) {
|
||||
rc.USE_SOCKET_TRANSPORT = true;
|
||||
|
||||
myHostName.setText(rc.HOST);
|
||||
@@ -345,7 +345,7 @@ public class RemoteConfigurable extends SettingsEditor<RemoteConfiguration> {
|
||||
gc.insets = JBUI.emptyInsets();
|
||||
panel.add(new JPanel(), gc);
|
||||
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
JLabel addressLabel = createLabelFor("&Address:", myAddress);
|
||||
|
||||
addressLabel.setVisible(false);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution.runners;
|
||||
|
||||
import com.intellij.execution.process.BaseOSProcessHandler;
|
||||
@@ -8,7 +8,7 @@ import com.intellij.execution.process.UnixProcessManager;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.util.ThrowableRunnable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*/
|
||||
class ProcessProxyImpl implements ProcessProxy {
|
||||
static final Key<ProcessProxyImpl> KEY = Key.create("ProcessProxyImpl");
|
||||
private static final File ourBreakgenHelper = SystemInfo.isWindows ? PathManager.findBinFile("breakgen.dll") : null;
|
||||
private static final File ourBreakgenHelper = SystemInfoRt.isWindows ? PathManager.findBinFile("breakgen.dll") : null;
|
||||
|
||||
private final AsynchronousChannelGroup myGroup;
|
||||
private final int myPort;
|
||||
@@ -67,7 +67,7 @@ class ProcessProxyImpl implements ProcessProxy {
|
||||
processHandler.putUserData(KEY, this);
|
||||
execute(() -> {
|
||||
int pid = -1;
|
||||
if (SystemInfo.isUnix && processHandler instanceof BaseOSProcessHandler) {
|
||||
if (SystemInfoRt.isUnix && processHandler instanceof BaseOSProcessHandler) {
|
||||
pid = OSProcessUtil.getProcessID(((BaseOSProcessHandler)processHandler).getProcess());
|
||||
}
|
||||
synchronized (myLock) {
|
||||
@@ -86,7 +86,7 @@ class ProcessProxyImpl implements ProcessProxy {
|
||||
}
|
||||
|
||||
String getBinPath() {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
if (ourBreakgenHelper != null) {
|
||||
return ourBreakgenHelper.getParent();
|
||||
}
|
||||
@@ -96,14 +96,14 @@ class ProcessProxyImpl implements ProcessProxy {
|
||||
|
||||
@Override
|
||||
public boolean canSendBreak() {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
synchronized (myLock) {
|
||||
if (myConnection == null) return false;
|
||||
}
|
||||
return ourBreakgenHelper != null;
|
||||
}
|
||||
|
||||
if (SystemInfo.isUnix) {
|
||||
if (SystemInfoRt.isUnix) {
|
||||
synchronized (myLock) {
|
||||
return myPid > 0;
|
||||
}
|
||||
@@ -121,10 +121,10 @@ class ProcessProxyImpl implements ProcessProxy {
|
||||
|
||||
@Override
|
||||
public void sendBreak() {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
writeLine("BREAK");
|
||||
}
|
||||
else if (SystemInfo.isUnix) {
|
||||
else if (SystemInfoRt.isUnix) {
|
||||
int pid;
|
||||
synchronized (myLock) {
|
||||
pid = myPid;
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.intellij.openapi.projectRoots.ProjectJdkTable;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.ui.ComponentWithBrowseButton;
|
||||
import com.intellij.openapi.ui.TextComponentAccessor;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.GuiUtils;
|
||||
@@ -61,7 +61,7 @@ public class AlternativeJREPanel extends JPanel implements PanelWithAnchor {
|
||||
for (Sdk jdk : allJDKs) {
|
||||
String homePath = jdk.getHomePath();
|
||||
|
||||
if (!SystemInfo.isMac) {
|
||||
if (!SystemInfoRt.isMac) {
|
||||
final File jre = new File(jdk.getHomePath(), "jre");
|
||||
if (jre.isDirectory()) {
|
||||
homePath = jre.getPath();
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.intellij.openapi.ui.BrowseFolderRunnable;
|
||||
import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.*;
|
||||
@@ -79,7 +79,7 @@ public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWi
|
||||
for (Sdk jdk : allJDKs) {
|
||||
String homePath = jdk.getHomePath();
|
||||
|
||||
if (!SystemInfo.isMac) {
|
||||
if (!SystemInfoRt.isMac) {
|
||||
final File jre = new File(jdk.getHomePath(), "jre");
|
||||
if (jre.isDirectory()) {
|
||||
homePath = jre.getPath();
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.projectWizard;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
@@ -20,7 +6,7 @@ import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.popup.ListItemDescriptorAdapter;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.platform.ProjectTemplate;
|
||||
import com.intellij.platform.templates.ArchivedProjectTemplate;
|
||||
@@ -92,7 +78,7 @@ public class ProjectTemplateList extends JPanel {
|
||||
String description = template.getDescription();
|
||||
if (StringUtil.isNotEmpty(description)) {
|
||||
description = "<html><body><font " +
|
||||
(SystemInfo.isMac ? "" : "face=\"Verdana\" size=\"-1\"") + '>' + description +
|
||||
(SystemInfoRt.isMac ? "" : "face=\"Verdana\" size=\"-1\"") + '>' + description +
|
||||
"</font></body></html>";
|
||||
myDescriptionPane.setText(description);
|
||||
}
|
||||
|
||||
@@ -1,25 +1,11 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.util.projectWizard;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
|
||||
import java.io.File;
|
||||
@@ -58,7 +44,7 @@ public class ProjectWizardUtil {
|
||||
}
|
||||
}
|
||||
|
||||
if (SystemInfo.isUnix && !dir.canWrite()) {
|
||||
if (SystemInfoRt.isUnix && !dir.canWrite()) {
|
||||
Messages.showErrorDialog(IdeBundle.message("error.directory.read.only", dir.getPath()), CommonBundle.getErrorTitle());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* 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.
|
||||
* 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.roots.ui;
|
||||
|
||||
import com.intellij.openapi.module.Module;
|
||||
@@ -31,6 +17,7 @@ import com.intellij.openapi.roots.ui.util.CompositeAppearance;
|
||||
import com.intellij.openapi.roots.ui.util.SimpleTextCellAppearance;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
@@ -133,8 +120,8 @@ public class OrderEntryAppearanceServiceImpl extends OrderEntryAppearanceService
|
||||
String versionString = jdk.getVersionString();
|
||||
if (versionString != null && !versionString.equals(name)) {
|
||||
SimpleTextAttributes textAttributes = isInComboBox && !selected ? SimpleTextAttributes.SYNTHETIC_ATTRIBUTES :
|
||||
SystemInfo.isMac && selected ? new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,
|
||||
Color.WHITE): SimpleTextAttributes.GRAY_ATTRIBUTES;
|
||||
SystemInfoRt.isMac && selected ? new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,
|
||||
Color.WHITE) : SimpleTextAttributes.GRAY_ATTRIBUTES;
|
||||
ending.addComment(versionString, textAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2010 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.roots.ui.configuration.classpath;
|
||||
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
@@ -25,7 +11,7 @@ import com.intellij.openapi.roots.libraries.LibraryTable;
|
||||
import com.intellij.openapi.roots.ui.configuration.libraries.LibraryPresentationManager;
|
||||
import com.intellij.openapi.roots.ui.configuration.projectRoot.LibrariesModifiableModel;
|
||||
import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
import com.intellij.util.containers.Predicate;
|
||||
import com.intellij.util.ui.classpath.ChooseLibrariesFromTablesDialog;
|
||||
@@ -128,7 +114,7 @@ public class ProjectStructureChooseLibrariesDialog extends ChooseLibrariesFromTa
|
||||
@NotNull
|
||||
@Override
|
||||
protected Action[] createActions() {
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
return new Action[]{getCancelAction(), new CreateNewLibraryAction(), getOKAction()};
|
||||
}
|
||||
return new Action[]{getOKAction(), new CreateNewLibraryAction(), getCancelAction()};
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.roots.ui.configuration.libraryEditor;
|
||||
|
||||
import com.intellij.notification.Notification;
|
||||
@@ -24,7 +10,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.sun.jna.platform.mac.XAttrUtil;
|
||||
@@ -57,7 +43,7 @@ public class JavadocQuarantineStatusCleaner {
|
||||
private static final String QUARANTINE_ATTRIBUTE = "com.apple.quarantine";
|
||||
|
||||
public static void cleanIfNeeded(@NotNull VirtualFile... docFolders) {
|
||||
if (docFolders.length > 0 && SystemInfo.isMac) {
|
||||
if (docFolders.length > 0 && SystemInfoRt.isMac) {
|
||||
ApplicationManager.getApplication().executeOnPooledThread(() -> {
|
||||
List<String> quarantined = Stream.of(docFolders)
|
||||
.filter(f -> f.isInLocalFileSystem() && f.isDirectory() && XAttrUtil.getXAttr(f.getPath(), QUARANTINE_ATTRIBUTE) != null)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInsight.daemon.impl.quickfix;
|
||||
|
||||
import com.intellij.codeInsight.daemon.QuickFixBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.psi.PsiVariable;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -61,7 +61,7 @@ public class SideEffectWarningDialog extends DialogWrapper {
|
||||
AbstractAction makeStmtAction = new AbstractAction() {
|
||||
{
|
||||
UIUtil.setActionNameAndMnemonic(QuickFixBundle.message("side.effect.action.transform"), this);
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
putValue(FOCUSED_ACTION, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection.deadCode;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
|
||||
@@ -19,7 +19,7 @@ import com.intellij.openapi.application.ReadAction;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.AtomicNotNullLazyValue;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
@@ -302,7 +302,7 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
|
||||
|
||||
class CommentOutBin extends QuickFixAction {
|
||||
CommentOutBin(@NotNull InspectionToolWrapper toolWrapper) {
|
||||
super(COMMENT_OUT_QUICK_FIX, null, KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK),
|
||||
super(COMMENT_OUT_QUICK_FIX, null, KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, SystemInfoRt.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK),
|
||||
toolWrapper);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.javadoc;
|
||||
|
||||
import com.intellij.analysis.AnalysisScope;
|
||||
@@ -27,7 +27,7 @@ import com.intellij.openapi.projectRoots.ex.PathUtilEx;
|
||||
import com.intellij.openapi.roots.JavadocOrderRootType;
|
||||
import com.intellij.openapi.roots.OrderEnumerator;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
@@ -133,7 +133,7 @@ public class JavadocGeneratorRunProfile implements ModuleRunProfile {
|
||||
|
||||
cmdLine.setWorkDirectory((File)null);
|
||||
|
||||
String toolName = SystemInfo.isWindows ? "javadoc.exe" : "javadoc";
|
||||
String toolName = SystemInfoRt.isWindows ? "javadoc.exe" : "javadoc";
|
||||
File tool = new File(binPath, toolName);
|
||||
if (!tool.exists()) {
|
||||
tool = new File(new File(binPath).getParent(), toolName);
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.intellij.openapi.fileChooser.actions.FileChooserAction;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -78,7 +78,7 @@ public class JdkPopupAction extends AnAction {
|
||||
}
|
||||
|
||||
private static boolean isEnabledInCurrentOS() {
|
||||
return SystemInfo.isWindows;
|
||||
return SystemInfoRt.isWindows;
|
||||
}
|
||||
|
||||
private static void showPopupMenu(AnActionEvent e,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.projectRoots.impl;
|
||||
|
||||
import com.intellij.execution.configurations.GeneralCommandLine;
|
||||
@@ -6,7 +6,7 @@ import com.intellij.execution.util.ExecUtil;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.JdkUtil;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.SystemProperties;
|
||||
@@ -35,16 +35,16 @@ public abstract class JavaHomeFinder {
|
||||
protected abstract List<String> findExistingJdks();
|
||||
|
||||
private static JavaHomeFinder getFinder() {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
return new WindowsJavaFinder();
|
||||
}
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
return new MacFinder();
|
||||
}
|
||||
if (SystemInfo.isLinux) {
|
||||
if (SystemInfoRt.isLinux) {
|
||||
return new DefaultFinder("/usr/java", "/opt/java", "/usr/lib/jvm");
|
||||
}
|
||||
if (SystemInfo.isSolaris) {
|
||||
if (SystemInfoRt.isSolaris) {
|
||||
return new DefaultFinder("/usr/jdk");
|
||||
}
|
||||
return new DefaultFinder();
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.intellij.openapi.roots.JavadocOrderRootType;
|
||||
import com.intellij.openapi.roots.OrderRootType;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
@@ -47,7 +47,7 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
|
||||
public static final DataKey<Boolean> KEY = DataKey.create("JavaSdk");
|
||||
|
||||
private static final String VM_EXE_NAME = SystemInfo.isWindows ? "java.exe" : "java"; // do not use JavaW.exe because of issues with encoding
|
||||
private static final String VM_EXE_NAME = SystemInfoRt.isWindows ? "java.exe" : "java"; // do not use JavaW.exe because of issues with encoding
|
||||
|
||||
private final Map<String, String> myCachedSdkHomeToVersionString = new ConcurrentHashMap<>();
|
||||
private final Map<String, JavaVersion> myCachedVersionStringToJdkVersion = new ConcurrentHashMap<>();
|
||||
@@ -200,7 +200,7 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
@NotNull
|
||||
@Override
|
||||
public String adjustSelectedSdkHome(@NotNull String homePath) {
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
File home = new File(homePath, "/Home");
|
||||
if (home.exists()) return home.getPath();
|
||||
|
||||
@@ -532,7 +532,7 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
if (apiDocs != null) {
|
||||
sdkModificator.addRoot(apiDocs, docRootType);
|
||||
}
|
||||
else if (SystemInfo.isMac) {
|
||||
else if (SystemInfoRt.isMac) {
|
||||
VirtualFile commonDocs = findDocs(jdkHome, "docs");
|
||||
if (commonDocs == null) commonDocs = findInJar(new File(jdkHome, "docs.jar"), "doc/api");
|
||||
if (commonDocs == null) commonDocs = findInJar(new File(jdkHome, "docs.jar"), "docs/api");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.structureView.impl.java;
|
||||
|
||||
import com.intellij.ide.structureView.impl.common.PsiTreeElementBase;
|
||||
@@ -11,7 +11,7 @@ import com.intellij.openapi.actionSystem.KeyboardShortcut;
|
||||
import com.intellij.openapi.actionSystem.Shortcut;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.util.PropertyOwner;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.psi.PsiAnonymousClass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
@@ -60,7 +60,7 @@ public class JavaAnonymousClassesNodeProvider
|
||||
@NotNull
|
||||
@Override
|
||||
public Shortcut[] getShortcut() {
|
||||
return new Shortcut[]{KeyboardShortcut.fromString(SystemInfo.isMac ? "meta I" : "control I")};
|
||||
return new Shortcut[]{KeyboardShortcut.fromString(SystemInfoRt.isMac ? "meta I" : "control I")};
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.structureView.impl.java;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -25,7 +11,7 @@ import com.intellij.openapi.actionSystem.KeyboardShortcut;
|
||||
import com.intellij.openapi.actionSystem.Shortcut;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.util.PropertyOwner;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiLambdaExpression;
|
||||
import com.intellij.psi.PsiMember;
|
||||
@@ -64,7 +50,7 @@ public class JavaLambdaNodeProvider
|
||||
@NotNull
|
||||
@Override
|
||||
public Shortcut[] getShortcut() {
|
||||
return new Shortcut[]{KeyboardShortcut.fromString(SystemInfo.isMac ? "meta L" : "control L")};
|
||||
return new Shortcut[]{KeyboardShortcut.fromString(SystemInfoRt.isMac ? "meta L" : "control L")};
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -4,7 +4,7 @@ package com.intellij.java.openapi.vfs;
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -104,7 +104,7 @@ public class JrtFileSystemTest extends BareTestFixtureTestCase {
|
||||
List<VFileEvent> events = VfsTestUtil.getEvents(() -> local.refresh(false, true));
|
||||
Assertions.assertThat(childNames(myRoot)).describedAs("events=" + events).containsExactlyInAnyOrder("java.base", "test.a", "test.b");
|
||||
|
||||
if (SystemInfo.isUnix) {
|
||||
if (SystemInfoRt.isUnix) {
|
||||
Assertions.assertThat(FileUtil.delete(myTempPath.toFile())).isTrue();
|
||||
events = VfsTestUtil.getEvents(() -> local.refresh(false, true));
|
||||
Assertions.assertThat(myRoot.isValid()).describedAs("events=" + events).isFalse();
|
||||
@@ -119,7 +119,7 @@ public class JrtFileSystemTest extends BareTestFixtureTestCase {
|
||||
VirtualFilePointer[] pointers = {manager.create(vTemp, myDisposable, null), manager.create(myRoot, myDisposable, null)};
|
||||
assertPointers(pointers, true);
|
||||
|
||||
if (SystemInfo.isUnix) {
|
||||
if (SystemInfoRt.isUnix) {
|
||||
VirtualFile testRoot = vTemp.getParent();
|
||||
|
||||
Assertions.assertThat(FileUtil.delete(myTempPath.toFile())).isTrue();
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl;
|
||||
import com.intellij.openapi.roots.ModuleRootModificationUtil;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -387,5 +387,5 @@ public class FileManagerTest extends PsiTestCase {
|
||||
|
||||
// timestamps should differ by at least 2 sec (see JarFileInfo.initZipFile())
|
||||
// [dsl] unfortunately, 2000 is too small a value for Linux
|
||||
private static final int DELAY_FOR_JAR_MODIFICATION = SystemInfo.isWindows ? 3000 : 10000;
|
||||
private static final int DELAY_FOR_JAR_MODIFICATION = SystemInfoRt.isWindows ? 3000 : 10000;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.psi.jsp;
|
||||
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
@@ -22,7 +8,7 @@ import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.roots.OrderEnumerator;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiClass;
|
||||
@@ -198,7 +184,7 @@ public abstract class JspSpiUtil {
|
||||
}
|
||||
|
||||
String url;
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
url = "file:/" + path;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.debugger.impl;
|
||||
|
||||
import com.intellij.execution.process.ProcessOutputTypes;
|
||||
@@ -13,6 +13,7 @@ import com.intellij.openapi.projectRoots.ex.JavaSdkUtil;
|
||||
import com.intellij.openapi.projectRoots.impl.JavaAwareProjectJdkTableImpl;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
@@ -117,10 +118,10 @@ public class OutputChecker {
|
||||
|
||||
File outFile = getOutFile(outs, jdk, null, "");
|
||||
if (!outFile.exists()) {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
outFile = getOutFile(outs, jdk, outFile, ".win");
|
||||
}
|
||||
else if (SystemInfo.isUnix) {
|
||||
else if (SystemInfoRt.isUnix) {
|
||||
outFile = getOutFile(outs, jdk, outFile, ".unx");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.jps.javac;
|
||||
|
||||
import com.intellij.execution.process.*;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ConcurrencyUtil;
|
||||
@@ -31,7 +31,7 @@ import org.jetbrains.jps.builders.java.JavaCompilingTool;
|
||||
import org.jetbrains.jps.cmdline.ClasspathBootstrap;
|
||||
import org.jetbrains.jps.incremental.GlobalContextKey;
|
||||
|
||||
import javax.tools.Diagnostic;
|
||||
import javax.tools.*;
|
||||
import java.io.File;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
@@ -432,7 +432,7 @@ public class ExternalJavacManager extends ProcessAdapter {
|
||||
}
|
||||
|
||||
private static void appendParam(List<? super String> cmdLine, String parameter) {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
if (parameter.contains("\"")) {
|
||||
parameter = StringUtil.replace(parameter, "\"", "\\\"");
|
||||
}
|
||||
@@ -639,7 +639,7 @@ public class ExternalJavacManager extends ProcessAdapter {
|
||||
myHandler = handler;
|
||||
myDone.down();
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public UUID getId() {
|
||||
return myId;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.jps.model.java.impl;
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileFilters;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
@@ -27,7 +27,7 @@ public class JavaSdkUtil {
|
||||
@NotNull
|
||||
public static List<File> getJdkClassesRoots(@NotNull File home, boolean isJre) {
|
||||
File[] jarDirs;
|
||||
if (SystemInfo.isMac && !home.getName().startsWith("mockJDK")) {
|
||||
if (SystemInfoRt.isMac && !home.getName().startsWith("mockJDK")) {
|
||||
File openJdkRtJar = new File(home, "jre/lib/rt.jar");
|
||||
if (openJdkRtJar.isFile()) {
|
||||
File libDir = new File(home, "lib");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.jps.model.java.impl;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Bitness;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.util.io.BaseOutputReader;
|
||||
@@ -68,7 +68,7 @@ public class JdkVersionDetectorImpl extends JdkVersionDetector {
|
||||
String versionString = manifest.getMainAttributes().getValue("Implementation-Version");
|
||||
if (versionString != null) {
|
||||
JavaVersion version = JavaVersion.parse(versionString);
|
||||
boolean x64 = SystemInfo.isMac || new File(rtFile.getParent(), "amd64").isDirectory();
|
||||
boolean x64 = SystemInfoRt.isMac || new File(rtFile.getParent(), "amd64").isDirectory();
|
||||
return new JdkVersionInfo(version, x64 ? Bitness.x64 : Bitness.x32);
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public class JdkVersionDetectorImpl extends JdkVersionDetector {
|
||||
}
|
||||
|
||||
// last resort
|
||||
File javaExe = new File(homePath, "bin/" + (SystemInfo.isWindows ? "java.exe" : "java"));
|
||||
File javaExe = new File(homePath, "bin/" + (SystemInfoRt.isWindows ? "java.exe" : "java"));
|
||||
if (javaExe.canExecute()) {
|
||||
try {
|
||||
Process process = new ProcessBuilder(javaExe.getPath(), "-version").redirectErrorStream(true).start();
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.psi.impl.source.resolve.reference.impl.providers;
|
||||
|
||||
@@ -15,7 +13,7 @@ import com.intellij.openapi.fileTypes.FileTypeRegistry;
|
||||
import com.intellij.openapi.fileTypes.UnknownFileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.RecursionManager;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -264,7 +262,7 @@ public class FileReference implements PsiFileReference, FileReferenceOwner, PsiP
|
||||
|
||||
@NotNull
|
||||
public String decode(@NotNull String text) {
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
text = Normalizer.normalize(text, Normalizer.Form.NFC);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.vfs;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.roots.ContentIterator;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.BufferExposingByteArrayInputStream;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
@@ -489,7 +488,7 @@ public class VfsUtilCore {
|
||||
throw new RuntimeException(new IOException(VfsBundle.message("url.parse.error", url.toExternalForm())));
|
||||
}
|
||||
}
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
while (!path.isEmpty() && path.charAt(0) == '/') {
|
||||
path = path.substring(1);
|
||||
}
|
||||
@@ -576,11 +575,11 @@ public class VfsUtilCore {
|
||||
|
||||
if (uri.startsWith("file:///")) {
|
||||
uri = uri.substring("file:///".length());
|
||||
if (!SystemInfo.isWindows) uri = "/" + uri;
|
||||
if (!SystemInfoRt.isWindows) uri = "/" + uri;
|
||||
}
|
||||
else if (uri.startsWith("file:/")) {
|
||||
uri = uri.substring("file:/".length());
|
||||
if (!SystemInfo.isWindows) uri = "/" + uri;
|
||||
if (!SystemInfoRt.isWindows) uri = "/" + uri;
|
||||
}
|
||||
else uri = StringUtil.trimStart(uri, "file:");
|
||||
|
||||
@@ -588,11 +587,11 @@ public class VfsUtilCore {
|
||||
|
||||
if (uri.startsWith("jar:file:/")) {
|
||||
uri = uri.substring("jar:file:/".length());
|
||||
if (!SystemInfo.isWindows) uri = "/" + uri;
|
||||
if (!SystemInfoRt.isWindows) uri = "/" + uri;
|
||||
file = VirtualFileManager.getInstance().findFileByUrl(StandardFileSystems.JAR_PROTOCOL_PREFIX + uri);
|
||||
}
|
||||
else if (!SystemInfo.isWindows && StringUtil.startsWithChar(uri, '/') ||
|
||||
SystemInfo.isWindows && uri.length() >= 2 && Character.isLetter(uri.charAt(0)) && uri.charAt(1) == ':') {
|
||||
else if (!SystemInfoRt.isWindows && StringUtil.startsWithChar(uri, '/') ||
|
||||
SystemInfoRt.isWindows && uri.length() >= 2 && Character.isLetter(uri.charAt(0)) && uri.charAt(1) == ':') {
|
||||
file = StandardFileSystems.local().findFileByPath(uri);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
package com.intellij.util;
|
||||
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -97,7 +97,7 @@ public class PathUtil {
|
||||
|
||||
@NotNull
|
||||
public static String driveLetterToLowerCase(@NotNull String path) {
|
||||
if (SystemInfo.isWindows && FileUtil.isWindowsAbsolutePath(path)) {
|
||||
if (SystemInfoRt.isWindows && FileUtil.isWindowsAbsolutePath(path)) {
|
||||
return Character.toLowerCase(path.charAt(0)) + path.substring(1);
|
||||
}
|
||||
return path;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.util;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -321,7 +321,7 @@ public class IconUtil {
|
||||
|
||||
@NotNull
|
||||
private static String getToolbarDecoratorIconsFolder() {
|
||||
return "/toolbarDecorator/" + (SystemInfo.isMac ? "mac/" : "");
|
||||
return "/toolbarDecorator/" + (SystemInfoRt.isMac ? "mac/" : "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.credentialStore.windows;
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -14,7 +14,7 @@ import static org.junit.Assume.assumeTrue;
|
||||
public class WindowsCryptUtilTest {
|
||||
@Test
|
||||
public void testProtect() {
|
||||
assumeTrue("Windows-only test", SystemInfo.isWindows);
|
||||
assumeTrue("Windows-only test", SystemInfoRt.isWindows);
|
||||
|
||||
byte[] data = new byte[256];
|
||||
new Random().nextBytes(data);
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.BooleanGetter;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy;
|
||||
import com.intellij.ui.EditorNotificationPanel;
|
||||
import com.intellij.ui.LightColors;
|
||||
@@ -201,8 +201,8 @@ public abstract class MergeRequestProcessor implements Disposable {
|
||||
}
|
||||
|
||||
List<Action> leftActions = ContainerUtil.packNullables(applyLeft, applyRight);
|
||||
List<Action> rightActions = SystemInfo.isMac ? ContainerUtil.packNullables(cancelAction, resolveAction)
|
||||
: ContainerUtil.packNullables(resolveAction, cancelAction);
|
||||
List<Action> rightActions = SystemInfoRt.isMac ? ContainerUtil.packNullables(cancelAction, resolveAction)
|
||||
: ContainerUtil.packNullables(resolveAction, cancelAction);
|
||||
|
||||
JRootPane rootPane = getRootPane();
|
||||
JPanel buttonsPanel = new NonOpaquePanel(new BorderLayout());
|
||||
|
||||
@@ -423,7 +423,7 @@ public class DiffUtil {
|
||||
|
||||
@NotNull
|
||||
public static String getSettingsConfigurablePath() {
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
return "Preferences | Tools | Diff & Merge";
|
||||
}
|
||||
return "Settings | Tools | Diff & Merge";
|
||||
@@ -1508,7 +1508,7 @@ public class DiffUtil {
|
||||
|
||||
private static boolean canBeHiddenBehind(@NotNull Window window) {
|
||||
if (!(window instanceof Frame)) return false;
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
if (window instanceof IdeFrame) {
|
||||
// we can't move focus to full-screen main frame, as it will be hidden behind other frame windows
|
||||
Project project = ((IdeFrame)window).getProject();
|
||||
|
||||
@@ -1,25 +1,11 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.diff.impl.dir.actions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CustomShortcutSet;
|
||||
import com.intellij.openapi.actionSystem.ShortcutSet;
|
||||
import com.intellij.openapi.diff.impl.dir.DirDiffTableModel;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -27,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class RefreshDirDiffAction extends DirDiffAction {
|
||||
public static final CustomShortcutSet REFRESH_SHORTCUT = CustomShortcutSet.fromString(SystemInfo.isMac ? "meta R" : "F5");
|
||||
public static final CustomShortcutSet REFRESH_SHORTCUT = CustomShortcutSet.fromString(SystemInfoRt.isMac ? "meta R" : "F5");
|
||||
|
||||
public RefreshDirDiffAction(DirDiffTableModel model) {
|
||||
super(model);
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.intellij.openapi.editor.colors;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.options.FontSize;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -14,7 +15,7 @@ import java.util.List;
|
||||
|
||||
public class FontPreferences {
|
||||
public final static @NonNls @NotNull String DEFAULT_FONT_NAME = getDefaultFontName();
|
||||
public final static int DEFAULT_FONT_SIZE = SystemInfo.isWindows ? 13 : FontSize.SMALL.getSize();
|
||||
public final static int DEFAULT_FONT_SIZE = SystemInfoRt.isWindows ? 13 : FontSize.SMALL.getSize();
|
||||
|
||||
public final static float DEFAULT_LINE_SPACING = 1.2f;
|
||||
public final static String FALLBACK_FONT_FAMILY = "Monospaced";
|
||||
@@ -79,7 +80,7 @@ public class FontPreferences {
|
||||
}
|
||||
|
||||
public static String getDefaultFontName() {
|
||||
if (SystemInfo.isWindows) return WINDOWS_DEFAULT_FONT_FAMILY;
|
||||
if (SystemInfoRt.isWindows) return WINDOWS_DEFAULT_FONT_FAMILY;
|
||||
if (SystemInfo.isMacOSSnowLeopard) return MAC_OS_DEFAULT_FONT_FAMILY;
|
||||
if (SystemInfo.isXWindow && !GraphicsEnvironment.isHeadless() && !ApplicationManager.getApplication().isCommandLine()) {
|
||||
for (Font font : GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts()) {
|
||||
|
||||
@@ -1,29 +1,15 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.editor.colors.impl;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.ColorUtil;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* This class is intended to read a value from the value element
|
||||
@@ -39,7 +25,7 @@ class ValueElementReader {
|
||||
@NonNls private static final String MAC = "mac";
|
||||
@NonNls private static final String LINUX = "linux";
|
||||
@NonNls private static final String WINDOWS = "windows";
|
||||
private static final String OS = SystemInfo.isWindows ? WINDOWS : SystemInfo.isMac ? MAC : LINUX;
|
||||
private static final String OS = SystemInfoRt.isWindows ? WINDOWS : SystemInfoRt.isMac ? MAC : LINUX;
|
||||
private static final Logger LOG = Logger.getInstance(ValueElementReader.class);
|
||||
|
||||
private String myAttribute;
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.externalSystem.service.ui;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -33,6 +19,7 @@ import com.intellij.openapi.ui.ComboBoxWithWidePopup;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.ColoredListCellRenderer;
|
||||
import com.intellij.ui.JBColor;
|
||||
@@ -83,7 +70,7 @@ public class ExternalSystemJdkComboBox extends ComboBoxWithWidePopup<ExternalSys
|
||||
textAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
|
||||
}
|
||||
else {
|
||||
textAttributes = SystemInfo.isMac && selected
|
||||
textAttributes = SystemInfoRt.isMac && selected
|
||||
? new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.WHITE)
|
||||
: SimpleTextAttributes.GRAY_ATTRIBUTES;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.impl.JavaAwareProjectJdkTableImpl;
|
||||
import com.intellij.openapi.roots.ModuleRootModificationUtil;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.ByteArraySequence;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
@@ -248,13 +248,13 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase {
|
||||
}
|
||||
|
||||
protected static String getRoot() {
|
||||
if (SystemInfo.isWindows) return "c:";
|
||||
if (SystemInfoRt.isWindows) return "c:";
|
||||
return "";
|
||||
}
|
||||
|
||||
protected static String getEnvVar() {
|
||||
if (SystemInfo.isWindows) return "TEMP";
|
||||
else if (SystemInfo.isLinux) return "HOME";
|
||||
if (SystemInfoRt.isWindows) return "TEMP";
|
||||
else if (SystemInfoRt.isLinux) return "HOME";
|
||||
return "TMPDIR";
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.ui.panel.ComponentPanelBuilder;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.VcsApplicationSettings;
|
||||
import com.intellij.openapi.vcs.impl.LineStatusTrackerSettingListener;
|
||||
@@ -115,7 +115,7 @@ public class EditorOptionsPanel extends CompositeConfigurable<ErrorOptionsProvid
|
||||
private final ErrorHighlightingPanel myErrorHighlightingPanel = new ErrorHighlightingPanel(getConfigurables());
|
||||
|
||||
public EditorOptionsPanel() {
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
myCbEnableWheelFontChange.setText(ApplicationBundle.message("checkbox.enable.ctrl.mousewheel.changes.font.size.macos"));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -72,7 +73,7 @@ public class BinTrayUtil {
|
||||
Throwable var4 = null;
|
||||
|
||||
try {
|
||||
File jdkPath = SystemInfo.isMac ? new File(directoryToExtractFile, "jdk") : directoryToExtractFile;
|
||||
File jdkPath = SystemInfoRt.isMac ? new File(directoryToExtractFile, "jdk") : directoryToExtractFile;
|
||||
String jdk = jdkPath.getPath();
|
||||
fooWriter.write(jdk);
|
||||
} catch (Throwable var15) {
|
||||
@@ -106,14 +107,14 @@ public class BinTrayUtil {
|
||||
|
||||
public static boolean isInstalled(String selectedItem) {
|
||||
File jdkBundleDirFile = new File(getJdkStoragePathFile(), archveToDirectoryName(selectedItem));
|
||||
File bundlePathFromItem = SystemInfo.isMac ? new File(jdkBundleDirFile, "jdk") : jdkBundleDirFile;
|
||||
File bundlePathFromItem = SystemInfoRt.isMac ? new File(jdkBundleDirFile, "jdk") : jdkBundleDirFile;
|
||||
return bundlePathFromItem.exists() && isActiveBundle(selectedItem);
|
||||
}
|
||||
|
||||
public static boolean isActiveBundle(String selectedItem) {
|
||||
File jdkConfigFilePath = getJdkConfigFilePath();
|
||||
File jdkBundleDirFile = new File(getJdkStoragePathFile(), archveToDirectoryName(selectedItem));
|
||||
File bundlePathFromItem = SystemInfo.isMac ? new File(jdkBundleDirFile, "jdk") : jdkBundleDirFile;
|
||||
File bundlePathFromItem = SystemInfoRt.isMac ? new File(jdkBundleDirFile, "jdk") : jdkBundleDirFile;
|
||||
if (jdkConfigFilePath != null && jdkConfigFilePath.exists()) {
|
||||
try {
|
||||
Stream<String> lines = Files.lines(jdkConfigFilePath.toPath(), Charset.defaultCharset());
|
||||
@@ -150,7 +151,7 @@ public class BinTrayUtil {
|
||||
}
|
||||
|
||||
static {
|
||||
productJdkConfigFileName = getExecutable() + (SystemInfo.isWindows ? (SystemInfo.is64Bit ? "64.exe.jdk" : ".exe.jdk") : ".jdk");
|
||||
productJdkConfigFileName = getExecutable() + (SystemInfoRt.isWindows ? (SystemInfo.is64Bit ? "64.exe.jdk" : ".exe.jdk") : ".jdk");
|
||||
pathsSelector = PathManager.getPathsSelector();
|
||||
productJdkConfigDir = new File(pathsSelector != null ? PathManager.getDefaultConfigPathFor(pathsSelector) : PathManager.getConfigPath());
|
||||
productJdkConfigFile = new File(productJdkConfigDir, productJdkConfigFileName);
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.intellij.bootRuntime.bundles.Remote
|
||||
import com.intellij.bootRuntime.bundles.Runtime
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.SystemInfo
|
||||
import com.intellij.ui.layout.*
|
||||
import java.io.File
|
||||
import java.net.URL
|
||||
import java.util.regex.Pattern
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
@file:Suppress("MayBeConstant")
|
||||
|
||||
package com.intellij.codeInsight.daemon.impl
|
||||
@@ -15,7 +15,6 @@ import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.openapi.actionSystem.*
|
||||
import com.intellij.openapi.actionSystem.impl.ActionButton
|
||||
import com.intellij.openapi.actionSystem.impl.ActionMenuItem
|
||||
import com.intellij.openapi.actionSystem.impl.ActionToolbarImpl
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.ex.TooltipAction
|
||||
import com.intellij.openapi.keymap.KeymapManager
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.codeInsight.daemon.quickFix;
|
||||
|
||||
@@ -28,7 +14,7 @@ import com.intellij.openapi.fileTypes.UnknownFileType;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference;
|
||||
@@ -62,7 +48,7 @@ public class FileReferenceQuickFixProvider {
|
||||
newFileName.indexOf('\\') != -1 ||
|
||||
newFileName.indexOf('*') != -1 ||
|
||||
newFileName.indexOf('?') != -1 ||
|
||||
SystemInfo.isWindows && newFileName.indexOf(':') != -1) {
|
||||
SystemInfoRt.isWindows && newFileName.indexOf(':') != -1) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.codeInsight.hint;
|
||||
|
||||
@@ -11,12 +11,14 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.colors.EditorFontType;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.ColorUtil;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.ScrollPaneFactory;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -30,8 +32,8 @@ import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.CompoundBorder;
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -92,7 +94,7 @@ public class ParameterInfoComponent extends JPanel {
|
||||
this(objects, editor, handler, false, false);
|
||||
}
|
||||
|
||||
ParameterInfoComponent(Object[] objects, Editor editor, @NotNull ParameterInfoHandler handler,
|
||||
ParameterInfoComponent(Object[] objects, Editor editor, @NotNull ParameterInfoHandler handler,
|
||||
boolean requestFocus, boolean allowSwitchLabel) {
|
||||
super(new BorderLayout());
|
||||
myRequestFocus = requestFocus;
|
||||
@@ -157,7 +159,7 @@ public class ParameterInfoComponent extends JPanel {
|
||||
: CodeInsightBundle.message("parameter.info.switch.overload.shortcuts", upShortcut, downShortcut));
|
||||
myShortcutLabel.setForeground(CONTEXT_HELP_FOREGROUND);
|
||||
Font labelFont = UIUtil.getLabelFont();
|
||||
myShortcutLabel.setFont(labelFont.deriveFont(labelFont.getSize2D() - (SystemInfo.isWindows ? 1 : 2)));
|
||||
myShortcutLabel.setFont(labelFont.deriveFont(labelFont.getSize2D() - (SystemInfoRt.isWindows ? 1 : 2)));
|
||||
myShortcutLabel.setBorder(JBUI.Borders.empty(6, 10, 0, 10));
|
||||
add(myShortcutLabel, BorderLayout.SOUTH);
|
||||
}
|
||||
@@ -202,7 +204,7 @@ public class ParameterInfoComponent extends JPanel {
|
||||
private int i;
|
||||
private Function<? super String, String> myEscapeFunction;
|
||||
private final ParameterInfoController.Model result = new ParameterInfoController.Model();
|
||||
|
||||
|
||||
MyParameterContext(boolean singleParameterInfo) {
|
||||
mySingleParameterInfo = singleParameterInfo;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.*;
|
||||
@@ -225,7 +225,7 @@ public class RunInspectionAction extends GotoActionBase implements DataProvider
|
||||
});
|
||||
}
|
||||
actions.add(getCancelAction());
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
Collections.reverse(actions);
|
||||
}
|
||||
return actions.toArray(new Action[0]);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution.impl;
|
||||
|
||||
import com.intellij.execution.BeforeRunTask;
|
||||
@@ -17,7 +17,7 @@ import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.ui.popup.ListPopup;
|
||||
import com.intellij.openapi.util.Conditions;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.components.JBList;
|
||||
@@ -78,7 +78,7 @@ final class BeforeRunStepsPanel extends JPanel {
|
||||
});
|
||||
|
||||
ToolbarDecorator myDecorator = ToolbarDecorator.createDecorator(myList);
|
||||
if (!SystemInfo.isMac) {
|
||||
if (!SystemInfoRt.isMac) {
|
||||
myDecorator.setAsUsualTopToolbar();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.find;
|
||||
|
||||
import com.intellij.find.editorHeaderActions.*;
|
||||
@@ -13,7 +13,7 @@ import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Splitter;
|
||||
import com.intellij.openapi.util.BooleanGetter;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
@@ -325,7 +325,8 @@ public class SearchReplaceComponent extends EditorHeaderComponent implements Dat
|
||||
addTextToRecent(mySearchTextComponent);
|
||||
}
|
||||
}
|
||||
}, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, SystemInfo.isMac ? META_DOWN_MASK : CTRL_DOWN_MASK),
|
||||
}, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, SystemInfoRt.isMac
|
||||
? META_DOWN_MASK : CTRL_DOWN_MASK),
|
||||
JComponent.WHEN_FOCUSED);
|
||||
|
||||
new VariantsCompletionAction(mySearchTextComponent); // It registers a shortcut set automatically on construction
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.find;
|
||||
|
||||
import com.intellij.featureStatistics.FeatureUsageTracker;
|
||||
@@ -15,7 +15,7 @@ import com.intellij.openapi.editor.EditorCopyPasteHelper;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
@@ -56,7 +56,7 @@ import static javax.swing.ScrollPaneConstants.*;
|
||||
public class SearchTextArea extends NonOpaquePanel implements PropertyChangeListener, FocusListener {
|
||||
public static final String JUST_CLEARED_KEY = "JUST_CLEARED";
|
||||
public static final KeyStroke NEW_LINE_KEYSTROKE
|
||||
= KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, (SystemInfo.isMac ? META_DOWN_MASK : CTRL_DOWN_MASK) | SHIFT_DOWN_MASK);
|
||||
= KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, (SystemInfoRt.isMac ? META_DOWN_MASK : CTRL_DOWN_MASK) | SHIFT_DOWN_MASK);
|
||||
private final JTextArea myTextArea;
|
||||
private final boolean mySearchMode;
|
||||
private final boolean myInfoMode;
|
||||
@@ -154,7 +154,7 @@ public class SearchTextArea extends NonOpaquePanel implements PropertyChangeList
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c) {
|
||||
if (SystemInfo.isMac && !UIUtil.isUnderDarcula()) {
|
||||
if (SystemInfoRt.isMac && !UIUtil.isUnderDarcula()) {
|
||||
return new JBInsets(3, 0, 3, 0);
|
||||
} else {
|
||||
int bottom = (StringUtil.getLineBreakCount(myTextArea.getText()) > 0) ? 2 : UIUtil.isUnderDarcula() ? 2 : 1;
|
||||
@@ -204,7 +204,7 @@ public class SearchTextArea extends NonOpaquePanel implements PropertyChangeList
|
||||
myTextArea.setFont(EditorUtil.getEditorFont());
|
||||
}
|
||||
else {
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
myTextArea.setFont(JBUI.Fonts.smallFont());
|
||||
} else {
|
||||
myTextArea.setFont(UIManager.getFont("TextArea.font"));
|
||||
@@ -489,7 +489,7 @@ public class SearchTextArea extends NonOpaquePanel implements PropertyChangeList
|
||||
|
||||
@Override
|
||||
String getLayoutConstraints() {
|
||||
Insets i = SystemInfo.isLinux ? JBUI.insets(2) : JBUI.insets(3);
|
||||
Insets i = SystemInfoRt.isLinux ? JBUI.insets(2) : JBUI.insets(3);
|
||||
return "flowx, ins " + i.top + " " + i.left + " " + i.bottom + " " + i.right + ", gapx " + JBUI.scale(3);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.find.editorHeaderActions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
@@ -7,7 +8,7 @@ import com.intellij.openapi.actionSystem.Shortcut;
|
||||
import com.intellij.openapi.ui.popup.JBPopup;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.ui.popup.PopupChooserBuilder;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
@@ -56,7 +57,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
public static void setSmallerFont(final JComponent component) {
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
component.setFont(JBUI.Fonts.smallFont());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.find.impl;
|
||||
|
||||
import com.intellij.find.FindBundle;
|
||||
@@ -17,7 +17,7 @@ import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.ui.FixedSizeButton;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.ui.ValidationInfo;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
@@ -100,7 +100,7 @@ public class FindPopupDirectoryChooser extends JPanel {
|
||||
});
|
||||
|
||||
MyRecursiveDirectoryAction recursiveDirectoryAction = new MyRecursiveDirectoryAction();
|
||||
int mnemonicModifiers = SystemInfo.isMac ? InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK : InputEvent.ALT_DOWN_MASK;
|
||||
int mnemonicModifiers = SystemInfoRt.isMac ? InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK : InputEvent.ALT_DOWN_MASK;
|
||||
recursiveDirectoryAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_Y, mnemonicModifiers)), myFindPopupPanel);
|
||||
|
||||
add(myDirectoryComboBox, BorderLayout.CENTER);
|
||||
|
||||
@@ -88,7 +88,8 @@ public class FindPopupPanel extends JBPanel implements FindUI {
|
||||
private static final Logger LOG = Logger.getInstance(FindPopupPanel.class);
|
||||
|
||||
private static final KeyStroke ENTER = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
|
||||
private static final KeyStroke ENTER_WITH_MODIFIERS = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, SystemInfo.isMac ? InputEvent.META_DOWN_MASK : InputEvent.CTRL_DOWN_MASK);
|
||||
private static final KeyStroke ENTER_WITH_MODIFIERS = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, SystemInfoRt.isMac
|
||||
? InputEvent.META_DOWN_MASK : InputEvent.CTRL_DOWN_MASK);
|
||||
private static final KeyStroke REPLACE_ALL = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_MASK);
|
||||
|
||||
private static final String SERVICE_KEY = "find.popup";
|
||||
@@ -287,7 +288,7 @@ public class FindPopupPanel extends JBPanel implements FindUI {
|
||||
DumbAwareAction.create(e -> closeImmediately())
|
||||
.registerCustomShortcutSet(escape == null ? CommonShortcuts.ESCAPE : escape.getShortcutSet(), root, myDisposable);
|
||||
root.setWindowDecorationStyle(JRootPane.NONE);
|
||||
if (SystemInfo.isMac && UIUtil.isUnderDarcula()) {
|
||||
if (SystemInfoRt.isMac && UIUtil.isUnderDarcula()) {
|
||||
root.setBorder(PopupBorder.Factory.createColored(OnePixelDivider.BACKGROUND));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.ide;
|
||||
|
||||
@@ -22,13 +8,12 @@ import com.intellij.openapi.fileTypes.INativeFileType;
|
||||
import com.intellij.openapi.fileTypes.UnknownFileType;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFileSystemItem;
|
||||
import com.intellij.psi.impl.ElementBase;
|
||||
import com.intellij.ui.DeferredIconImpl;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.ui.update.ComparableObject;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -44,7 +29,7 @@ public class NativeIconProvider extends IconProvider implements DumbAware {
|
||||
private final Map<Ext, Icon> myIconCache = new HashMap<>();
|
||||
// on Windows .exe and .ico files provide their own icons which can differ for each file, cache them by full file path
|
||||
private final Set<Ext> myCustomIconExtensions =
|
||||
SystemInfo.isWindows ? new HashSet<>(Arrays.asList(new Ext("exe"), new Ext("ico"))) : new HashSet<>();
|
||||
SystemInfoRt.isWindows ? new HashSet<>(Arrays.asList(new Ext("exe"), new Ext("ico"))) : new HashSet<>();
|
||||
private final Map<String, Icon> myCustomIconCache = new HashMap<>();
|
||||
|
||||
private static final Ext NO_EXT = new Ext(null);
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2019 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.ide.actions;
|
||||
|
||||
@@ -28,7 +14,7 @@ import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.InputValidatorEx;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
@@ -98,7 +84,7 @@ public class CreateFileAction extends CreateElementActionBase implements DumbAwa
|
||||
public final PsiDirectory directory;
|
||||
|
||||
public MkDirs(@NotNull String newName, @NotNull PsiDirectory directory) {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
newName = newName.replace('\\', '/');
|
||||
}
|
||||
if (newName.contains("/")) {
|
||||
|
||||
@@ -301,7 +301,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
|
||||
private static String getShortcut() {
|
||||
Shortcut[] shortcuts = KeymapUtil.getActiveKeymapShortcuts(IdeActions.ACTION_SEARCH_EVERYWHERE).getShortcuts();
|
||||
if (shortcuts.length == 0) {
|
||||
return "Double" + (SystemInfo.isMac ? FontUtil.thinSpace() + MacKeymapUtil.SHIFT : " Shift");
|
||||
return "Double" + (SystemInfoRt.isMac ? FontUtil.thinSpace() + MacKeymapUtil.SHIFT : " Shift");
|
||||
}
|
||||
return KeymapUtil.getShortcutsText(shortcuts);
|
||||
}
|
||||
@@ -678,7 +678,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
|
||||
new JBColor(Gray._240, Gray._200);
|
||||
|
||||
title.setForeground(foregroundColor);
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
title.setFont(title.getFont().deriveFont(Font.BOLD, title.getFont().getSize() - 1f));
|
||||
}
|
||||
else {
|
||||
@@ -2227,7 +2227,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
|
||||
size.height = JBUI.scale(30);
|
||||
}
|
||||
Dimension sz = new Dimension(size.width, myList.getPreferredSize().height);
|
||||
if (!SystemInfo.isMac) {
|
||||
if (!SystemInfoRt.isMac) {
|
||||
if (sz.width > getPopupMaxWidth() || sz.height > getPopupMaxWidth()) {
|
||||
final JBScrollPane pane = new JBScrollPane();
|
||||
final int extraWidth = pane.getVerticalScrollBar().getWidth() + 1;
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.actions;
|
||||
|
||||
import com.intellij.ide.util.PlatformModuleRendererFactory;
|
||||
@@ -20,7 +6,7 @@ import com.intellij.ide.util.PsiElementListCellRenderer;
|
||||
import com.intellij.ide.util.gotoByName.GotoFileCellRenderer;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -127,7 +113,7 @@ public class SearchEverywherePsiRenderer extends PsiElementListCellRenderer<PsiE
|
||||
int fullWidth = fm.stringWidth(adjustedText);
|
||||
if (fullWidth < maxWidth) return adjustedText;
|
||||
String separator = text.contains("/") ? "/" :
|
||||
SystemInfo.isWindows && text.contains("\\") ? "\\" :
|
||||
SystemInfoRt.isWindows && text.contains("\\") ? "\\" :
|
||||
text.contains(".") ? "." :
|
||||
text.contains("-") ? "-" : " ";
|
||||
LinkedList<String> parts = new LinkedList<>(StringUtil.split(text, separator));
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.intellij.openapi.keymap.MacKeymapUtil;
|
||||
import com.intellij.openapi.keymap.impl.ModifierKeyDoubleClickHandler;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.util.NotNullLazyValue;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.util.FontUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -133,7 +133,7 @@ public class RunAnythingAction extends AnAction implements CustomComponentAction
|
||||
private String getShortcut() {
|
||||
if (myIsDoubleCtrlRegistered) {
|
||||
return " " + IdeBundle
|
||||
.message("run.anything.double.ctrl.shortcut", SystemInfo.isMac ? FontUtil.thinSpace() + MacKeymapUtil.CONTROL : " Ctrl");
|
||||
.message("run.anything.double.ctrl.shortcut", SystemInfoRt.isMac ? FontUtil.thinSpace() + MacKeymapUtil.CONTROL : " Ctrl");
|
||||
}
|
||||
//keymap shortcut is added automatically
|
||||
return "";
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.util.ActionCallback;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.ToolWindowId;
|
||||
import com.intellij.ui.*;
|
||||
@@ -388,7 +388,7 @@ public class RunAnythingPopupUI extends BigPopupUI {
|
||||
|
||||
myTextFieldTitle.setForeground(foregroundColor);
|
||||
myTextFieldTitle.setBorder(BorderFactory.createEmptyBorder(3, 5, 5, 0));
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
myTextFieldTitle.setFont(myTextFieldTitle.getFont().deriveFont(Font.BOLD, myTextFieldTitle.getFont().getSize() - 1f));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.ide.bookmarks;
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.Trinity;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -361,7 +361,7 @@ public class BookmarkManager implements PersistentStateComponent<Element> {
|
||||
public void mouseClicked(@NotNull final EditorMouseEvent e) {
|
||||
if (e.getArea() != EditorMouseEventArea.LINE_MARKERS_AREA) return;
|
||||
if (e.getMouseEvent().isPopupTrigger()) return;
|
||||
if ((e.getMouseEvent().getModifiers() & (SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK)) == 0) return;
|
||||
if ((e.getMouseEvent().getModifiers() & (SystemInfoRt.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK)) == 0) return;
|
||||
|
||||
Editor editor = e.getEditor();
|
||||
int line = editor.xyToLogicalPosition(new Point(e.getMouseEvent().getX(), e.getMouseEvent().getY())).line;
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.bookmarks.actions;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -25,7 +11,7 @@ import com.intellij.openapi.actionSystem.CustomShortcutSet;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.JBPopup;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -40,7 +26,7 @@ class EditBookmarkDescriptionAction extends DumbAwareAction {
|
||||
setEnabledInModalContext(true);
|
||||
myProject = project;
|
||||
myList = list;
|
||||
registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(SystemInfo.isMac ? "meta ENTER" : "control ENTER")), list);
|
||||
registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(SystemInfoRt.isMac ? "meta ENTER" : "control ENTER")), list);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.ide.commander;
|
||||
|
||||
@@ -40,7 +26,7 @@ import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.ToolWindowManager;
|
||||
import com.intellij.pom.Navigatable;
|
||||
@@ -118,12 +104,12 @@ public class CommanderPanel extends JPanel {
|
||||
if (myBuilder == null) return;
|
||||
myBuilder.buildRoot();
|
||||
}
|
||||
}, KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SLASH, SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK),
|
||||
}, KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SLASH, SystemInfoRt.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK),
|
||||
JComponent.WHEN_FOCUSED);
|
||||
|
||||
myList.getInputMap(WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), ACTION_DRILL_DOWN);
|
||||
myList.getInputMap(WHEN_FOCUSED)
|
||||
.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK),
|
||||
.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, SystemInfoRt.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK),
|
||||
ACTION_DRILL_DOWN);
|
||||
myList.getActionMap().put(ACTION_DRILL_DOWN, new AbstractAction() {
|
||||
@Override
|
||||
@@ -140,7 +126,7 @@ public class CommanderPanel extends JPanel {
|
||||
}.installOn(myList);
|
||||
|
||||
myList.getInputMap(WHEN_FOCUSED)
|
||||
.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK), ACTION_GO_UP);
|
||||
.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, SystemInfoRt.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK), ACTION_GO_UP);
|
||||
myList.getInputMap(WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), ACTION_GO_UP);
|
||||
myList.getActionMap().put(ACTION_GO_UP, new AbstractAction() {
|
||||
@Override
|
||||
@@ -285,7 +271,7 @@ public class CommanderPanel extends JPanel {
|
||||
add(myTitlePanel, BorderLayout.NORTH);
|
||||
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myList);
|
||||
scrollPane.setBorder(null);
|
||||
scrollPane.getVerticalScrollBar().setFocusable(false); // otherwise the scrollbar steals focus and panel switching with tab is broken
|
||||
scrollPane.getVerticalScrollBar().setFocusable(false); // otherwise the scrollbar steals focus and panel switching with tab is broken
|
||||
scrollPane.getHorizontalScrollBar().setFocusable(false);
|
||||
add(scrollPane, BorderLayout.CENTER);
|
||||
|
||||
|
||||
@@ -455,14 +455,14 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
ListenerUtil.addMouseListener(component, new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseReleased(final MouseEvent e) {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
click(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(final MouseEvent e) {
|
||||
if (!SystemInfo.isWindows) {
|
||||
if (!SystemInfoRt.isWindows) {
|
||||
click(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,8 @@ import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Queryable;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.ui.CollectionListModel;
|
||||
import com.intellij.ui.HintHint;
|
||||
import com.intellij.ui.LightweightHint;
|
||||
import com.intellij.ui.ListActions;
|
||||
import com.intellij.ui.ScrollingUtil;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.awt.RelativePoint;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.ui.popup.HintUpdateSupply;
|
||||
@@ -52,14 +48,14 @@ public class NavBarPopup extends LightweightHint implements Disposable{
|
||||
getList().addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseReleased(final MouseEvent e) {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
click(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(final MouseEvent e) {
|
||||
if (!SystemInfo.isWindows) {
|
||||
if (!SystemInfoRt.isWindows) {
|
||||
click(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.projectView.impl;
|
||||
|
||||
import com.intellij.ide.DataManager;
|
||||
@@ -11,7 +11,7 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
@@ -77,7 +77,7 @@ abstract class ProjectViewDropTarget implements DnDNativeTarget {
|
||||
}
|
||||
else {
|
||||
// it seems like it's not possible to obtain dragged items _before_ accepting _drop_ on Macs, so just skip this check
|
||||
if (!SystemInfo.isMac) {
|
||||
if (!SystemInfoRt.isMac) {
|
||||
PsiFileSystemItem[] psiFiles = getPsiFiles(FileCopyPasteUtil.getFileListFromAttachedObject(event.getAttachedObject()));
|
||||
if (psiFiles == null || psiFiles.length == 0) return false;
|
||||
if (!MoveHandler.isValidTarget(getPsiElement(target), psiFiles)) return false;
|
||||
|
||||
@@ -1,22 +1,8 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.ide.util;
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
@@ -24,7 +10,6 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.StringTokenizer;
|
||||
@@ -64,7 +49,7 @@ public class DirectoryUtil {
|
||||
|
||||
if (StringUtil.endsWithChar(existingPath, '/')) {
|
||||
existingPath = existingPath.substring(0, existingPath.length() - 1);
|
||||
if (SystemInfo.isWindows && existingPath.length() == 2 && existingPath.charAt(1) == ':') {
|
||||
if (SystemInfoRt.isWindows && existingPath.length() == 2 && existingPath.charAt(1) == ':') {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.util.gotoByName;
|
||||
|
||||
import com.google.common.util.concurrent.UncheckedTimeoutException;
|
||||
@@ -14,7 +14,7 @@ import com.intellij.openapi.ui.popup.ComponentPopupBuilder;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.statistics.StatisticsInfo;
|
||||
@@ -158,7 +158,7 @@ public class ChooseByNamePopup extends ChooseByNameBase implements ChooseByNameP
|
||||
preferredScrollPaneSize.width = screen.width;
|
||||
if (model.getSize() <= myList.getVisibleRowCount()) {
|
||||
JScrollBar hsb = myListScrollPane.getHorizontalScrollBar();
|
||||
if (hsb != null && (!SystemInfo.isMac || hsb.isOpaque())) {
|
||||
if (hsb != null && (!SystemInfoRt.isMac || hsb.isOpaque())) {
|
||||
Dimension size = hsb.getPreferredSize();
|
||||
if (size != null) preferredScrollPaneSize.height += size.height;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ public class GotoActionModel implements ChooseByNameModel, Comparator<Object>, D
|
||||
public String getGroupName(@NotNull OptionDescription description) {
|
||||
String name = description.getGroupName();
|
||||
if (name == null) name = myConfigurablesNames.getValue().get(description.getConfigurableId());
|
||||
String settings = SystemInfo.isMac ? "Preferences" : "Settings";
|
||||
String settings = SystemInfoRt.isMac ? "Preferences" : "Settings";
|
||||
if (name == null || name.equals(description.getHit())) return settings;
|
||||
return settings + " > " + name;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.DimensionService;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -443,7 +443,7 @@ public class PsiViewerDialog extends DialogWrapper implements DataProvider, Disp
|
||||
}
|
||||
|
||||
private void registerCustomKeyboardActions() {
|
||||
final int mask = SystemInfo.isMac ? InputEvent.META_DOWN_MASK : InputEvent.ALT_DOWN_MASK;
|
||||
final int mask = SystemInfoRt.isMac ? InputEvent.META_DOWN_MASK : InputEvent.ALT_DOWN_MASK;
|
||||
|
||||
registerKeyboardAction(new ActionListener() {
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.intellij.openapi.editor.markup.HighlighterLayer;
|
||||
import com.intellij.openapi.editor.markup.MarkupModel;
|
||||
import com.intellij.openapi.editor.markup.TextAttributes;
|
||||
import com.intellij.openapi.editor.richcopy.model.SyntaxInfo;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.psi.TokenType;
|
||||
import com.intellij.util.text.CharArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -38,13 +38,13 @@ public final class SyntaxInfoBuilder {
|
||||
@NotNull MarkupModel markupModel,
|
||||
int startOffsetToUse,
|
||||
int endOffset) {
|
||||
|
||||
|
||||
CompositeRangeIterator iterator = new CompositeRangeIterator(
|
||||
schemeToUse,
|
||||
new HighlighterRangeIterator(highlighter, startOffsetToUse, endOffset),
|
||||
new MarkupModelRangeIterator(markupModel, schemeToUse, startOffsetToUse, endOffset)
|
||||
);
|
||||
|
||||
|
||||
return new MyMarkupIterator(text, iterator, schemeToUse);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public final class SyntaxInfoBuilder {
|
||||
|
||||
void dispose();
|
||||
}
|
||||
|
||||
|
||||
static class MyMarkupIterator {
|
||||
private final SegmentIterator mySegmentIterator;
|
||||
private final RangeIterator myRangeIterator;
|
||||
@@ -531,10 +531,10 @@ public final class SyntaxInfoBuilder {
|
||||
myDefaultBackground = scheme.getDefaultBackground();
|
||||
|
||||
int javaFontSize = scheme.getEditorFontSize();
|
||||
float fontSize = SystemInfo.isMac || ApplicationManager.getApplication().isHeadlessEnvironment() ?
|
||||
javaFontSize :
|
||||
float fontSize = SystemInfoRt.isMac || ApplicationManager.getApplication().isHeadlessEnvironment() ?
|
||||
javaFontSize :
|
||||
javaFontSize * 0.75f / UISettings.getDefFontScale(); // matching font size in external apps
|
||||
|
||||
|
||||
builder = new SyntaxInfo.Builder(myDefaultForeground, myDefaultBackground, fontSize);
|
||||
myIndentSymbolsToStrip = indentSymbolsToStrip;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.editor.richcopy.view;
|
||||
|
||||
import com.intellij.openapi.editor.richcopy.model.ColorRegistry;
|
||||
import com.intellij.openapi.editor.richcopy.model.FontNameRegistry;
|
||||
import com.intellij.openapi.editor.richcopy.model.MarkupHandler;
|
||||
import com.intellij.openapi.editor.richcopy.model.SyntaxInfo;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import gnu.trove.TIntObjectHashMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -16,7 +16,7 @@ import java.awt.*;
|
||||
* @author Denis Zhdanov
|
||||
*/
|
||||
public class HtmlSyntaxInfoReader extends AbstractSyntaxAwareReader implements MarkupHandler {
|
||||
|
||||
|
||||
private final int myTabSize;
|
||||
protected StringBuilder myResultBuffer;
|
||||
private ColorRegistry myColorRegistry;
|
||||
@@ -88,7 +88,7 @@ public class HtmlSyntaxInfoReader extends AbstractSyntaxAwareReader implements M
|
||||
float fontSize = mySyntaxInfo.getFontSize();
|
||||
// on Mac OS font size in points declared in HTML doesn't mean the same value as when declared e.g. in TextEdit (and in Java),
|
||||
// this is the correction factor
|
||||
if (SystemInfo.isMac) fontSize *= 0.75f;
|
||||
if (SystemInfoRt.isMac) fontSize *= 0.75f;
|
||||
myResultBuffer.append(String.format("font-size:%.1fpt;\">", fontSize));
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.intellij.openapi.editor.richcopy.model.ColorRegistry;
|
||||
import com.intellij.openapi.editor.richcopy.model.FontNameRegistry;
|
||||
import com.intellij.openapi.editor.richcopy.model.MarkupHandler;
|
||||
import com.intellij.openapi.editor.richcopy.model.SyntaxInfo;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.ui.mac.MacColorSpaceLoader;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class RtfTransferableData extends AbstractSyntaxAwareInputStreamTransfera
|
||||
private static final String HEADER_SUFFIX = "}";
|
||||
private static final String TAB = "\\tab\n";
|
||||
// using undocumented way to denote line break on Mac (used e.g. by TextEdit) to resolve IDEA-165337
|
||||
private static final String NEW_LINE = SystemInfo.isMac ? "\\\n" : "\\line\n";
|
||||
private static final String NEW_LINE = SystemInfoRt.isMac ? "\\\n" : "\\line\n";
|
||||
private static final String BOLD = "\\b";
|
||||
private static final String ITALIC = "\\i";
|
||||
|
||||
@@ -62,10 +62,10 @@ public class RtfTransferableData extends AbstractSyntaxAwareInputStreamTransfera
|
||||
holder.append("\\par");
|
||||
holder.append(HEADER_SUFFIX);
|
||||
}
|
||||
|
||||
|
||||
private static int[] getAdjustedColorComponents(Color color) {
|
||||
ColorSpace genericRgbSpace;
|
||||
if (SystemInfo.isMac && (genericRgbSpace = MacColorSpaceLoader.getGenericRgbColorSpace()) != null) {
|
||||
if (SystemInfoRt.isMac && (genericRgbSpace = MacColorSpaceLoader.getGenericRgbColorSpace()) != null) {
|
||||
// on macOS color components are expected in Apple's 'Generic RGB' color space
|
||||
float[] components = genericRgbSpace.fromRGB(color.getRGBColorComponents(null));
|
||||
return new int[]{
|
||||
@@ -78,7 +78,7 @@ public class RtfTransferableData extends AbstractSyntaxAwareInputStreamTransfera
|
||||
return new int[]{color.getRed(), color.getGreen(), color.getBlue()};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static int colorComponentFloatToInt(float component) {
|
||||
return (int)(component * 255 + 0.5f);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.intellij.openapi.roots.impl.ModuleRootManagerImpl;
|
||||
import com.intellij.openapi.roots.impl.ModuleRootManagerImpl.ModuleRootManagerState;
|
||||
import com.intellij.openapi.roots.impl.RootModelImpl;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
@@ -225,7 +225,7 @@ public final class ClasspathStorage extends StateStorageBase<Boolean> {
|
||||
}
|
||||
|
||||
storageRef = FileUtil.toSystemIndependentName(storageRef);
|
||||
if (SystemInfo.isWindows ? FileUtil.isAbsolutePlatformIndependent(storageRef) : FileUtil.isUnixAbsolutePath(storageRef)) {
|
||||
if (SystemInfoRt.isWindows ? FileUtil.isAbsolutePlatformIndependent(storageRef) : FileUtil.isUnixAbsolutePath(storageRef)) {
|
||||
return storageRef;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.openapi.roots.ui.configuration;
|
||||
|
||||
@@ -22,7 +8,7 @@ import com.intellij.openapi.roots.ContentEntry;
|
||||
import com.intellij.openapi.roots.ContentFolder;
|
||||
import com.intellij.openapi.roots.ExcludeFolder;
|
||||
import com.intellij.openapi.roots.SourceFolder;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -333,7 +319,7 @@ public abstract class ContentRootPanel extends JPanel {
|
||||
}
|
||||
*/
|
||||
final Stroke saved = g.getStroke();
|
||||
if (!SystemInfo.isMac && !UIUtil.isUnderDarcula()) {
|
||||
if (!SystemInfoRt.isMac && !UIUtil.isUnderDarcula()) {
|
||||
g.setStroke(new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, DASH, y1 % 2));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.profile.codeInspection.ui.inspectionsTree;
|
||||
|
||||
import com.intellij.codeHighlighting.HighlightDisplayLevel;
|
||||
@@ -13,7 +13,7 @@ import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.profile.codeInspection.ui.InspectionsAggregationUtil;
|
||||
import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel;
|
||||
@@ -60,7 +60,7 @@ public class InspectionsConfigTreeTable extends TreeTable {
|
||||
private static final int IS_ENABLED_COLUMN = 2;
|
||||
|
||||
public static int getAdditionalPadding() {
|
||||
return SystemInfo.isMac ? 16 : 0;
|
||||
return SystemInfoRt.isMac ? 16 : 0;
|
||||
}
|
||||
|
||||
public static InspectionsConfigTreeTable create(final InspectionsConfigTreeTableSettings settings, @NotNull Disposable parentDisposable) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.refactoring.ui;
|
||||
|
||||
import com.intellij.ide.HelpTooltip;
|
||||
@@ -11,7 +11,7 @@ import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.refactoring.BaseRefactoringProcessor;
|
||||
import com.intellij.refactoring.RefactoringBundle;
|
||||
@@ -150,7 +150,7 @@ public abstract class RefactoringDialog extends DialogWrapper {
|
||||
if (hasHelpAction()) {
|
||||
actions.add(getHelpAction());
|
||||
}
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
Collections.reverse(actions);
|
||||
}
|
||||
return actions.toArray(new Action[0]);
|
||||
@@ -175,7 +175,7 @@ public abstract class RefactoringDialog extends DialogWrapper {
|
||||
private class PreviewAction extends AbstractAction {
|
||||
PreviewAction() {
|
||||
super(RefactoringBundle.message("preview.button"));
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
putValue(FOCUSED_ACTION, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ui.popup.util;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -6,6 +6,7 @@ import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.*;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.components.JBList;
|
||||
@@ -200,7 +201,7 @@ public class MasterDetailPopupBuilder implements MasterController {
|
||||
g.drawLine(0, 0, getWidth(), 0);
|
||||
}
|
||||
};
|
||||
footerPanel.setBorder(JBUI.Borders.empty(4, 4, 4, SystemInfo.isMac ? 20 : 4));
|
||||
footerPanel.setBorder(JBUI.Borders.empty(4, 4, 4, SystemInfoRt.isMac ? 20 : 4));
|
||||
footerPanel.add(myPathLabel);
|
||||
|
||||
Runnable itemCallback = () -> IdeFocusManager.getInstance(myProject).doWhenFocusSettlesDown(() -> chooseItems(false));
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
// Copyright 2000-2017 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.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution.configurations;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.util.EnvironmentUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -50,7 +38,7 @@ public class EncodingEnvironmentUtil {
|
||||
*/
|
||||
@Deprecated
|
||||
public static void setLocaleEnvironmentIfMac(@NotNull GeneralCommandLine commandLine) {
|
||||
if (SystemInfo.isMac && !isLocaleDefined(commandLine)) {
|
||||
if (SystemInfoRt.isMac && !isLocaleDefined(commandLine)) {
|
||||
setLocaleEnvironment(commandLine.getEnvironment(), commandLine.getCharset());
|
||||
}
|
||||
}
|
||||
@@ -62,7 +50,7 @@ public class EncodingEnvironmentUtil {
|
||||
*/
|
||||
@Deprecated
|
||||
public static void setLocaleEnvironmentIfMac(@NotNull Map<String, String> env, @NotNull Charset charset) {
|
||||
if (SystemInfo.isMac && !isLocaleDefined(env)) {
|
||||
if (SystemInfoRt.isMac && !isLocaleDefined(env)) {
|
||||
setLocaleEnvironment(env, charset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.intellij.execution.process.ProcessNotCreatedException;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -391,7 +391,7 @@ public class GeneralCommandLine implements UserDataHolder {
|
||||
}
|
||||
|
||||
String exePath = myExePath;
|
||||
if (SystemInfo.isMac && myParentEnvironmentType == ParentEnvironmentType.CONSOLE && exePath.indexOf(File.pathSeparatorChar) == -1) {
|
||||
if (SystemInfoRt.isMac && myParentEnvironmentType == ParentEnvironmentType.CONSOLE && exePath.indexOf(File.pathSeparatorChar) == -1) {
|
||||
String systemPath = System.getenv("PATH"), shellPath = EnvironmentUtil.getValue("PATH");
|
||||
if (!Objects.equals(systemPath, shellPath)) {
|
||||
File exeFile = PathEnvironmentVariableUtil.findInPath(myExePath, shellPath, null);
|
||||
@@ -450,7 +450,7 @@ public class GeneralCommandLine implements UserDataHolder {
|
||||
environment.putAll(getParentEnvironment());
|
||||
}
|
||||
|
||||
if (SystemInfo.isUnix) {
|
||||
if (SystemInfoRt.isUnix) {
|
||||
File workDirectory = getWorkDirectory();
|
||||
if (workDirectory != null) {
|
||||
environment.put("PWD", FileUtil.toSystemDependentName(workDirectory.getAbsolutePath()));
|
||||
@@ -458,7 +458,7 @@ public class GeneralCommandLine implements UserDataHolder {
|
||||
}
|
||||
|
||||
if (!myEnvParams.isEmpty()) {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
THashMap<String, String> envVars = new THashMap<>(CaseInsensitiveStringHashingStrategy.INSTANCE);
|
||||
envVars.putAll(environment);
|
||||
envVars.putAll(myEnvParams);
|
||||
@@ -509,7 +509,7 @@ public class GeneralCommandLine implements UserDataHolder {
|
||||
|
||||
private static class MyTHashMap extends THashMap<String, String> {
|
||||
private MyTHashMap() {
|
||||
super(SystemInfo.isWindows ? CaseInsensitiveStringHashingStrategy.INSTANCE : ContainerUtil.canonicalStrategy());
|
||||
super(SystemInfoRt.isWindows ? CaseInsensitiveStringHashingStrategy.INSTANCE : ContainerUtil.canonicalStrategy());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution.configurations;
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.EnvironmentUtil;
|
||||
import com.intellij.util.SmartList;
|
||||
@@ -118,7 +118,7 @@ public class PathEnvironmentVariableUtil {
|
||||
|
||||
@NotNull
|
||||
public static List<String> getWindowsExecutableFileExtensions() {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
String allExtensions = System.getenv("PATHEXT");
|
||||
if (allExtensions != null) {
|
||||
Collection<String> extensions = StringUtil.split(allExtensions, ";", true, true);
|
||||
@@ -136,7 +136,7 @@ public class PathEnvironmentVariableUtil {
|
||||
|
||||
@Contract("_, !null -> !null")
|
||||
public static String findExecutableInWindowsPath(@NotNull String exePath, @Nullable String defaultPath) {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
if (!StringUtil.containsChar(exePath, '/') && !StringUtil.containsChar(exePath, '\\')) {
|
||||
List<String> executableFileExtensions = getWindowsExecutableFileExtensions();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution.configurations;
|
||||
|
||||
import com.intellij.openapi.application.Application;
|
||||
@@ -6,7 +6,7 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
@@ -160,7 +160,7 @@ public class PtyCommandLine extends GeneralCommandLine {
|
||||
public Process startProcessWithPty(@NotNull List<String> commands) throws IOException {
|
||||
List<Pair<String, String>> backup = new ArrayList<>();
|
||||
try {
|
||||
if (SystemInfo.isUnix && (myInitialColumns > 0 || myInitialRows > 0)) {
|
||||
if (SystemInfoRt.isUnix && (myInitialColumns > 0 || myInitialRows > 0)) {
|
||||
setSystemProperty(UNIX_PTY_INIT, Boolean.toString(true), backup);
|
||||
if (myInitialColumns > 0) {
|
||||
setSystemProperty(UNIX_PTY_COLUMNS, Integer.toString(myInitialColumns), backup);
|
||||
@@ -169,7 +169,7 @@ public class PtyCommandLine extends GeneralCommandLine {
|
||||
setSystemProperty(UNIX_PTY_ROWS, Integer.toString(myInitialRows), backup);
|
||||
}
|
||||
}
|
||||
else if (SystemInfo.isWindows) {
|
||||
else if (SystemInfoRt.isWindows) {
|
||||
if (myInitialColumns > 0) {
|
||||
setSystemProperty(WIN_PTY_COLUMNS, Integer.toString(myInitialColumns), backup);
|
||||
}
|
||||
@@ -209,7 +209,7 @@ public class PtyCommandLine extends GeneralCommandLine {
|
||||
String[] command = ArrayUtil.toStringArray(commands);
|
||||
File workDirectory = getWorkDirectory();
|
||||
String directory = workDirectory != null ? workDirectory.getPath() : null;
|
||||
boolean cygwin = myUseCygwinLaunch && SystemInfo.isWindows;
|
||||
boolean cygwin = myUseCygwinLaunch && SystemInfoRt.isWindows;
|
||||
PtyProcessBuilder builder = new PtyProcessBuilder(command)
|
||||
.setEnvironment(env)
|
||||
.setDirectory(directory)
|
||||
|
||||
@@ -1,25 +1,11 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution.process;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.StatusBar;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -78,7 +64,7 @@ public class ProcessTerminatedListener extends ProcessAdapter {
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append(exitCode);
|
||||
|
||||
if (SystemInfo.isWindows && exitCode >= 0xC0000000 && exitCode < 0xD0000000) {
|
||||
if (SystemInfoRt.isWindows && exitCode >= 0xC0000000 && exitCode < 0xD0000000) {
|
||||
// Quote from http://support.microsoft.com/kb/308558:
|
||||
// If the result code has the "C0000XXX" format, the task did not complete successfully (the "C" indicates an error condition).
|
||||
// The most common "C" error code is "0xC000013A: The application terminated as a result of a CTRL+C".
|
||||
@@ -88,7 +74,7 @@ public class ProcessTerminatedListener extends ProcessAdapter {
|
||||
}
|
||||
result.append(')');
|
||||
}
|
||||
else if (SystemInfo.isUnix && exitCode >= 129 && exitCode <= 159) {
|
||||
else if (SystemInfoRt.isUnix && exitCode >= 129 && exitCode <= 159) {
|
||||
// "Exit Codes With Special Meanings" (http://www.tldp.org/LDP/abs/html/exitcodes.html)
|
||||
@SuppressWarnings("SpellCheckingInspection") String[] signals = {
|
||||
"HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "URG",
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.intellij.ide.browsers.BrowserLauncherAppless;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -87,14 +88,14 @@ public class BrowserUtil {
|
||||
if (new File(browserPathOrName).isFile()) {
|
||||
return Collections.singletonList(browserPathOrName);
|
||||
}
|
||||
else if (SystemInfo.isMac) {
|
||||
else if (SystemInfoRt.isMac) {
|
||||
List<String> command = newArrayList(ExecUtil.getOpenCommandPath(), "-a", browserPathOrName);
|
||||
if (newWindowIfPossible) {
|
||||
command.add("-n");
|
||||
}
|
||||
return command;
|
||||
}
|
||||
else if (SystemInfo.isWindows) {
|
||||
else if (SystemInfoRt.isWindows) {
|
||||
return Arrays.asList(ExecUtil.getWindowsShellName(), "/c", "start", GeneralCommandLine.inescapableQuote(""), browserPathOrName);
|
||||
}
|
||||
else {
|
||||
@@ -108,13 +109,13 @@ public class BrowserUtil {
|
||||
|
||||
@NotNull
|
||||
public static String getDefaultAlternativeBrowserPath() {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
return "C:\\Program Files\\Internet Explorer\\IExplore.exe";
|
||||
}
|
||||
else if (SystemInfo.isMac) {
|
||||
else if (SystemInfoRt.isMac) {
|
||||
return "open";
|
||||
}
|
||||
else if (SystemInfo.isUnix) {
|
||||
else if (SystemInfoRt.isUnix) {
|
||||
return "/usr/bin/firefox";
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
|
||||
public abstract class RemoteDesktopService {
|
||||
private static volatile RemoteDesktopService ourInstance;
|
||||
@@ -17,7 +17,7 @@ public abstract class RemoteDesktopService {
|
||||
}
|
||||
|
||||
public static boolean isRemoteSession() {
|
||||
if (!SystemInfo.isWindows) return false;
|
||||
if (!SystemInfoRt.isWindows) return false;
|
||||
if (ApplicationManager.getApplication() == null) return false;
|
||||
RemoteDesktopService instance = getInstance();
|
||||
return instance != null && instance.isRemoteDesktopConnected();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.browsers;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -5,7 +6,7 @@ import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.browsers.chrome.ChromeSettings;
|
||||
import com.intellij.ide.browsers.firefox.FirefoxSettings;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -53,10 +54,10 @@ public enum BrowserFamily implements Iconable {
|
||||
|
||||
@Nullable
|
||||
public String getExecutionPath() {
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
return myWindowsPath;
|
||||
}
|
||||
else if (SystemInfo.isMac) {
|
||||
else if (SystemInfoRt.isMac) {
|
||||
return myMacPath;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.browsers.firefox;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
@@ -7,7 +7,7 @@ import com.intellij.openapi.options.Configurable;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -53,7 +53,7 @@ public class FirefoxSettingsConfigurable implements Configurable {
|
||||
public boolean isFileSelectable(VirtualFile file) {
|
||||
return file.getName().equals(FirefoxUtil.PROFILES_INI_FILE) && super.isFileSelectable(file);
|
||||
}
|
||||
}.withShowHiddenFiles(SystemInfo.isUnix);
|
||||
}.withShowHiddenFiles(SystemInfoRt.isUnix);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,22 +1,8 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.browsers.firefox;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.SystemProperties;
|
||||
@@ -158,13 +144,13 @@ public class FirefoxUtil {
|
||||
|
||||
private static File[] getProfilesDirs() {
|
||||
final String userHome = SystemProperties.getUserHome();
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
return new File[] {
|
||||
new File(userHome, "Library" + File.separator + "Mozilla" + File.separator + "Firefox"),
|
||||
new File(userHome, "Library" + File.separator + "Application Support" + File.separator + "Firefox"),
|
||||
};
|
||||
}
|
||||
if (SystemInfo.isUnix) {
|
||||
if (SystemInfoRt.isUnix) {
|
||||
return new File[] {new File(userHome, ".mozilla" + File.separator + "firefox")};
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.intellij.openapi.help.HelpManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.ui.JBCardLayout;
|
||||
import com.intellij.ui.components.panels.OpaquePanel;
|
||||
@@ -109,7 +109,7 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
|
||||
JPanel buttonPanel = new JPanel();
|
||||
|
||||
if (SystemInfo.isMac) {
|
||||
if (SystemInfoRt.isMac) {
|
||||
panel.add(buttonPanel, BorderLayout.EAST);
|
||||
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
|
||||
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi;
|
||||
|
||||
import com.intellij.openapi.actionSystem.ActionButtonComponent;
|
||||
import com.intellij.openapi.actionSystem.CustomShortcutSet;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.ui.ComponentTreeWatcher;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
@@ -99,7 +85,7 @@ public class MnemonicHelper extends ComponentTreeWatcher {
|
||||
}
|
||||
|
||||
private static void fixMacMnemonicKeyStroke(JComponent component, String type) {
|
||||
if (SystemInfo.isMac && Registry.is("ide.mac.alt.mnemonic.without.ctrl")) {
|
||||
if (SystemInfoRt.isMac && Registry.is("ide.mac.alt.mnemonic.without.ctrl")) {
|
||||
// hack to make component's mnemonic work for ALT+KEY_CODE on Macs.
|
||||
// Default implementation uses ALT+CTRL+KEY_CODE (see BasicLabelUI).
|
||||
InputMap inputMap = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
|
||||
@@ -161,7 +147,7 @@ public class MnemonicHelper extends ComponentTreeWatcher {
|
||||
*/
|
||||
public static CustomShortcutSet createShortcut(char ch) {
|
||||
Character mnemonic = Character.valueOf(ch);
|
||||
return CustomShortcutSet.fromString("alt " + (SystemInfo.isMac ? "released" : "pressed") + " " + mnemonic);
|
||||
return CustomShortcutSet.fromString("alt " + (SystemInfoRt.isMac ? "released" : "pressed") + " " + mnemonic);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,7 +195,7 @@ public class MnemonicHelper extends ComponentTreeWatcher {
|
||||
@MagicConstant(flagsFromClass = InputEvent.class)
|
||||
public static int getFocusAcceleratorKeyMask() {
|
||||
//noinspection MagicConstant
|
||||
return SystemInfo.isMac ? ActionEvent.ALT_MASK | ActionEvent.CTRL_MASK : ActionEvent.ALT_MASK;
|
||||
return SystemInfoRt.isMac ? ActionEvent.ALT_MASK | ActionEvent.CTRL_MASK : ActionEvent.ALT_MASK;
|
||||
}
|
||||
|
||||
public static void registerMnemonicAction(@NotNull JComponent component, int mnemonic) {
|
||||
|
||||
@@ -1,23 +1,9 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi;
|
||||
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
|
||||
@@ -91,7 +77,7 @@ abstract class MnemonicWrapper<T extends JComponent> implements Runnable, Proper
|
||||
int code = disabled ? KeyEvent.VK_UNDEFINED : myCode;
|
||||
if (code != getMnemonicCode()) setMnemonicCode(code);
|
||||
// update input map to support Alt-based mnemonics
|
||||
if (SystemInfo.isMac && Registry.is("ide.mac.alt.mnemonic.without.ctrl")) {
|
||||
if (SystemInfoRt.isMac && Registry.is("ide.mac.alt.mnemonic.without.ctrl")) {
|
||||
InputMap map = myComponent.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
|
||||
if (map != null) updateInputMap(map, code);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.actionSystem;
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.util.BitUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -33,7 +19,7 @@ public class CommonShortcuts {
|
||||
public static final ShortcutSet ALT_ENTER = new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.ALT_DOWN_MASK));
|
||||
public static final ShortcutSet ENTER = new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
|
||||
public static final ShortcutSet CTRL_ENTER = new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
|
||||
SystemInfo.isMac
|
||||
SystemInfoRt.isMac
|
||||
? InputEvent.META_DOWN_MASK
|
||||
: InputEvent.CTRL_DOWN_MASK));
|
||||
public static final ShortcutSet INSERT = new CustomShortcutSet(getInsertKeystroke());
|
||||
@@ -67,8 +53,8 @@ public class CommonShortcuts {
|
||||
}
|
||||
|
||||
public static KeyStroke getInsertKeystroke() {
|
||||
return SystemInfo.isMac ? KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK)
|
||||
: KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0);
|
||||
return SystemInfoRt.isMac ? KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK)
|
||||
: KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0);
|
||||
}
|
||||
|
||||
public static ShortcutSet getCopy() {
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.fileChooser;
|
||||
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
|
||||
public class FileChooserDescriptorFactory {
|
||||
@@ -44,7 +30,7 @@ public class FileChooserDescriptorFactory {
|
||||
return new FileChooserDescriptor(true, false, false, false, false, false) {
|
||||
@Override
|
||||
public boolean isFileSelectable(VirtualFile file) {
|
||||
return super.isFileSelectable(file) || SystemInfo.isMac && file.isDirectory() && "app".equals(file.getExtension());
|
||||
return super.isFileSelectable(file) || SystemInfoRt.isMac && file.isDirectory() && "app".equals(file.getExtension());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.fileChooser;
|
||||
|
||||
import com.intellij.ide.highlighter.ArchiveFileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.VFileProperty;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -89,7 +89,7 @@ public class FileElement {
|
||||
return file != null &&
|
||||
file.isValid() &&
|
||||
file.isInLocalFileSystem() &&
|
||||
(file.is(VFileProperty.HIDDEN) || SystemInfo.isUnix && file.getName().startsWith("."));
|
||||
(file.is(VFileProperty.HIDDEN) || SystemInfoRt.isUnix && file.getName().startsWith("."));
|
||||
}
|
||||
|
||||
public static boolean isArchive(@Nullable VirtualFile file) {
|
||||
|
||||
@@ -1,24 +1,11 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.fileTypes;
|
||||
|
||||
import com.intellij.execution.configurations.GeneralCommandLine;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -84,11 +71,11 @@ public class NativeFileType implements INativeFileType {
|
||||
|
||||
public static boolean openAssociatedApplication(@NotNull final VirtualFile file) {
|
||||
final List<String> commands = new ArrayList<>();
|
||||
if (SystemInfo.isWindows) {
|
||||
if (SystemInfoRt.isWindows) {
|
||||
commands.add("rundll32.exe");
|
||||
commands.add("url.dll,FileProtocolHandler");
|
||||
}
|
||||
else if (SystemInfo.isMac) {
|
||||
else if (SystemInfoRt.isMac) {
|
||||
commands.add("/usr/bin/open");
|
||||
}
|
||||
else if (SystemInfo.hasXdgOpen()) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user