本文整理汇总了Java中com.intellij.openapi.util.SystemInfo.isWindows方法的典型用法代码示例。如果您正苦于以下问题:Java SystemInfo.isWindows方法的具体用法?Java SystemInfo.isWindows怎么用?Java SystemInfo.isWindows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.SystemInfo
的用法示例。
在下文中一共展示了SystemInfo.isWindows方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@SuppressWarnings("ResultOfMethodCallIgnored")
@Override
@BeforeMethod
public void setUp() throws Exception {
super.setUp();
m = new Mockery() {{
setImposteriser(ClassImposteriser.INSTANCE);
}};
myInfo = m.mock(PowerShellInfo.class);
final PowerShellEdition edition = SystemInfo.isWindows ? PowerShellEdition.DESKTOP : PowerShellEdition.CORE;
m.checking(new Expectations() {{
allowing(myInfo).getEdition();
will(returnValue(edition));
}});
myProvider = new PowerShellCommandLineProvider();
myScriptsRootDir = createTempDir();
myScriptFile = new File(myScriptsRootDir, SCRIPT_FILE_NAME);
myScriptFile.createNewFile();
super.registerAsTempFile(myScriptFile);
}
示例2: testActivatingProfilesByOS
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public void testActivatingProfilesByOS() throws Exception {
String os = SystemInfo.isWindows ? "windows" : SystemInfo.isMac ? "mac" : "unix";
createProjectPom("<profiles>" +
" <profile>" +
" <id>one</id>" +
" <activation>" +
" <os><family>" + os + "</family></os>" +
" </activation>" +
" </profile>" +
" <profile>" +
" <id>two</id>" +
" <activation>" +
" <os><family>xxx</family></os>" +
" </activation>" +
" </profile>" +
"</profiles>");
assertActiveProfiles("one");
}
示例3: setupEnvironment
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
protected void setupEnvironment(@NotNull Map<String, String> environment) {
environment.clear();
if (myParentEnvironmentType != ParentEnvironmentType.NONE) {
environment.putAll(getParentEnvironment());
}
if (!myEnvParams.isEmpty()) {
if (SystemInfo.isWindows) {
THashMap<String, String> envVars = new THashMap<String, String>(CaseInsensitiveStringHashingStrategy.INSTANCE);
envVars.putAll(environment);
envVars.putAll(myEnvParams);
environment.clear();
environment.putAll(envVars);
}
else {
environment.putAll(myEnvParams);
}
}
}
示例4: getRunnerPath
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Nullable
private static String getRunnerPath() {
if (!SystemInfo.isWindows) {
throw new IllegalStateException("There is no need of runner under unix based OS");
}
final String path = System.getenv(IDEA_RUNNERW);
if (path != null) {
if (new File(path).exists()) {
return path;
}
LOG.warn("Cannot locate " + STANDARD_RUNNERW + " by " + IDEA_RUNNERW + " environment variable (" + path + ")");
}
File runnerw = new File(PathManager.getBinPath(), STANDARD_RUNNERW);
if (runnerw.exists()) {
return runnerw.getPath();
}
LOG.warn("Cannot locate " + STANDARD_RUNNERW + " by default path (" + runnerw.getAbsolutePath() + ")");
return null;
}
示例5: decorate
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Nullable
public static IdeFrameDecorator decorate(@NotNull IdeFrameImpl frame) {
if (SystemInfo.isMac) {
return new MacMainFrameDecorator(frame, PlatformUtils.isAppCode());
}
else if (SystemInfo.isWindows) {
return new WinMainFrameDecorator(frame);
}
else if (SystemInfo.isXWindow) {
if (X11UiUtil.isFullScreenSupported()) {
return new EWMHFrameDecorator(frame);
}
}
return null;
}
示例6: getApplicableFlavors
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public static List<PythonSdkFlavor> getApplicableFlavors(boolean addPlatformIndependent) {
List<PythonSdkFlavor> result = new ArrayList<PythonSdkFlavor>();
if (SystemInfo.isWindows) {
result.add(WinPythonSdkFlavor.INSTANCE);
}
else if (SystemInfo.isMac) {
result.add(MacPythonSdkFlavor.INSTANCE);
}
else if (SystemInfo.isUnix) {
result.add(UnixPythonSdkFlavor.INSTANCE);
}
if (addPlatformIndependent)
result.addAll(getPlatformIndependentFlavors());
return result;
}
示例7: getCondaDefaultLocations
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public static List<VirtualFile> getCondaDefaultLocations() {
List<VirtualFile> roots = new ArrayList<VirtualFile>();
final VirtualFile userHome = LocalFileSystem.getInstance().findFileByPath(SystemProperties.getUserHome().replace('\\','/'));
if (userHome != null) {
for (String root : CONDA_DEFAULT_ROOTS) {
VirtualFile condaFolder = userHome.findChild(root);
addEnvsFolder(roots, condaFolder);
if (SystemInfo.isWindows) {
final VirtualFile appData = userHome.findFileByRelativePath("AppData\\Local\\Continuum\\" + root);
addEnvsFolder(roots, appData);
condaFolder = LocalFileSystem.getInstance().findFileByPath("C:\\" + root);
addEnvsFolder(roots, condaFolder);
}
else {
final String systemWidePath = "/opt/anaconda";
condaFolder = LocalFileSystem.getInstance().findFileByPath(systemWidePath);
addEnvsFolder(roots, condaFolder);
}
}
}
return roots;
}
示例8: isPath
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public static boolean isPath(@Nullable String s) {
if (!StringUtil.isEmpty(s)) {
s = ObjectUtils.assertNotNull(s);
s = FileUtil.toSystemIndependentName(s);
final List<String> components = StringUtil.split(s, "/");
for (String name : components) {
if (name == components.get(0) && SystemInfo.isWindows && name.endsWith(":")) {
continue;
}
if (!PathUtil.isValidFileName(name)) {
return false;
}
}
return true;
}
return false;
}
示例9: pythonNotFound
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
/**
* python提示
*/
public static void pythonNotFound() {
String tip = "command 'python' not found. ";
if (SystemInfo.isWindows) {
tip += " if first installation python or Set Environment variable, Please restart your computer";
}
errorNotification(tip);
}
示例10: packageJsonNotFound
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
/**
* package.json error message
*/
public static void packageJsonNotFound() {
String tip = "File 'package.json' not found.\n Make sure that you have run `npm install` and that you are inside a react-native project.";//找不到有效的React Native目录, 命令将停止执行
if (SystemInfo.isWindows) {
tip += " if first installation React Native or Set Environment variable, Please restart your computer";
}
errorNotification(tip);
}
示例11: gradleFileNotFound
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
/**
* build.gradle error message
*/
public static void gradleFileNotFound() {
String tip = "File 'build.gradle' not found.\n Make sure that you have run `npm install` and that you are inside a android project.";
if (SystemInfo.isWindows) {
tip += " if first installation React Native or Set Environment variable, Please restart your computer";
}
errorNotification(tip);
}
示例12: createService
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@NotNull
public CommandLineBuildService createService() {
if (SystemInfo.isWindows) {
return new PowerShellServiceWindows(myInfoProvider, myGenerator, myCmdProvider, myCommands);
} else {
return new PowerShellServiceUnix(myInfoProvider, myGenerator, myCmdProvider, myCommands);
}
}
示例13: getAdbPath
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@NotNull
private String getAdbPath(String androidSdkPath) {
String adb;
if (SystemInfo.isWindows) {
adb = ADB_WINDOWS;
} else {
adb = ADB_UNIX;
}
return androidSdkPath + ADB_SUBPATH + adb;
}
示例14: initLAF
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@SuppressWarnings({"HardCodedStringLiteral"})
private static void initLAF() {
try {
Class.forName("com.jgoodies.looks.plastic.PlasticLookAndFeel");
if (SystemInfo.isWindows) {
UIManager.installLookAndFeel("JGoodies Windows L&F", "com.jgoodies.looks.windows.WindowsLookAndFeel");
}
UIManager.installLookAndFeel("JGoodies Plastic", "com.jgoodies.looks.plastic.PlasticLookAndFeel");
UIManager.installLookAndFeel("JGoodies Plastic 3D", "com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
UIManager.installLookAndFeel("JGoodies Plastic XP", "com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
}
catch (ClassNotFoundException ignored) { }
}
示例15: normalize
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Override
protected String normalize(@Nullable String file) {
if (file == null) {
return null;
}
if (SystemInfo.isWindows) {
file = file.toLowerCase();
}
return super.normalize(file);
}