public final class Info extends Object
Inspired by the work of Dr. Andrew Davison from the website Java LibreOffice Programming.
| Modifier and Type | Method and Description |
|---|---|
static int |
compareVersions(@Nullable String version1,
@Nullable String version2,
int length)
Compares two versions strings (ex.
|
static @Nullable String |
getConfig(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull String propName)
Gets the configuration value of the specified property.
|
static @Nullable Object |
getConfig(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull String nodePath,
@NonNull String propName)
Gets the configuration value of the specified property for the specified path.
|
static @Nullable Object |
getConfigAccess(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull String nodePath)
Gets the read-only configuration access for the specified path.
|
static @Nullable com.sun.star.beans.XPropertySet |
getConfigProperties(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull String nodePath)
Gets the configuration properties for the specified path.
|
static @Nullable Object |
getConfigUpdateAccess(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull String nodePath)
Gets the updatable configuration access for the specified path.
|
static @Nullable String |
getOfficeName(@NonNull com.sun.star.uno.XComponentContext context)
Gets the office product name for the given context.
|
static @Nullable String |
getOfficeVersionLong(@NonNull com.sun.star.uno.XComponentContext context)
Gets the office product version (long representation) for the given context, e.g 6.1.0.3
|
static @Nullable String |
getOfficeVersionShort(@NonNull com.sun.star.uno.XComponentContext context)
Gets the office product version (short representation) for the given context, e.g 6.1
|
static boolean |
isDocumentType(@NonNull com.sun.star.lang.XComponent document,
@NonNull String documentType)
Gets whether the given document is of the given document type.
|
static boolean |
isLibreOffice(@NonNull com.sun.star.uno.XComponentContext context)
Gets whether the specified context is for a LibreOffice installation.
|
static boolean |
isOpenOffice(@NonNull com.sun.star.uno.XComponentContext context)
Gets whether the specified context is for an OpenOffice installation.
|
public static int compareVersions(@Nullable String version1, @Nullable String version2, int length)
version1 - The first version to compare.version2 - The second version to compare.length - The version length for normalization.public static boolean isDocumentType(@NonNull com.sun.star.lang.XComponent document,
@NonNull String documentType)
document - The document.documentType - The document type to check.true if the document is of the specified type, true otherwise.public static boolean isOpenOffice(@NonNull com.sun.star.uno.XComponentContext context)
context - The context.true if the specified context is for an OpenOffice installation, false
otherwise.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static boolean isLibreOffice(@NonNull com.sun.star.uno.XComponentContext context)
context - The context.true if the specified context is for an LibreOffice installation, false
otherwise.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static @Nullable String getOfficeName(@NonNull com.sun.star.uno.XComponentContext context)
context - The context.null if it could not be retrieved.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static @Nullable String getOfficeVersionLong(@NonNull com.sun.star.uno.XComponentContext context)
context - The context.null if it could not be retrieved.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static @Nullable String getOfficeVersionShort(@NonNull com.sun.star.uno.XComponentContext context)
context - The context.null if it could not be retrieved.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static @Nullable String getConfig(@NonNull com.sun.star.uno.XComponentContext context, @NonNull String propName)
context - The main context.propName - The property name of the property value to get.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static @Nullable Object getConfig(@NonNull com.sun.star.uno.XComponentContext context, @NonNull String nodePath, @NonNull String propName)
context - The main context.nodePath - The path for which the properties are get.propName - The property name of the property value to get.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static @Nullable com.sun.star.beans.XPropertySet getConfigProperties(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull String nodePath)
context - The main context.nodePath - The path for which the properties are get.XPropertySet containing the configuration properties for the specified path,
or null if not found.public static @Nullable Object getConfigAccess(@NonNull com.sun.star.uno.XComponentContext context, @NonNull String nodePath)
context - The main context.nodePath - The path for which the configuration access is get.public static @Nullable Object getConfigUpdateAccess(@NonNull com.sun.star.uno.XComponentContext context, @NonNull String nodePath)
context - The main context.nodePath - The path for which the configuration access is get.Copyright © 2016 - present; JODConverter.org. All rights reserved.