本文整理汇总了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();
}
示例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();
}
示例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;
}
}
示例4: UnsupportedSystemException
public UnsupportedSystemException() {
super("Unsupported OS/desktop: " + SystemInfo.OS_NAME + '/' + SystemInfo.SUN_DESKTOP);
}
示例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));
}
示例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);
}