|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.ooffice.OfficeUtils
@ThirdParty(value="uses OpenOffice.org libraries") public class OfficeUtils
general utilities for OpenOffice
| Nested Class Summary | |
|---|---|
static class |
OfficeUtils.TargetFrame
|
| Field Summary | |
|---|---|
static int |
ALL
search flag option |
static int |
CHILDREN
search flag option |
static int |
CREATE
search flag option |
static int |
GLOBAL
search flag option |
static int |
PARENT
search flag option |
static int |
SELF
search flag option |
static int |
SIBLINGS
search flag option |
static int |
TASKS
search flag option |
| Method Summary | ||
|---|---|---|
static Properties |
asProperties(com.sun.star.beans.XPropertySet pset)
|
|
static void |
closeComponent(com.sun.star.lang.XComponent component)
closes and disposes the document (attemting to setting it to unmodified before). |
|
static void |
debugPrintSupportedTypes(Object obj)
prints all the supported interfaces by query(Class, Object) for the given object |
|
static void |
debugPrintXProperties(Object obj)
|
|
static LinkedList<Class<?>> |
findQueryPath(Object obj,
Class<?> targetClass)
|
|
static com.sun.star.lang.XComponent |
getActiveComponent()
|
|
static int |
getColorNumber(Color c)
|
|
static com.sun.star.frame.XComponentLoader |
getComponentLoader()
|
|
static String |
getPrintXPropertiesAsString(Object obj)
|
|
static Properties |
getProperties(Object obj)
|
|
static String |
getStoreLocation(com.sun.star.lang.XComponent component)
|
|
static Class<?>[] |
getSupportedTypes(Object obj)
returns all the supported interfaces by query(Class, Object) for the given object |
|
static String[] |
getXPropertyKeys(Object obj)
|
|
static Object |
getXPropertyValue(Object obj,
String key)
|
|
static boolean |
isEmbeddedURL(String unoURL)
|
|
static
|
loadDocument(Class<T> type,
File file,
Map<?,?> props,
OfficeUtils.TargetFrame target,
int searchFlag)
|
|
static
|
loadDocument(Class<T> type,
InputStream in,
Map<?,?> props,
OfficeUtils.TargetFrame target,
int searchFlag)
|
|
static
|
loadDocument(Class<T> type,
String unoUrl,
Map<?,?> props,
OfficeUtils.TargetFrame target,
int searchFlag)
|
|
static
|
loadDocument(Class<T> type,
URL url,
Map<?,?> props,
OfficeUtils.TargetFrame target,
int searchFlag)
|
|
static com.sun.star.beans.PropertyValue |
makePropertyValue(String key,
Object value)
|
|
static com.sun.star.beans.PropertyValue[] |
makePropertyValues(Map<?,?> props)
|
|
static String |
makeURLString(File file)
Deprecated. use translateUrlToUno(String) instead |
|
static void |
printComponent(com.sun.star.lang.XComponent component,
Map<?,?> printerProperties,
Map<?,?> jobProperties)
|
|
static void |
printComponent(com.sun.star.lang.XComponent component,
String printerName,
Map<?,?> props)
|
|
static void |
printComponent(com.sun.star.lang.XComponent component,
String printerName,
String trayName,
Map<?,?> props)
|
|
static
|
query(Class<T> c,
Object xObj)
utility method to ease access to the query interface of OpenOffice |
|
static void |
setXPropertyValue(Object obj,
String key,
Object value)
|
|
static void |
storeComponent(com.sun.star.lang.XComponent component)
|
|
static void |
storeComponent(com.sun.star.lang.XComponent component,
OutputStream out,
Map<?,?> props)
|
|
static void |
storeComponent(com.sun.star.lang.XComponent component,
URL url,
Map<?,?> props,
boolean representNewLocation)
|
|
static Locale |
toLocale(com.sun.star.lang.Locale l)
|
|
static com.sun.star.lang.Locale |
toOfficeLocale(Locale locale)
|
|
static int |
translateToMM(int pixel)
translates the given number of pixels into 100th mm value used by most office attribute values |
|
static int |
translateToPixel(int mm)
translates the given 100th mm value (used by most office attribute values) into the number of pixels |
|
static String |
translateUnoToUrl(String unoUrl)
|
|
static String |
translateUrlToUno(String url)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PARENT
public static final int SELF
public static final int CHILDREN
public static final int CREATE
public static final int SIBLINGS
public static final int TASKS
public static final int ALL
public static final int GLOBAL
| Method Detail |
|---|
public static LinkedList<Class<?>> findQueryPath(Object obj,
Class<?> targetClass)
throws OfficeException
OfficeException
public static <T> T query(Class<T> c,
Object xObj)
public static <T> T loadDocument(Class<T> type,
File file,
Map<?,?> props,
OfficeUtils.TargetFrame target,
int searchFlag)
throws OfficeException,
IOException
OfficeException
IOException@Deprecated public static String makeURLString(File file)
translateUrlToUno(String) instead
public static String translateUrlToUno(String url)
throws OfficeException
OfficeException
public static String translateUnoToUrl(String unoUrl)
throws OfficeException
OfficeExceptionpublic static com.sun.star.lang.Locale toOfficeLocale(Locale locale)
public static Locale toLocale(com.sun.star.lang.Locale l)
public static <T> T loadDocument(Class<T> type,
URL url,
Map<?,?> props,
OfficeUtils.TargetFrame target,
int searchFlag)
throws OfficeException,
IOException,
IllegalArgumentException
OfficeException
IOException
IllegalArgumentException
public static <T> T loadDocument(Class<T> type,
InputStream in,
Map<?,?> props,
OfficeUtils.TargetFrame target,
int searchFlag)
throws OfficeException,
IOException
OfficeException
IOException
public static <T> T loadDocument(Class<T> type,
String unoUrl,
Map<?,?> props,
OfficeUtils.TargetFrame target,
int searchFlag)
throws OfficeException,
IOException,
IllegalArgumentException
unoUrl - must be given in the internal UNO form
OfficeException
IOException
IllegalArgumentExceptiontranslateUrlToUno(String)
public static com.sun.star.lang.XComponent getActiveComponent()
throws OfficeException
OfficeException
public static com.sun.star.frame.XComponentLoader getComponentLoader()
throws OfficeException
OfficeExceptionpublic static String getStoreLocation(com.sun.star.lang.XComponent component)
public static void storeComponent(com.sun.star.lang.XComponent component)
throws IOException,
IllegalArgumentException
IOException
IllegalArgumentException
public static void storeComponent(com.sun.star.lang.XComponent component,
OutputStream out,
Map<?,?> props)
throws IOException,
OfficeException
IOException
OfficeException
public static void storeComponent(com.sun.star.lang.XComponent component,
URL url,
Map<?,?> props,
boolean representNewLocation)
throws IOException,
OfficeException
IOException
OfficeException
public static void printComponent(com.sun.star.lang.XComponent component,
String printerName,
Map<?,?> props)
throws IllegalArgumentException
IllegalArgumentException
public static void printComponent(com.sun.star.lang.XComponent component,
String printerName,
String trayName,
Map<?,?> props)
throws IllegalArgumentException
IllegalArgumentException
public static void printComponent(com.sun.star.lang.XComponent component,
Map<?,?> printerProperties,
Map<?,?> jobProperties)
throws IllegalArgumentException
IllegalArgumentException
public static void closeComponent(com.sun.star.lang.XComponent component)
throws IOException
IOException - (instead of others) so that implementing Closeable is easy for the given componentpublic static com.sun.star.beans.PropertyValue[] makePropertyValues(Map<?,?> props)
public static com.sun.star.beans.PropertyValue makePropertyValue(String key,
Object value)
public static int translateToMM(int pixel)
public static int translateToPixel(int mm)
public static boolean isEmbeddedURL(String unoURL)
public static int getColorNumber(Color c)
public static Properties getProperties(Object obj)
throws OfficeException
OfficeException
public static String[] getXPropertyKeys(Object obj)
throws IllegalArgumentException
IllegalArgumentException
public static void setXPropertyValue(Object obj,
String key,
Object value)
throws IllegalArgumentException,
OfficeException
IllegalArgumentException
OfficeException
public static Object getXPropertyValue(Object obj,
String key)
throws OfficeException,
IllegalArgumentException
OfficeException
IllegalArgumentException
@Todo(value="get rid of the com.sun.star.uno.RuntimeException since OpenOffice 3.1")
public static Properties asProperties(com.sun.star.beans.XPropertySet pset)
throws OfficeException
OfficeExceptionpublic static Class<?>[] getSupportedTypes(Object obj)
query(Class, Object) for the given object
public static void debugPrintXProperties(Object obj)
public static String getPrintXPropertiesAsString(Object obj)
public static void debugPrintSupportedTypes(Object obj)
query(Class, Object) for the given object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||