public final class Info extends Object
| Constructor and Description |
|---|
Info() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compareVersions(String version1,
String version2,
int length)
比较两个版本的字符串 (ex.
|
static Optional<String> |
getConfig(com.sun.star.uno.XComponentContext context,
String propName)
获取指定属性的配置值.
|
static Optional<Object> |
getConfig(com.sun.star.uno.XComponentContext context,
String nodePath,
String propName)
获取指定路径的指定属性的配置值.
|
static Optional<com.sun.star.beans.XPropertySet> |
getConfigProperties(com.sun.star.uno.XComponentContext context,
String nodePath)
获取指定路径的配置属性.
|
static String |
getOfficeName(com.sun.star.uno.XComponentContext context)
获取给定上下文的office产品名称.
|
static String |
getOfficeVersionLong(com.sun.star.uno.XComponentContext context)
获取给定上下文的office产品版本(长版本号),例如e.g 6.1.0.3
|
static String |
getOfficeVersionShort(com.sun.star.uno.XComponentContext context)
获取给定上下文的office产品版本(短版本), e.g 6.1
|
static boolean |
isDocumentType(com.sun.star.lang.XComponent document,
String documentType)
获取给定文档是否属于给定文档类型.
|
static boolean |
isLibreOffice(com.sun.star.uno.XComponentContext context)
获取指定上下文是否用于LibreOffice安装.
|
static boolean |
isOpenOffice(com.sun.star.uno.XComponentContext context)
获取指定上下文是否用于OpenOffice安装.
|
public static boolean isOpenOffice(com.sun.star.uno.XComponentContext context)
context - 上下文.true,否则为false.InstrumentException - 如果发生UNO异常。UNO异常将导致 InstrumentException.public static boolean isLibreOffice(com.sun.star.uno.XComponentContext context)
context - 上下文.true,否则为false.InstrumentException - 如果发生UNO异常。UNO异常将导致 InstrumentException.public static String getOfficeName(com.sun.star.uno.XComponentContext context)
context - 上下文.null.InstrumentException - 如果发生UNO异常。UNO异常将导致 InstrumentException.public static String getOfficeVersionLong(com.sun.star.uno.XComponentContext context)
context - 上下文.null.InstrumentException - 如果发生UNO异常。UNO异常将导致 InstrumentException.public static String getOfficeVersionShort(com.sun.star.uno.XComponentContext context)
context - The 上下文.null.InstrumentException - 如果发生UNO异常。UNO异常将导致 InstrumentException.public static int compareVersions(String version1, String version2, int length)
version1 - 第一个比较的版本.version2 - 第二版比较.length - 用于标准化的版本长度.public static Optional<String> getConfig(com.sun.star.uno.XComponentContext context, String propName)
context - 上下文信息.propName - 要获取的属性值的属性名.InstrumentException - 如果发生UNO异常。UNO异常将导致 InstrumentException.public static Optional<Object> getConfig(com.sun.star.uno.XComponentContext context, String nodePath, String propName)
context - 上下文信息.nodePath - 属性获取的路径.propName - 要获取的属性值的属性名.InstrumentException - 如果发生UNO异常。UNO异常将导致 InstrumentException.public static Optional<com.sun.star.beans.XPropertySet> getConfigProperties(com.sun.star.uno.XComponentContext context, String nodePath)
context - 上下文信息.nodePath - 属性获取的路径.XPropertySet,包含指定路径的配置属性.public static boolean isDocumentType(com.sun.star.lang.XComponent document,
String documentType)
document - 文档.documentType - 要检查的文档类型.true,否则为true.Copyright © 2019. All rights reserved.