|
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.OfficeConnector
@ThirdParty(value="using OpenOffice libraries") public class OfficeConnector
provides methods to setup the context for OpenOffice connections for all other classes in this package.
| Method Summary | |
|---|---|
static com.sun.star.uno.XComponentContext |
createRemoteContext(String host)
|
static com.sun.star.uno.XComponentContext |
createRemoteContext(String host,
int port)
|
static com.sun.star.uno.XComponentContext |
createSocketContext(File ooProgramDir)
|
static com.sun.star.uno.XComponentContext |
createSocketContext(File ooProgramDir,
long timeout)
transparently creates a local office process (if required), drains its output and connects to it |
static File |
findOfficeDir()
|
static com.sun.star.uno.XComponentContext |
getContext()
returns the cached context maintained in this class. |
static com.sun.star.uno.XComponentContext |
getCurrentContext()
may return null if not yet initialized |
static com.sun.star.frame.XDesktop |
getDesktop()
|
static File |
getOfficeProgramPath()
if non-null, it is used to set the context via sockets; if null, the standard pipe mechanism is used. |
static String |
getStandardAcceptOptions(String host,
int port)
|
static String[] |
getStandardProcessOptions()
|
static boolean |
isContextAvailable()
determines whether a context has already been set or not |
static void |
setContext(com.sun.star.uno.XComponentContext context)
allows to manually set the context; calls terminate() before the new context is set |
static void |
setContextFactory(Factory<com.sun.star.uno.XComponentContext> factory)
allows to provide a custom way to initialize the context used in getContext() |
static void |
setOfficeProgramPath(File officeProgramPath)
sets the program path for OpenOffice and determines whether (in case of a non-null value) the socket connection method is to be used upon creating the context, or the standard pipe mechanism. |
static void |
setSocketContext(File ooProgramDir)
creates a socket context on the given path and directly sets the same to be available upon subsequent calls to getContext() |
static Process |
startOfficeProcess(File ooProgramFolder)
|
static Process |
startOfficeProcess(File ooProgramFolder,
String acceptOption)
uses the standard options; see getStandardProcessOptions() |
static Process |
startOfficeProcess(File ooProgramFolder,
String acceptOption,
String[] options)
|
static boolean |
terminate()
terminates all current OpenOffice related desktop activities (if the context has been set before); all OpenOffice windows (including those started separately by a user) will be closed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void setContext(com.sun.star.uno.XComponentContext context)
terminate() before the new context is set
createRemoteContext(String),
createSocketContext(File)public static void setContextFactory(Factory<com.sun.star.uno.XComponentContext> factory)
getContext()
public static File findOfficeDir()
public static void setSocketContext(File ooProgramDir)
throws OfficeException,
IOException
getContext()
OfficeException
IOExceptioncreateSocketContext(File)public static boolean isContextAvailable()
public static File getOfficeProgramPath()
getContext(),
setOfficeProgramPath(File)public static void setOfficeProgramPath(File officeProgramPath)
officeProgramPath - the directory that contains the soffice executable within the
OpenOffice directory treegetOfficeProgramPath(),
getContext()public static com.sun.star.uno.XComponentContext getCurrentContext()
public static com.sun.star.uno.XComponentContext getContext()
throws OfficeException
OfficeExceptionsetContextFactory(Factory),
setContext(XComponentContext),
getOfficeProgramPath(),
isContextAvailable()
public static com.sun.star.uno.XComponentContext createRemoteContext(String host)
throws OfficeException
OfficeException
public static com.sun.star.uno.XComponentContext createRemoteContext(String host,
int port)
throws OfficeException
OfficeException
public static com.sun.star.uno.XComponentContext createSocketContext(File ooProgramDir)
throws OfficeException,
IOException
OfficeException
IOException
public static com.sun.star.uno.XComponentContext createSocketContext(File ooProgramDir,
long timeout)
throws OfficeException,
IOException
OfficeException
IOExceptionpublic static String[] getStandardProcessOptions()
public static String getStandardAcceptOptions(String host,
int port)
public static Process startOfficeProcess(File ooProgramFolder)
throws OfficeException,
IOException
OfficeException
IOException
public static Process startOfficeProcess(File ooProgramFolder,
String acceptOption)
throws OfficeException,
IOException
getStandardProcessOptions()
OfficeException
IOException
public static Process startOfficeProcess(File ooProgramFolder,
String acceptOption,
String[] options)
throws OfficeException,
IOException,
IllegalArgumentException
OfficeException
IOException
IllegalArgumentException
public static com.sun.star.frame.XDesktop getDesktop()
throws OfficeException
OfficeExceptionpublic static boolean terminate()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||