当前位置: 首页>>代码示例>>Java>>正文


Java SystemInfo.isWindows方法代码示例

本文整理汇总了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);
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:22,代码来源:CommandLineProviderTest.java

示例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");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:MavenProjectReaderTest.java

示例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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:GeneralCommandLine.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:RunnerMediator.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:IdeFrameDecorator.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:PythonSdkFlavor.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:VirtualEnvSdkFlavor.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PythonStringUtil.java

示例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);
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:11,代码来源:NotificationUtils.java

示例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);
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:11,代码来源:NotificationUtils.java

示例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);
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:11,代码来源:NotificationUtils.java

示例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);
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:9,代码来源:PowerShellServiceFactory.java

示例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;
}
 
开发者ID:endoidou,项目名称:CopyCurrentActivity,代码行数:12,代码来源:CopyCurrentActivityAction.java

示例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) { }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:IdeaApplication.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:PyLocalPositionConverter.java


注:本文中的com.intellij.openapi.util.SystemInfo.isWindows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。