Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc for Elexis version 2.1.7.dev vom 17.03.2013

ag.ion.bion.officelayer.internal.application.connection
Class LocalOfficeConnectionGhost

java.lang.Object
  extended by ag.ion.bion.officelayer.internal.application.connection.LocalOfficeConnectionGhost
All Implemented Interfaces:
com.sun.star.comp.beans.OfficeConnection, com.sun.star.lang.XComponent, com.sun.star.uno.XInterface

public class LocalOfficeConnectionGhost
extends java.lang.Object
implements com.sun.star.comp.beans.OfficeConnection

Office connection implementation. This class bases on the implementation of the OpenOffice.org API Bean package.


Field Summary
 
Fields inherited from interface com.sun.star.lang.XComponent
UNOTYPEINFO
 
Constructor Summary
LocalOfficeConnectionGhost(IOfficeProgressMonitor officeProgressMonitor)
          Constructs new LocalOfficeConnectionGhost.
 
Method Summary
 void addEventListener(com.sun.star.lang.XEventListener eventListener)
          Adds an event listener to the object.
 com.sun.star.comp.beans.OfficeWindow createOfficeWindow(java.awt.Container container)
          Creates an office window.
 void dispose()
          Closes the connection.
 com.sun.star.uno.XComponentContext getComponentContext()
          Retrives the UNO component context.
 com.sun.star.uno.XComponentContext getCurrentComponentContext()
          Retrives the UNO component context.
 void removeEventListener(com.sun.star.lang.XEventListener eventListener)
          Removes an event listener from the listener list.
 void setContainerFactory(com.sun.star.comp.beans.ContainerFactory containerFactory)
          Sets an AWT container catory.
 void setUnoUrl(java.lang.String url)
          Sets a connection URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalOfficeConnectionGhost

public LocalOfficeConnectionGhost(IOfficeProgressMonitor officeProgressMonitor)
Constructs new LocalOfficeConnectionGhost. 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.

Parameters:
officeProgressMonitor - office progress monitor to be used (can be null)
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
 

Specified by:
setUnoUrl in interface com.sun.star.comp.beans.OfficeConnection
Parameters:
url - this is UNO URL which discribes the type of a connection
Throws:
java.net.MalformedURLException - if the URL is not valid

setContainerFactory

public void setContainerFactory(com.sun.star.comp.beans.ContainerFactory containerFactory)
Sets an AWT container catory.

Specified by:
setContainerFactory in interface com.sun.star.comp.beans.OfficeConnection
Parameters:
containerFactory - this is a application provided AWT container factory

getComponentContext

public com.sun.star.uno.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.

Specified by:
getComponentContext in interface com.sun.star.comp.beans.OfficeConnection
Returns:
the office UNO component context

getCurrentComponentContext

public com.sun.star.uno.XComponentContext getCurrentComponentContext()
Retrives the UNO component context. If no context is set, null will be returned. There will be no try to connect.

Returns:
the office UNO component context

createOfficeWindow

public com.sun.star.comp.beans.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).

Specified by:
createOfficeWindow in interface com.sun.star.comp.beans.OfficeConnection
Parameters:
container - this is an AWT container
Returns:
the office window instance

dispose

public void dispose()
Closes the connection.

Specified by:
dispose in interface com.sun.star.lang.XComponent

addEventListener

public void addEventListener(com.sun.star.lang.XEventListener eventListener)
Adds an event listener to the object.

Specified by:
addEventListener in interface com.sun.star.lang.XComponent
Parameters:
eventListener - is a listener object

removeEventListener

public void removeEventListener(com.sun.star.lang.XEventListener eventListener)
Removes an event listener from the listener list.

Specified by:
removeEventListener in interface com.sun.star.lang.XComponent
Parameters:
eventListener - is a listener object

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc for Elexis version 2.1.7.dev vom 17.03.2013