Top Description Inners Fields Constructors Methods
com.sun.star.comp.beans

public Class OOoBean

extends Container
implements Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable
Imports
com.sun.star.uno.UnoRuntime

This is the basic JavaBean for all OOo application modules.
Since
OOo 2.0.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
OOoBean.EventListener

Helper class to listen on the connection to learn when it dies.

Field Summary

Modifier and TypeField and Description
private transient Controller
private transient OfficeDocument
private transient Frame
private boolean
private boolean
private boolean
private boolean
private boolean
private transient OfficeConnection
iConnection

References Deprecated OfficeConnection is deprecated or references (maybe indirectly) at least one deprecated element.
private int
private int
private int
private transient OOoBean.EventListener
private transient com.sun.star.frame.XDesktop
private OfficeWindow
xFrameWindow

References Deprecated OfficeWindow is deprecated or references (maybe indirectly) at least one deprecated element.
private transient com.sun.star.lang.XMultiServiceFactory
private transient com.sun.star.util.XURLTransformer

Constructor Summary

AccessConstructor and Description
public
OOoBean()

Generic constructor of the OOoBean.

public
OOoBean(OfficeConnection iConnection)
Deprecated Clients could use the getOOoConnection to obtain an OfficeConnection and use it as argument in a constructor for another OOoBean instance.

Constructor for an OOoBean which uses a specific office connection.

Method Summary

Modifier and TypeMethod and Description
protected com.sun.star.beans.PropertyValue[]
addArgument(com.sun.star.beans.PropertyValue[] aArguments, final com.sun.star.beans.PropertyValue aArgument)

Adds a single argument to an array of arguments.

protected void
applyToolVisibilities()
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Applies all tool visibilities to the real thing.

public synchronized void
aquireSystemWindow()

This method causes the office window to be displayed.

public synchronized void
clear()

Resets the OOoBean to an empty status.

public synchronized void
clearDocument(boolean
Not only the document content but also the state of the bean, like visibility of child components is cleared.
bClearStateToo
)
Deprecated There is currently no way to dismiss changes, except for loading of the unchanged initial document.

Resets this bean to an empty document.

private void
dbgPrint(String aMessage)

public Controller

Returns:

a Java class which implements all interfaces which the service com::sun::star::frame::Controller implements. Thus, methods can be called directly without queryInterface. This feature might be implemented by UNO or explicitly coded.
getController
()

returns the com::sun::star::frame::Controller of the bean.

public OfficeDocument

Returns:

a Java class which implements all interfaces which the service com::sun::star::document::OfficeDocument implements. Thus, methods can be called directly without queryInterface. This feature might be implemented by UNO or explicitly coded.
getDocument
()

returns the com::sun::star::document::OfficeDocument of the bean.

public Frame

Returns:

a Java class which implements all interfaces which the service com::sun::star::frame::Frame implements. Thus, methods can be called directly without queryInterface. This feature might be implemented by UNO or explicitly coded.
getFrame
()

returns the com::sun::star::frame::Frame of the bean.

public synchronized com.sun.star.lang.XMultiServiceFactory
getMultiServiceFactory()

Returns the service factory used by this OOoBean instance.

public synchronized OfficeConnection
getOOoConnection()
References Deprecated OfficeConnection is deprecated or references (maybe indirectly) at least one deprecated element.

Returns a connection to an OOo instance.

public synchronized com.sun.star.frame.XDesktop
getOOoDesktop()

Returns the XDesktop interface of the OOo instance used by this OOoBean.

public boolean

Returns:

True if the menu bar is visible, false if the menu bar is hidden.
isMenuBarVisible
()
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Returns the visibility of the menu bar.

public boolean
isOOoConnected()
Deprecated This method is not useful in a multithreaded environment. Then all threads accessing the instance would have to be synchronized in order to make is method work. It is better to call OOoBean's methods and be prepared to catch a NoConnectionException.

Returns true if this OOoBean is connected to an OOo instance, false otherwise.

public boolean

Returns:

True if the main function bar is visible, false if the main function bar is hidden.
isStandardBarVisible
()
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Returns the visibility of the main function bar.

public boolean

Returns:

True if the status function bar is visible, false if the status function bar is hidden.
isStatusBarVisible
()
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Returns the visibility of the status function bar.

public boolean

Returns:

True if the tool function bar is visible, false if the tool function bar is hidden.
isToolBarVisible
()
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Returns the visibility of the tool function bar.

public void
loadFromByteArray(final byte[] aInBuffer, final com.sun.star.beans.PropertyValue[] aArguments)

Loads a document from a byte array.

public void
loadFromStream(final InputStream iInStream, final com.sun.star.beans.PropertyValue[] aArguments)

Loads a document from a Java stream.

public void
loadFromURL(final String aURL, final com.sun.star.beans.PropertyValue[] aArguments)

Loads the bean from the given URL.

public void
paint(Graphics aGraphics)

Overrides java.awt.Container.paint.

Deprecated

Paints the container.

public void
readExternal(ObjectInput aObjIn)

Implements java.io.Externalizable.readExternal.

Deprecated

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public synchronized void
releaseSystemWindow()
Deprecated When Component.removeNotify of the parent window of the actual office window is called, then the actions are performed for which this method needed to be called previously.

This method must be called when the OOoBean before the system window may be released by its parent AWT/Swing component.

public void
setAllBarsVisible(boolean bVisible)
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Sets visibility of all tool bars known by this OOoBean version.

public void
setMenuBarVisible(boolean
If false, the menu bar is disabled, If true, the menu bar is visible.
bVisible
)
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Sets the visibility of the menu bar.

public void
setOOoCallTimeOut(int nMilliSecs)

Sets the timeout for normal OOO methods calls in milliseconds.

public void
setOOoCheckCycle(int nMilliSecs)

Sets the period length in milliseconds to check the OOo connection.

private synchronized void
setOOoConnection(OfficeConnection iNewConnection)
References Deprecated OfficeConnection is deprecated or references (maybe indirectly) at least one deprecated element.

Sets a connection to an OOo instance.

public void
setOOoStartTimeOut(int nMilliSecs)

Sets the timeout for methods which launch OOo in milliseconds.

public void
setStandardBarVisible(boolean
If false, the main function bar is disabled, If true, the main function bar is visible.
bVisible
)
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Sets the main function bar visibility.

public void
setStatusBarVisible(boolean
If false, the status function bar is disabled, If true, the status function bar is visible.
bVisible
)
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Sets the status function bar visibility.

public void
setToolBarVisible(boolean
If false, the tool function bar is disabled, If true, the tool function bar is visible.
bVisible
)
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Sets the tool function bar visibility.

protected boolean
setToolVisible(String aProperty, String aResourceURL, boolean bOldValue, boolean
If false, the tool bar is disabled, If true, the tool bar is visible.
bNewValue
)
Deprecated Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars.

Helper method to set tool bar visibility.

public void
startOOoConnection(String aConnectionURL)

Starts a connection to an OOo instance which is launched if not running.

public synchronized void
stopOOoConnection()

Disconnects from the connected OOo instance.

public byte[]
storeToByteArray(byte[] aOutBuffer, final com.sun.star.beans.PropertyValue[] aArguments)

Stores a document to a byte array.

public OutputStream
storeToStream(OutputStream aOutStream, final com.sun.star.beans.PropertyValue[] aArguments)

Stores a document to a stream.

public void
storeToURL(final String aURL, final com.sun.star.beans.PropertyValue[] aArguments)

Stores a document to the given URL.

public void
writeExternal(ObjectOutput aObjOut)

Implements java.io.Externalizable.writeExternal.

Deprecated

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from java.awt.Container:
addaddaddaddaddaddContainerListeneraddImpladdNotifyaddPropertyChangeListeneraddPropertyChangeListenerapplyComponentOrientationareFocusTraversalKeysSetcountComponentsdeliverEventdoLayoutfindComponentAtfindComponentAtgetAlignmentXgetAlignmentYgetComponentgetComponentAtgetComponentAtgetComponentCountgetComponentsgetComponentZOrdergetContainerListenersgetFocusTraversalKeysgetFocusTraversalPolicygetInsetsgetLayoutgetListenersgetMaximumSizegetMinimumSizegetMousePositiongetPreferredSizeinsetsinvalidateisAncestorOfisFocusCycleRootisFocusCycleRootisFocusTraversalPolicyProviderisFocusTraversalPolicySetisValidateRootlayoutlistlistlocateminimumSizepaintComponentsparamStringpreferredSizeprintprintComponentsprocessContainerEventprocessEventremoveremoveremoveAllremoveContainerListenerremoveNotifysetComponentZOrdersetFocusCycleRootsetFocusTraversalKeyssetFocusTraversalPolicysetFocusTraversalPolicyProvidersetFontsetLayouttransferFocusDownCycleupdatevalidatevalidateTree

Field Detail

aControllerback to summary
private transient Controller aController
aDocumentback to summary
private transient OfficeDocument aDocument
aFrameback to summary
private transient Frame aFrame
bIgnoreVisibilityback to summary
private boolean bIgnoreVisibility
bMenuBarVisibleback to summary
private boolean bMenuBarVisible
bStandardBarVisibleback to summary
private boolean bStandardBarVisible
bStatusBarVisibleback to summary
private boolean bStatusBarVisible
bToolBarVisibleback to summary
private boolean bToolBarVisible
iConnectionback to summary
private transient OfficeConnection iConnection

References Deprecated

OfficeConnection is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

nOOoCallTimeOutback to summary
private int nOOoCallTimeOut
nOOoCheckCycleback to summary
private int nOOoCheckCycle
nOOoStartTimeOutback to summary
private int nOOoStartTimeOut
xConnectionListenerback to summary
private transient OOoBean.EventListener xConnectionListener
xDesktopback to summary
private transient com.sun.star.frame.XDesktop xDesktop
xFrameWindowback to summary
private OfficeWindow xFrameWindow

References Deprecated

OfficeWindow is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

xServiceFactoryback to summary
private transient com.sun.star.lang.XMultiServiceFactory xServiceFactory
xURLTransformerback to summary
private transient com.sun.star.util.XURLTransformer xURLTransformer

Constructor Detail

OOoBeanback to summary
public OOoBean()

Generic constructor of the OOoBean. Neither a connection is established nor any document loaded.

OOoBeanback to summary
public OOoBean(OfficeConnection iConnection) throws NoConnectionException

Deprecated

Clients could use the getOOoConnection to obtain an OfficeConnection and use it as argument in a constructor for another OOoBean instance. Calling the dispose method of the OfficeConnection or the OOoBean's stopOOoConnection method would make all instances of OOoBean stop working.

Constructor for an OOoBean which uses a specific office connection. The connection must be established but no document is loaded.

Annotations
@Deprecated
Exceptions
NoConnectionException:
if the connection is not established.

Method Detail

addArgumentback to summary
protected com.sun.star.beans.PropertyValue[] addArgument(com.sun.star.beans.PropertyValue[] aArguments, final com.sun.star.beans.PropertyValue aArgument)

Adds a single argument to an array of arguments. If the argument by its name is already in aArguments it is exchanged and aArguments is returned.

If the argument by its name is not yet in aArguments, a new array is created, aArgument added and the new array returned.

applyToolVisibilitiesback to summary
protected void applyToolVisibilities()

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Applies all tool visibilities to the real thing.

Annotations
@Deprecated
aquireSystemWindowback to summary
public synchronized void aquireSystemWindow() throws SystemWindowException, NoConnectionException

This method causes the office window to be displayed. If no document is loaded and the instance is added to a Java container that is showing, then this method needs not to be called. If later one of the methods loadFromURL, loadFromStream1, or loadFromByteArray is called, then the document is automatically displayed. Should one of the load methods have been called before the Java container was showing, then this method needs to be called after the container window was made visible (java.lang.Component.setVisible(true)).

Another scenario is that an OOoBean contains a document and is removed from a Java container and later added again. Then aquireSystemWindow needs to be called after the container window is displayed.

Exceptions
SystemWindowException:
if no system window can be acquired.
NoConnectionException:
if the connection is not established.
clearback to summary
public synchronized void clear()

Resets the OOoBean to an empty status. Any loaded document is unloaded, no matter whether it is modified or not. After calling this method, the OOoBean has no office document and no frame anymore. The connection will stay, though. This method works with or without an established connection.

clearDocumentback to summary
public synchronized void clearDocument(boolean bClearStateToo)

Deprecated

There is currently no way to dismiss changes, except for loading of the unchanged initial document. Furthermore it is unclear how derived classes handle this and what exactly their state is (e.g. what members make up their state). Calling this method on a derived class requires knowledge about their implementation. Therefore a deriving class should declare their own clearDocument if needed. Clients should call the clearDocument of the deriving class or clear which discards the currently displayed document.

Resets this bean to an empty document. If a document is loaded and the content modified, the changes are dismissed. Otherwise nothing happens. This method is intended to be overridden in derived classes. This implementation simply calls clear.

Parameters
bClearStateToo:boolean

Not only the document content but also the state of the bean, like visibility of child components is cleared.

Annotations
@Deprecated
dbgPrintback to summary
private void dbgPrint(String aMessage)
getControllerback to summary
public Controller getController() throws NoConnectionException

returns the com::sun::star::frame::Controller of the bean.

Returns:Controller

a Java class which implements all interfaces which the service com::sun::star::frame::Controller implements. Thus, methods can be called directly without queryInterface. This feature might be implemented by UNO or explicitly coded.

Exceptions
NoConnectionException:
if the connection is not established.
getDocumentback to summary
public OfficeDocument getDocument() throws NoConnectionException

returns the com::sun::star::document::OfficeDocument of the bean.

Returns:OfficeDocument

a Java class which implements all interfaces which the service com::sun::star::document::OfficeDocument implements. Thus, methods can be called directly without queryInterface. This feature might be implemented by UNO or explicitly coded.

Exceptions
NoConnectionException:
if the connection is not established.
getFrameback to summary
public Frame getFrame() throws NoConnectionException

returns the com::sun::star::frame::Frame of the bean.

Returns:Frame

a Java class which implements all interfaces which the service com::sun::star::frame::Frame implements. Thus, methods can be called directly without queryInterface. This feature might be implemented by UNO or explicitly coded.

Exceptions
NoConnectionException:
if the connection is not established.
getMultiServiceFactoryback to summary
public synchronized com.sun.star.lang.XMultiServiceFactory getMultiServiceFactory() throws NoConnectionException

Returns the service factory used by this OOoBean instance.

Exceptions
NoConnectionException:
if no connection is established and no default connection can be established.
getOOoConnectionback to summary
public synchronized OfficeConnection getOOoConnection() throws NoConnectionException

References Deprecated

OfficeConnection is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns a connection to an OOo instance. If no connection exists, a default connection will be created. An OfficeConnection can be used to register listeners of type com.sun.star.lang.EventListener, which are notified when the connection to the office dies. One should not call the dispose method, because this may result in receiving com.sun.star.lang.DisposedExceptions when calling stopOOoConnection or other API methods. If other instances share the same connection then they will stop function properly, because they lose their connection as well. The recommended way to end the connection is by calling stopOOoConnection.

Exceptions
NoConnectionException:
if no connection can be established
getOOoDesktopback to summary
public synchronized com.sun.star.frame.XDesktop getOOoDesktop() throws NoConnectionException

Returns the XDesktop interface of the OOo instance used by this OOoBean.

Exceptions
NoConnectionException:
if no connection is established and no default connection can be established.
isMenuBarVisibleback to summary
public boolean isMenuBarVisible()

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Returns the visibility of the menu bar. This method works independently from a connection or loaded document. If no connection is established or no document is loaded, this method just returns a memorized status.

Returns:boolean

True if the menu bar is visible, false if the menu bar is hidden.

Annotations
@Deprecated
isOOoConnectedback to summary
public boolean isOOoConnected()

Deprecated

This method is not useful in a multithreaded environment. Then all threads accessing the instance would have to be synchronized in order to make is method work. It is better to call OOoBean's methods and be prepared to catch a NoConnectionException.

Returns true if this OOoBean is connected to an OOo instance, false otherwise.

Annotations
@Deprecated
isStandardBarVisibleback to summary
public boolean isStandardBarVisible()

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Returns the visibility of the main function bar. This method works independently from a connection or loaded document. If no connection is established or no document is loaded, this method just returns a memorized status.

Returns:boolean

True if the main function bar is visible, false if the main function bar is hidden.

Annotations
@Deprecated
isStatusBarVisibleback to summary
public boolean isStatusBarVisible()

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Returns the visibility of the status function bar. This method works independently from a connection or loaded document. If no connection is established or no document is loaded, this method just returns a memorized status.

Returns:boolean

True if the status function bar is visible, false if the status function bar is hidden.

Annotations
@Deprecated
isToolBarVisibleback to summary
public boolean isToolBarVisible()

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Returns the visibility of the tool function bar. This method works independently from a connection or loaded document. If no connection is established or no document is loaded, this method just returns a memorized status.

Returns:boolean

True if the tool function bar is visible, false if the tool function bar is hidden.

Annotations
@Deprecated
loadFromByteArrayback to summary
public void loadFromByteArray(final byte[] aInBuffer, final com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, IOException, com.sun.star.lang.IllegalArgumentException, com.sun.star.util.CloseVetoException

Loads a document from a byte array. See loadFromURL() for further information.

loadFromStreamback to summary
public void loadFromStream(final InputStream iInStream, final com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, IOException, com.sun.star.lang.IllegalArgumentException, com.sun.star.util.CloseVetoException

Loads a document from a Java stream. See loadFromURL() for further information.

loadFromURLback to summary
public void loadFromURL(final String aURL, final com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, IOException, com.sun.star.lang.IllegalArgumentException, com.sun.star.util.CloseVetoException

Loads the bean from the given URL. If a document is already loaded and the content modified, the changes are dismissed. If no connection exists, a default connection is established.

Exceptions
NoConnectionException:
if no connection can be established.
IOException:
if an IO error occurs reading the resource specified by the URL.
IllegalArgumentException:
if either of the arguments is out of the specified range.
CloseVetoException:
if the currently displayed document cannot be closed because it is still be used, for example it is printed.
paintback to summary
public void paint(Graphics aGraphics)

Overrides java.awt.Container.paint.

Doc from java.awt.Container.paint.

Deprecated

Paints the container. This forwards the paint to any lightweight components that are children of this container. If this method is reimplemented, super.paint(g) should be called so that lightweight components are properly rendered. If a child component is entirely clipped by the current clipping setting in g, paint() will not be forwarded to that child.

Annotations
@Deprecated
@Override
readExternalback to summary
public void readExternal(ObjectInput aObjIn)

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

Deprecated

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Annotations
@Deprecated
releaseSystemWindowback to summary
public synchronized void releaseSystemWindow() throws SystemWindowException, NoConnectionException

Deprecated

When Component.removeNotify of the parent window of the actual office window is called, then the actions are performed for which this method needed to be called previously.

This method must be called when the OOoBean before the system window may be released by its parent AWT/Swing component. This is the case when java.awt.Component.isDisplayable() returns true. This is definitely the case when the OOoBean is removed from its parent container.

Annotations
@Deprecated
Exceptions
SystemWindowException:
if system window is not acquired.
NoConnectionException:
if the connection is not established.
setAllBarsVisibleback to summary
public void setAllBarsVisible(boolean bVisible)

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. For example:

com.sun.star.beans.XPropertySet xPropSet =
  (com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(
    com.sun.star.beans.XPropertySet.class, aFrame );
com.sun.star.frame.XLayoutManager xLayoutManager =
  (com.sun.star.frame.XLayoutManager) UnoRuntime.queryInterface(
    com.sun.star.frame.XLayoutManager.class,
    xPropSet.getPropertyValue( "LayoutManager" ) );
xLayoutManager.showElement("private:resource/menubar/menubar");
        

Sets visibility of all tool bars known by this OOoBean version. Initially all tool bars are visible. By hiding all tool bars utilizing this method, it is possible to turn just a subset of toolbars on afterwards, no matter whether all available tool bars are known or not.

If an older OOoBean instance is used with a newer OOo instance, some tool bars might not be affected by this method.

If no connection is established or no document is loaded, the setting is memorized until a document is loaded. Same is valid when the connection dies within this function call.

Annotations
@Deprecated
setMenuBarVisibleback to summary
public void setMenuBarVisible(boolean bVisible)

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Sets the visibility of the menu bar. Initially the menu bar is visible.

If not connected or no document loaded, the value is stored and automatically applied to the document after it is loaded. Same is valid when the connection dies within this function call.

Parameters
bVisible:boolean

If false, the menu bar is disabled, If true, the menu bar is visible.

Annotations
@Deprecated
setOOoCallTimeOutback to summary
public void setOOoCallTimeOut(int nMilliSecs)

Sets the timeout for normal OOO methods calls in milliseconds. This method does not need a connection to an OOo instance.

setOOoCheckCycleback to summary
public void setOOoCheckCycle(int nMilliSecs)

Sets the period length in milliseconds to check the OOo connection. This method does not need a connection to an OOo instance.

setOOoConnectionback to summary
private synchronized void setOOoConnection(OfficeConnection iNewConnection) throws HasConnectionException, NoConnectionException

References Deprecated

OfficeConnection is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Sets a connection to an OOo instance.

setOOoStartTimeOutback to summary
public void setOOoStartTimeOut(int nMilliSecs)

Sets the timeout for methods which launch OOo in milliseconds. This method does not need a connection to an OOo instance.

setStandardBarVisibleback to summary
public void setStandardBarVisible(boolean bVisible)

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Sets the main function bar visibility. Initially the standard bar is visible. If not connected or no document loaded, the value is stored and automatically applied to the document after it is loaded. Same is valid when the connection dies within this function call.

Parameters
bVisible:boolean

If false, the main function bar is disabled, If true, the main function bar is visible.

Annotations
@Deprecated
setStatusBarVisibleback to summary
public void setStatusBarVisible(boolean bVisible)

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Sets the status function bar visibility. Initially the status bar is visible. If not connected or no document loaded, the value is stored and automatically applied to the document after it is loaded. Same is valid when the connection dies within this function call.

Parameters
bVisible:boolean

If false, the status function bar is disabled, If true, the status function bar is visible.

Annotations
@Deprecated
setToolBarVisibleback to summary
public void setToolBarVisible(boolean bVisible)

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Sets the tool function bar visibility. Initially the tool bar is visible. If not connected or no document loaded, the value is stored and automatically applied to the document after it is loaded. Same is valid when the connection dies within this function call.

Parameters
bVisible:boolean

If false, the tool function bar is disabled, If true, the tool function bar is visible.

Annotations
@Deprecated
setToolVisibleback to summary
protected boolean setToolVisible(String aProperty, String aResourceURL, boolean bOldValue, boolean bNewValue) throws InterruptedException

Deprecated

Clients should use the service com.sun.star.frame.LayoutManager, which can be obtained from a frame, to control toolbars. See also setAllBarsVisible.

Helper method to set tool bar visibility.

Parameters
bNewValue:boolean

If false, the tool bar is disabled, If true, the tool bar is visible.

Annotations
@Deprecated
startOOoConnectionback to summary
public void startOOoConnection(String aConnectionURL) throws MalformedURLException, HasConnectionException, NoConnectionException

Starts a connection to an OOo instance which is launched if not running.

Exceptions
HasConnectionException:
if a connection was already established.
NoConnectionException:
if the specified connection cannot be established
stopOOoConnectionback to summary
public synchronized void stopOOoConnection()

Disconnects from the connected OOo instance. If there was no connection yet or anymore, this method can be called anyway. When the OOoBean is displayed in an applet by a web browser, then this method must be called from within java.applet.Applet.stop.

storeToByteArrayback to summary
public byte[] storeToByteArray(byte[] aOutBuffer, final com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, NoDocumentException, IOException, com.sun.star.lang.IllegalArgumentException

Stores a document to a byte array. See storeToURL for further information.

See Also
storeToURL
storeToStreamback to summary
public OutputStream storeToStream(OutputStream aOutStream, final com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, NoDocumentException, IOException, com.sun.star.lang.IllegalArgumentException

Stores a document to a stream. See storeToURL for further information.

See Also
storeToURL
storeToURLback to summary
public void storeToURL(final String aURL, final com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, IOException, com.sun.star.lang.IllegalArgumentException, NoDocumentException

Stores a document to the given URL.

Due due a bug (50651) calling this method may cause the office to crash, when at the same time the office writes a backup of the document. This bug also affects storeToByteArray and storeToStream. The workaround is to start the office with the option --norestore, which disables the automatic backup and recovery mechanism. OOoBean offers currently no supported way of providing startup options for OOo. But it is possible to set a Java property when starting Java, which is examined by OOoBean:

    java -Dcom.sun.star.officebean.Options=--norestore  ...
It is planned to offer a way of specifying startup options in a future version. The property can be used until then. When using this property only one option can be provided.
Exceptions
NoConnectionException:
if no connection is established.
IOException:
if an IO error occurs reading the resource specified by the URL.
IllegalArgumentException:
if either of the arguments is out of the specified range.
NoDocumentException:
if no document is loaded
writeExternalback to summary
public void writeExternal(ObjectOutput aObjOut)

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

Deprecated

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Annotations
@Deprecated
com.sun.star.comp.beans back to summary

private Class OOoBean.EventListener

extends Thread
implements com.sun.star.frame.XTerminateListener
Class Inheritance

Helper class to listen on the connection to learn when it dies.

Field Summary

Modifier and TypeField and Description
pack-priv String
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
disposing(com.sun.star.lang.EventObject Source)

gets called when the connection dies

public void
end()

public void
notifyTermination(com.sun.star.lang.EventObject Event)

gets called when OOo terminates

public void
queryTermination(com.sun.star.lang.EventObject Event)

gets called when the user wants to terminate OOo

public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

watching the connection

Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopthreadIdtoStringyield

Field Detail

aTagback to summary
pack-priv String aTag

Constructor Detail

EventListenerback to summary
pack-priv EventListener(String aTag) throws NoConnectionException

Method Detail

disposingback to summary
public void disposing(com.sun.star.lang.EventObject Source)

gets called when the connection dies

endback to summary
public void end()
notifyTerminationback to summary
public void notifyTermination(com.sun.star.lang.EventObject Event)

gets called when OOo terminates

queryTerminationback to summary
public void queryTermination(com.sun.star.lang.EventObject Event) throws com.sun.star.frame.TerminationVetoException

gets called when the user wants to terminate OOo

runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

watching the connection

Annotations
@Override