Holger's
Java API

com.antelmann.ooffice
Class OOUtils

java.lang.Object
  extended by com.antelmann.ooffice.OOUtils
All Implemented Interfaces:
ThirdParty

public class OOUtils
extends Object
implements ThirdParty

general utilities for OpenOffice This class implements ThirdParty for its use of OpenOffice libraries; see www.openoffice.org

Author:
Holger Antelmann

Nested Class Summary
static class OOUtils.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 void closeComponent(com.sun.star.lang.XComponent component)
          closes and disposes the document; throws IOException (instead of others) so that implementing Closeable is easy for the given component
static void debugPrintXProperties(com.sun.star.beans.XPropertySet ps)
           
static com.sun.star.lang.XComponent getActiveComponent()
           
static com.sun.star.frame.XComponentLoader getComponentLoader()
           
static String getStoreLocation(com.sun.star.lang.XComponent component)
           
static
<T> T
loadDocument(Class<T> type, File file, Map<Object,Object> props, OOUtils.TargetFrame target, int searchFlag)
           
static
<T> T
loadDocument(Class<T> type, String url, Map<Object,Object> props, OOUtils.TargetFrame target, int searchFlag)
           
static com.sun.star.beans.PropertyValue[] makePropertyValues(Map<Object,Object> props)
           
static String makeURLString(File file)
           
static void printComponent(com.sun.star.lang.XComponent component, Map<Object,Object> printerProperties, Map<Object,Object> jobProperties)
           
static void printComponent(com.sun.star.lang.XComponent component, String printerName, Map<Object,Object> props)
           
static
<T> T
query(Class<T> c, Object xObj)
          utility method to ease access to the query interface of OpenOffice
static void storeComponent(com.sun.star.lang.XComponent component)
           
static void storeComponent(com.sun.star.lang.XComponent component, String url, Map<Object,Object> props, boolean representNewLocation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARENT

public static final int PARENT
search flag option

See Also:
Constant Field Values

SELF

public static final int SELF
search flag option

See Also:
Constant Field Values

CHILDREN

public static final int CHILDREN
search flag option

See Also:
Constant Field Values

CREATE

public static final int CREATE
search flag option

See Also:
Constant Field Values

SIBLINGS

public static final int SIBLINGS
search flag option

See Also:
Constant Field Values

TASKS

public static final int TASKS
search flag option

See Also:
Constant Field Values

ALL

public static final int ALL
search flag option

See Also:
Constant Field Values

GLOBAL

public static final int GLOBAL
search flag option

See Also:
Constant Field Values
Method Detail

query

public static <T> T query(Class<T> c,
                          Object xObj)
utility method to ease access to the query interface of OpenOffice


loadDocument

public static <T> T loadDocument(Class<T> type,
                                 File file,
                                 Map<Object,Object> props,
                                 OOUtils.TargetFrame target,
                                 int searchFlag)
                      throws OfficeException,
                             IOException
Throws:
OfficeException
IOException

makeURLString

public static String makeURLString(File file)

loadDocument

public static <T> T loadDocument(Class<T> type,
                                 String url,
                                 Map<Object,Object> props,
                                 OOUtils.TargetFrame target,
                                 int searchFlag)
                      throws OfficeException,
                             IOException
Throws:
OfficeException
IOException

getActiveComponent

public static com.sun.star.lang.XComponent getActiveComponent()
                                                       throws OfficeException
Throws:
OfficeException

getComponentLoader

public static com.sun.star.frame.XComponentLoader getComponentLoader()
                                                              throws OfficeException
Throws:
OfficeException

getStoreLocation

public static String getStoreLocation(com.sun.star.lang.XComponent component)

storeComponent

public static void storeComponent(com.sun.star.lang.XComponent component)
                           throws IOException,
                                  IllegalArgumentException
Throws:
IOException
IllegalArgumentException

storeComponent

public static void storeComponent(com.sun.star.lang.XComponent component,
                                  String url,
                                  Map<Object,Object> props,
                                  boolean representNewLocation)
                           throws IOException
Throws:
IOException

printComponent

public static void printComponent(com.sun.star.lang.XComponent component,
                                  String printerName,
                                  Map<Object,Object> props)
                           throws IllegalArgumentException
Throws:
IllegalArgumentException

printComponent

public static void printComponent(com.sun.star.lang.XComponent component,
                                  Map<Object,Object> printerProperties,
                                  Map<Object,Object> jobProperties)
                           throws IllegalArgumentException
Throws:
IllegalArgumentException

closeComponent

public static void closeComponent(com.sun.star.lang.XComponent component)
                           throws IOException
closes and disposes the document; throws IOException (instead of others) so that implementing Closeable is easy for the given component

Throws:
IOException

makePropertyValues

public static com.sun.star.beans.PropertyValue[] makePropertyValues(Map<Object,Object> props)

debugPrintXProperties

public static void debugPrintXProperties(com.sun.star.beans.XPropertySet ps)


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads