Package com.sun.star.comp.beans
Class LocalOfficeConnection
- java.lang.Object
-
- com.sun.star.comp.beans.LocalOfficeConnection
-
- All Implemented Interfaces:
OfficeConnection,com.sun.star.lang.XComponent,com.sun.star.uno.XInterface
public class LocalOfficeConnection extends java.lang.Object implements OfficeConnection
This class represents a connection to the local office application.- Since:
- OOo 2.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringOFFICE_APP_NAMEstatic java.lang.StringOFFICE_ID_SUFFIXstatic java.lang.StringOFFICE_LIB_NAME
-
Constructor Summary
Constructors Modifier Constructor Description LocalOfficeConnection()Constructor.protectedLocalOfficeConnection(com.sun.star.uno.XComponentContext xContext)protected Constructor Initialise a LocalOfficeConnection with an already running office.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddEventListener(com.sun.star.lang.XEventListener listener)Adds an event listener to the object.OfficeWindowcreateOfficeWindow(java.awt.Container container)Deprecated.voiddispose()Closes the connection.com.sun.star.uno.XComponentContextgetComponentContext()Retrieves the UNO component context.voidremoveEventListener(com.sun.star.lang.XEventListener listener)Removes an event listener from the listener list.voidsetContainerFactory(ContainerFactory containerFactory)Deprecated.voidsetUnoUrl(java.lang.String url)Sets a connection URL.
-
-
-
Field Detail
-
OFFICE_APP_NAME
public static final java.lang.String OFFICE_APP_NAME
- See Also:
- Constant Field Values
-
OFFICE_LIB_NAME
public static final java.lang.String OFFICE_LIB_NAME
- See Also:
- Constant Field Values
-
OFFICE_ID_SUFFIX
public static final java.lang.String OFFICE_ID_SUFFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LocalOfficeConnection
public LocalOfficeConnection()
Constructor. Sets up paths to the office application and native libraries if values are available inOFFICE_PROP_FILEin the user home directory.
"com.sun.star.beans.path" - the office application directory;
"com.sun.star.beans.libpath" - native libraries directory.
-
LocalOfficeConnection
protected LocalOfficeConnection(com.sun.star.uno.XComponentContext xContext)
protected Constructor Initialise a LocalOfficeConnection with an already running office. This C'Tor is only used in complex tests at the moment.- Parameters:
xContext-
-
-
Method Detail
-
setUnoUrl
public void setUnoUrl(java.lang.String url) throws java.net.MalformedURLExceptionSets a connection URL. This implementation accepts a UNO URL with following format:
url := uno:localoffice[,<params>];urp;StarOffice.ServiceManager params := <path>[,<pipe>] path := path=<pathv> pipe := pipe=<pipev> pathv := platform_specific_path_to_the_local_office_distribution pipev := local_office_connection_pipe_name
- Specified by:
setUnoUrlin interfaceOfficeConnection- Parameters:
url- This is UNO URL which describes the type of a connection.- Throws:
java.net.MalformedURLException
-
setContainerFactory
@Deprecated public void setContainerFactory(ContainerFactory containerFactory)
Deprecated.Sets an AWT container factory.- Specified by:
setContainerFactoryin interfaceOfficeConnection- Parameters:
containerFactory- This is an application provided AWT container factory.
-
getComponentContext
public com.sun.star.uno.XComponentContext getComponentContext()
Retrieves the UNO component context. Establishes a connection if necessary and initialises the UNO service manager if it has not already been initialised. This method can returnnullif it fails to connect to the office application.- Specified by:
getComponentContextin interfaceOfficeConnection- Returns:
- The office UNO component context.
-
createOfficeWindow
@Deprecated public OfficeWindow createOfficeWindow(java.awt.Container container)
Deprecated.Creates an office java.awt.Canvas based window.- Specified by:
createOfficeWindowin interfaceOfficeConnection- Parameters:
container- This is an AWT container.- Returns:
- The office window instance.
-
dispose
public void dispose()
Closes the connection.- Specified by:
disposein interfacecom.sun.star.lang.XComponent
-
addEventListener
public void addEventListener(com.sun.star.lang.XEventListener listener)
Adds an event listener to the object.- Specified by:
addEventListenerin interfacecom.sun.star.lang.XComponent- Parameters:
listener- is a listener object.
-
removeEventListener
public void removeEventListener(com.sun.star.lang.XEventListener listener)
Removes an event listener from the listener list.- Specified by:
removeEventListenerin interfacecom.sun.star.lang.XComponent- Parameters:
listener- is a listener object.
-
-