Elexis API documentation
Version 2.1.6 as of December 11 2011

com.sun.star.comp.beans
Class LocalOfficeConnection

java.lang.Object
  extended by com.sun.star.comp.beans.LocalOfficeConnection

public class LocalOfficeConnection
extends java.lang.Object

This class reprecents a connection to the local office application.

Since:
OOo 2.0.0

Field Summary
static java.lang.String OFFICE_APP_NAME
           
static java.lang.String OFFICE_ID_SUFFIX
           
static java.lang.String OFFICE_LIB_NAME
           
 
Constructor Summary
LocalOfficeConnection()
          Constructor.
 
Method Summary
 void addEventListener(XEventListener listener)
          Adds an event listener to the object.
 OfficeWindow createOfficeWindow(java.awt.Container container)
          Creates an office window.
 void dispose()
          Closes the connection.
 XComponentContext getComponentContext()
          Retrives the UNO component context.
 void removeEventListener(XEventListener listener)
          Removes an event listener from the listener list.
 void setContainerFactory(ContainerFactory containerFactory)
          Sets an AWT container catory.
 void setUnoUrl(java.lang.String url)
          Sets a connection URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 in OFFICE_PROP_FILE in the user home directory.
"com.sun.star.beans.path" - the office application directory;
"com.sun.star.beans.libpath" - native libraries directory.

Method Detail

setUnoUrl

public void setUnoUrl(java.lang.String url)
               throws java.net.MalformedURLException
Sets 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
 

Parameters:
url - This is UNO URL which discribes the type of a connection.
Throws:
java.net.MalformedURLException

setContainerFactory

public void setContainerFactory(ContainerFactory containerFactory)
Sets an AWT container catory.

Parameters:
containerFactory - This is a application provided AWT container factory.

getComponentContext

public XComponentContext getComponentContext()
Retrives 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 return null if it fails to connect to the office application.

Returns:
The office UNO component context.

createOfficeWindow

public OfficeWindow createOfficeWindow(java.awt.Container container)
Creates an office window. The window is either a sub-class of java.awt.Canvas (local) or java.awt.Container (RVP).

Parameters:
container - This is an AWT container.
Returns:
The office window instance.

dispose

public void dispose()
Closes the connection.


addEventListener

public void addEventListener(XEventListener listener)
Adds an event listener to the object.

Parameters:
listener - is a listener object.

removeEventListener

public void removeEventListener(XEventListener listener)
Removes an event listener from the listener list.

Parameters:
listener - is a listener object.

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis