|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
com.sun.star.comp.beans.OOoBean
public class OOoBean
This is the basic JavaBean for all OOo application modules.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
OOoBean()
Generic constructor of the OOoBean. |
|
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. Calling the dispose method of the OfficeConnection or the OOoBean's stopOOoConnection method would make all instances of OOoBean stop working. |
Method Summary | |
---|---|
void |
aquireSystemWindow()
This method causes the office window to be displayed. |
void |
clear()
Resets the OOoBean to an empty status. |
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. |
Controller |
getController()
returns the |
OfficeDocument |
getDocument()
returns the |
Frame |
getFrame()
returns the |
com.sun.star.lang.XMultiServiceFactory |
getMultiServiceFactory()
Returns the service factory used by this OOoBean instance. |
OfficeConnection |
getOOoConnection()
Returns the a connection to an OOo instance. |
com.sun.star.frame.XDesktop |
getOOoDesktop()
Returns the XDesktop interface of the OOo instance used by this OOoBean. |
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(boolean) . |
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. |
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(boolean) . |
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(boolean) . |
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(boolean) . |
void |
loadFromByteArray(byte[] aInBuffer,
com.sun.star.beans.PropertyValue[] aArguments)
Loads a document from a byte array. |
void |
loadFromStream(java.io.InputStream iInStream,
com.sun.star.beans.PropertyValue[] aArguments)
Loads a document from a Java stream. |
void |
loadFromURL(java.lang.String aURL,
com.sun.star.beans.PropertyValue[] aArguments)
Loads the bean from the given URL. |
void |
paint(java.awt.Graphics aGraphics)
Deprecated. |
void |
readExternal(java.io.ObjectInput aObjIn)
Deprecated. |
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. |
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"); |
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(boolean) . |
void |
setOOoCallTimeOut(int nMilliSecs)
Sets the timeout for normal OOO methods calls in milli seconds. |
void |
setOOoCheckCycle(int nMilliSecs)
Sets the period length in milli seconds to check the OOo connection. |
void |
setOOoStartTimeOut(int nMilliSecs)
Sets the timeout for methods which launch OOo in milli seconds. |
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(boolean) . |
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(boolean) . |
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(boolean) . |
void |
startOOoConnection(java.lang.String aConnectionURL)
Starts a connection to an OOo instance which is lauched if not running. |
void |
stopOOoConnection()
Disconnects from the connected OOo instance. |
byte[] |
storeToByteArray(byte[] aOutBuffer,
com.sun.star.beans.PropertyValue[] aArguments)
Stores a document to a byte array. |
java.io.OutputStream |
storeToStream(java.io.OutputStream aOutStream,
com.sun.star.beans.PropertyValue[] aArguments)
Stores a document to a stream. |
void |
storeToURL(java.lang.String aURL,
com.sun.star.beans.PropertyValue[] aArguments)
Stores a document to the given URL. |
void |
writeExternal(java.io.ObjectOutput aObjOut)
Deprecated. |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OOoBean()
public OOoBean(OfficeConnection iConnection) throws NoConnectionException
NoConnectionException
- if the connection is not established.Method Detail |
---|
public void writeExternal(java.io.ObjectOutput aObjOut)
writeExternal
in interface java.io.Externalizable
public void readExternal(java.io.ObjectInput aObjIn)
readExternal
in interface java.io.Externalizable
public void setOOoStartTimeOut(int nMilliSecs)
public void setOOoCallTimeOut(int nMilliSecs)
public void setOOoCheckCycle(int nMilliSecs)
public void startOOoConnection(java.lang.String aConnectionURL) throws java.net.MalformedURLException, HasConnectionException, NoConnectionException
HasConnectionException
- if a connection was already established.
NoConnectionException
- if the specified connection cannot be established
java.net.MalformedURLException
public boolean isOOoConnected()
public void stopOOoConnection()
public OfficeConnection getOOoConnection() throws NoConnectionException
stopOOoConnection
or other API methods. If other instances share
the same connection then they will stop function properly, because they loose their
connection as well. The recommended way to end the connection is calling
stopOOoConnection
.
NoConnectionException
- if no connection can be establishedpublic com.sun.star.lang.XMultiServiceFactory getMultiServiceFactory() throws NoConnectionException
NoConnectionException
- if no connection is established and no default connection can be established.public com.sun.star.frame.XDesktop getOOoDesktop() throws NoConnectionException
NoConnectionException
- if no connection is established and no default connection can be established.public void clearDocument(boolean bClearStateToo) throws com.sun.star.util.CloseVetoException, NoConnectionException
clear()
which discards the currently displayed document.
bClearStateToo
- Not only the document content but also the state of the bean, like visibility of
child components is cleared.
com.sun.star.util.CloseVetoException
NoConnectionException
public void clear()
public void aquireSystemWindow() throws SystemWindowException, NoConnectionException
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 a 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.
SystemWindowException
- if no system window can be aquired.
NoConnectionException
- if the connection is not established.public void releaseSystemWindow() throws SystemWindowException, NoConnectionException
SystemWindowException
- if system window is not aquired.
NoConnectionException
- if the connection is not established.public void loadFromURL(java.lang.String aURL, com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, java.io.IOException, com.sun.star.lang.IllegalArgumentException, com.sun.star.util.CloseVetoException
java.lang.IllegalArgumentException
- if either of the arguments is out of the specified range.
java.io.IOException
- if an IO error occurs reading the ressource specified by the URL.
com.sun.star.lang.NoConnectionException
- if no connection can be established.
com.sun.star.util.CloseVetoException
- if the currently displayed document cannot be closed because it is still be used,
for example it is printed.
NoConnectionException
com.sun.star.lang.IllegalArgumentException
public void loadFromStream(java.io.InputStream iInStream, com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, java.io.IOException, com.sun.star.lang.IllegalArgumentException, com.sun.star.util.CloseVetoException
NoConnectionException
java.io.IOException
com.sun.star.lang.IllegalArgumentException
com.sun.star.util.CloseVetoException
public void loadFromByteArray(byte[] aInBuffer, com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, java.io.IOException, com.sun.star.lang.IllegalArgumentException, com.sun.star.util.CloseVetoException
NoConnectionException
java.io.IOException
com.sun.star.lang.IllegalArgumentException
com.sun.star.util.CloseVetoException
public void storeToURL(java.lang.String aURL, com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, java.io.IOException, com.sun.star.lang.IllegalArgumentException, NoDocumentException
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.
java.lang.IllegalArgumentException
- if either of the arguments is out of the specified range.
java.io.IOException
- if an IO error occurs reading the ressource specified by the URL.
com.sun.star.lang.NoConnectionException
- if no connection is established.
NoDocumentException
- if no document is loaded
NoConnectionException
com.sun.star.lang.IllegalArgumentException
public java.io.OutputStream storeToStream(java.io.OutputStream aOutStream, com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, NoDocumentException, java.io.IOException, com.sun.star.lang.IllegalArgumentException
storeToURL
for further information.
NoConnectionException
NoDocumentException
java.io.IOException
com.sun.star.lang.IllegalArgumentException
storeToURL
public byte[] storeToByteArray(byte[] aOutBuffer, com.sun.star.beans.PropertyValue[] aArguments) throws NoConnectionException, NoDocumentException, java.io.IOException, com.sun.star.lang.IllegalArgumentException
storeToURL
for further information.
NoConnectionException
NoDocumentException
java.io.IOException
com.sun.star.lang.IllegalArgumentException
storeToURL
public Frame getFrame() throws NoConnectionException
NoConnectionException
- if the connection is not established.
NotDocumentException
- if no document is loaded an thus no frame is available.public Controller getController() throws NoConnectionException
NoConnectionException
- if the connection is not established.public OfficeDocument getDocument() throws NoConnectionException
NoConnectionException
- if the connection is not established.public void setAllBarsVisible(boolean bVisible)
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");
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.
public void setMenuBarVisible(boolean bVisible)
setAllBarsVisible(boolean)
.
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.
bVisible
- If false, the menu bar is disabled, If true, the menu bar is visible.public boolean isMenuBarVisible()
setAllBarsVisible(boolean)
.
public void setStandardBarVisible(boolean bVisible)
setAllBarsVisible(boolean)
.
bVisible
- If false, the main function bar is disabled, If true, the main function bar is
visible.public boolean isStandardBarVisible()
setAllBarsVisible(boolean)
.
public void setToolBarVisible(boolean bVisible)
setAllBarsVisible(boolean)
.
bVisible
- If false, the tool function bar is disabled, If true, the tool function bar is
visible.public boolean isToolBarVisible()
setAllBarsVisible(boolean)
.
public void setStatusBarVisible(boolean bVisible)
setAllBarsVisible(boolean)
.
bVisible
- If false, the status function bar is disabled, If true, the status function bar is
visible.public boolean isStatusBarVisible()
setAllBarsVisible(boolean)
.
public void paint(java.awt.Graphics aGraphics)
paint
in class java.awt.Container
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |