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


Java SystemInfo.OS_NAME属性代码示例

本文整理汇总了Java中com.intellij.openapi.util.SystemInfo.OS_NAME属性的典型用法代码示例。如果您正苦于以下问题:Java SystemInfo.OS_NAME属性的具体用法?Java SystemInfo.OS_NAME怎么用?Java SystemInfo.OS_NAME使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.openapi.util.SystemInfo的用法示例。


在下文中一共展示了SystemInfo.OS_NAME属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUsages

@NotNull
@Override
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
  UIManager.LookAndFeelInfo laf = LafManager.getInstance().getCurrentLookAndFeel();
  String key = SystemInfo.OS_NAME + " - ";
  if (!StringUtil.isEmptyOrSpaces(SystemInfo.SUN_DESKTOP)) {
    key += SystemInfo.SUN_DESKTOP + " - ";
  }
  return laf != null ? Collections.singleton(new UsageDescriptor(key + laf.getName(), 1))
                     : Collections.<UsageDescriptor>emptySet();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:LaFUsagesCollector.java

示例2: JnaUnixMediatorImpl

private JnaUnixMediatorImpl() throws Exception {
  if (SystemInfo.isLinux) {
    if ("arm".equals(SystemInfo.OS_ARCH)) {
      if (SystemInfo.is32Bit) {
        myOffsets = LINUX_ARM;
      } else {
        throw new IllegalStateException("AArch64 architecture is not supported");
      }
    }
    else if ("ppc".equals(SystemInfo.OS_ARCH)) {
      myOffsets = SystemInfo.is32Bit ? LNX_PPC32 : LNX_PPC64;
    }
    else {
      myOffsets = SystemInfo.is32Bit ? LINUX_32 : LINUX_64;
    }
  }
  else if (SystemInfo.isMac | SystemInfo.isFreeBSD) {
    myOffsets = SystemInfo.is32Bit ? BSD_32 : BSD_64;
  }
  else if (SystemInfo.isSolaris) {
    myOffsets = SystemInfo.is32Bit ? SUN_OS_32 : SUN_OS_64;
  }
  else {
    throw new IllegalStateException("Unsupported OS/arch: " + SystemInfo.OS_NAME + "/" + SystemInfo.OS_ARCH);
  }

  myLibC = (LibC)Native.loadLibrary("c", LibC.class);
  myUid = myLibC.getuid();
  myGid = myLibC.getgid();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:FileSystemUtil.java

示例3: getLinkText

private static String getLinkText() {
  // TODO ARM support?
  if (SystemInfo.isMac) {
    return "Mac OS X x64";
  }
  else if (SystemInfo.isLinux) {
    return SystemInfo.is32Bit ? "Linux x86" : "Linux x64";
  }
  else if (SystemInfo.isWindows) {
    return SystemInfo.is32Bit ? "Windows x86" : "Windows x64";
  }
  else {
    return SystemInfo.OS_NAME;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:JdkLocationStep.java

示例4: UnsupportedSystemException

public UnsupportedSystemException() {
  super("Unsupported OS/desktop: " + SystemInfo.OS_NAME + '/' + SystemInfo.SUN_DESKTOP);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:ExecUtil.java

示例5: getUsages

@NotNull
@Override
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
  String osName = SystemInfo.isLinux ? "Linux" : SystemInfo.isMac ? "Mac OS X" : SystemInfo.isWindows ? "Windows" : SystemInfo.OS_NAME;
  return Collections.singleton(new UsageDescriptor(osName, 1));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:OsNameUsageCollector.java

示例6: logError

private static void logError(Logger log, String message, Throwable t) {
  message = message + " (OS: " + SystemInfo.OS_NAME + " " + SystemInfo.OS_VERSION + ")";
  log.error(message, t);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:StartupUtil.java


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