菜单项的显示/隐藏取决于plugin.xml中的os.name

问题描述 投票:0回答:1
java eclipse eclipse-plugin eclipse-rcp
1个回答
2
投票

osgi.os
环境变量对操作系统有更明确的值。其值在
org.eclipse.osgi.service.environment.Constants
:

中定义
public static final String OS_WIN32 = "win32";
public static final String OS_LINUX = "linux";
public static final String OS_AIX = "aix";
public static final String OS_SOLARIS = "solaris";
public static final String OS_HPUX = "hpux";
public static final String OS_QNX = "qnx";
public static final String OS_MACOSX = "macosx";
public static final String OS_EPOC32 = "epoc32";
public static final String OS_OS400 = "os/400"; 
public static final String OS_OS390 = "os/390"; 
public static final String OS_ZOS = "z/os"; 
public static final String OS_FREEBSD = "freebsd";
public static final String OS_UNKNOWN = "unknown";

注意:尽管它的名称(以及

Constants
类中的注释)
win32
适用于 32 和 64 位 Windows。

处理器架构还有

osgi.arch

public static final String ARCH_X86 = "x86";
public static final String ARCH_X86_64 = "x86_64";
public static final String ARCH_PA_RISC = "PA_RISC";
public static final String ARCH_PPC = "ppc";
public static final String ARCH_PPC64 = "ppc64";
public static final String ARCH_SPARC = "sparc";
public static final String ARCH_IA64 = "ia64"; 
public static final String ARCH_IA64_32 = "ia64_32";

最后

osgi.ws
给出了窗口系统:

public static final String WS_WIN32 = "win32";
public static final String WS_WPF = "wpf"; 
public static final String WS_MOTIF = "motif";
public static final String WS_GTK = "gtk";
public static final String WS_PHOTON = "photon";
public static final String WS_CARBON = "carbon";
public static final String WS_COCOA = "cocoa";
public static final String WS_S60 = "s60";
public static final String WS_UNKNOWN = "unknown";
© www.soinside.com 2019 - 2024. All rights reserved.