Kaydet (Commit) 43debfae authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Thomas Arnhold

General cleanup of OfficeBeans

Cleaned up Java source files:
    + removed unnecessary commented out code
    + corrected many spelling errors
    + formatting changes (remove decorations from comments,
      whitespacing, etc.)

Change-Id: I4133908ceac874b273fe409d763b3ddbfc2055e5
Reviewed-on: https://gerrit.libreoffice.org/3413Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Reviewed-by: 's avatarThomas Arnhold <thomas@arnhold.org>
Tested-by: 's avatarThomas Arnhold <thomas@arnhold.org>
üst 7cac1bc7
...@@ -19,13 +19,12 @@ ...@@ -19,13 +19,12 @@
package com.sun.star.comp.beans; package com.sun.star.comp.beans;
//---------------------------------------------------------------------------
/** Helper class to watch calls into OOo with a timeout. /** Helper class to watch calls into OOo with a timeout.
*/ */
//Do not add the thread instances to a threadgroup. When testing the bean in // Do not add the thread instances to a threadgroup. When testing the bean in
//an applet it turned out the ThreadGroup was in an inconsistent state // an applet it turned out the ThreadGroup was in an inconsistent state
//after navigating off the site that contains the applet and back to it. // after navigating off the site that contains the applet and back to it.
//That was tested with a Sun JRE 1.4.2_06 // That was tested with a Sun JRE 1.4.2_06
public class CallWatchThread extends Thread public class CallWatchThread extends Thread
{ {
private static boolean DEBUG = false; private static boolean DEBUG = false;
......
...@@ -21,7 +21,7 @@ package com.sun.star.comp.beans; ...@@ -21,7 +21,7 @@ package com.sun.star.comp.beans;
import java.awt.Container; import java.awt.Container;
/** /**
* This interface reprecents an AWT container factory. * This interface represents an AWT container factory.
* *
* @deprecated * @deprecated
* *
......
...@@ -49,7 +49,7 @@ public class Frame ...@@ -49,7 +49,7 @@ public class Frame
// com.sun.star.frame.XFrame // com.sun.star.frame.XFrame
//-------------------------------------------------------------- //--------------------------------------------------------------
public void initialize( /*IN*/com.sun.star.awt.XWindow xWindow ) public void initialize( /*IN*/ com.sun.star.awt.XWindow xWindow )
{ {
xFrame.initialize( xWindow ); xFrame.initialize( xWindow );
} }
...@@ -79,7 +79,7 @@ public class Frame ...@@ -79,7 +79,7 @@ public class Frame
xFrame.setName( aName ); xFrame.setName( aName );
} }
public com.sun.star.frame.XFrame findFrame( /*IN*/String aTargetFrameName, /*IN*/int nSearchFlags ) public com.sun.star.frame.XFrame findFrame( /*IN*/ String aTargetFrameName, /*IN*/ int nSearchFlags )
{ {
return xFrame.findFrame( aTargetFrameName, nSearchFlags ); return xFrame.findFrame( aTargetFrameName, nSearchFlags );
} }
...@@ -104,7 +104,7 @@ public class Frame ...@@ -104,7 +104,7 @@ public class Frame
return xFrame.isActive(); return xFrame.isActive();
} }
public boolean setComponent( /*IN*/com.sun.star.awt.XWindow xComponentWindow, /*IN*/ com.sun.star.frame.XController xController ) public boolean setComponent( /*IN*/ com.sun.star.awt.XWindow xComponentWindow, /*IN*/ com.sun.star.frame.XController xController )
{ {
return xFrame.setComponent( xComponentWindow, xController ); return xFrame.setComponent( xComponentWindow, xController );
} }
......
...@@ -25,7 +25,7 @@ import com.sun.star.awt.*; ...@@ -25,7 +25,7 @@ import com.sun.star.awt.*;
* *
* @since OOo 2.0.0 * @since OOo 2.0.0
*/ */
/* package */ class JavaWindowPeerFake class JavaWindowPeerFake
implements XSystemDependentWindowPeer, XWindowPeer implements XSystemDependentWindowPeer, XWindowPeer
{ {
protected int localSystemType; protected int localSystemType;
...@@ -44,7 +44,7 @@ import com.sun.star.awt.*; ...@@ -44,7 +44,7 @@ import com.sun.star.awt.*;
/** <p>Implementation of XSystemDependentWindowPeer (that's all we really need)</p> /** <p>Implementation of XSystemDependentWindowPeer (that's all we really need)</p>
* This method is called back from the OpenOffice.org toolkit to retrieve the system data. * This method is called back from the OpenOffice.org toolkit to retrieve the system data.
*/ */
public Object getWindowHandle(/*IN*/byte[] ProcessId, /*IN*/short SystemType) public Object getWindowHandle(/*IN*/ byte[] ProcessId, /*IN*/ short SystemType)
throws com.sun.star.uno.RuntimeException throws com.sun.star.uno.RuntimeException
{ {
if (SystemType == localSystemType) { if (SystemType == localSystemType) {
...@@ -63,28 +63,28 @@ import com.sun.star.awt.*; ...@@ -63,28 +63,28 @@ import com.sun.star.awt.*;
/** not really neaded. /** not really neaded.
*/ */
public void setPointer(/*IN*/XPointer Pointer) public void setPointer(/*IN*/ XPointer Pointer)
throws com.sun.star.uno.RuntimeException throws com.sun.star.uno.RuntimeException
{ {
} }
/** not really neaded. /** not really neaded.
*/ */
public void setBackground(/*IN*/int Color) public void setBackground(/*IN*/ int Color)
throws com.sun.star.uno.RuntimeException throws com.sun.star.uno.RuntimeException
{ {
} }
/** not really neaded. /** not really neaded.
*/ */
public void invalidate(/*IN*/short Flags) public void invalidate(/*IN*/ short Flags)
throws com.sun.star.uno.RuntimeException throws com.sun.star.uno.RuntimeException
{ {
} }
/** not really neaded. /** not really neaded.
*/ */
public void invalidateRect(/*IN*/com.sun.star.awt.Rectangle Rect, /*IN*/short Flags) public void invalidateRect(/*IN*/ com.sun.star.awt.Rectangle Rect, /*IN*/ short Flags)
throws com.sun.star.uno.RuntimeException throws com.sun.star.uno.RuntimeException
{ {
} }
...@@ -98,14 +98,14 @@ import com.sun.star.awt.*; ...@@ -98,14 +98,14 @@ import com.sun.star.awt.*;
/** not really neaded. /** not really neaded.
*/ */
public void addEventListener(/*IN*/com.sun.star.lang.XEventListener xListener) public void addEventListener(/*IN*/ com.sun.star.lang.XEventListener xListener)
throws com.sun.star.uno.RuntimeException throws com.sun.star.uno.RuntimeException
{ {
} }
/** not really neaded. /** not really neaded.
*/ */
public void removeEventListener(/*IN*/com.sun.star.lang.XEventListener aListener) public void removeEventListener(/*IN*/ com.sun.star.lang.XEventListener aListener)
throws com.sun.star.uno.RuntimeException throws com.sun.star.uno.RuntimeException
{ {
} }
......
...@@ -38,7 +38,7 @@ import com.sun.star.lib.uno.helper.UnoUrl; ...@@ -38,7 +38,7 @@ import com.sun.star.lib.uno.helper.UnoUrl;
import com.sun.star.lib.util.NativeLibraryLoader; import com.sun.star.lib.util.NativeLibraryLoader;
/** /**
* This class reprecents a connection to the local office application. * This class represents a connection to the local office application.
* *
* @since OOo 2.0.0 * @since OOo 2.0.0
*/ */
...@@ -64,7 +64,7 @@ public class LocalOfficeConnection ...@@ -64,7 +64,7 @@ public class LocalOfficeConnection
private List<XEventListener> mComponents = new ArrayList<XEventListener>(); private List<XEventListener> mComponents = new ArrayList<XEventListener>();
private static long m_nBridgeCounter = 0; private static long m_nBridgeCounter = 0;
//-------------------------------------------------------------------------
static static
{ {
// preload shared libraries whichs import lips are linked to officebean // preload shared libraries whichs import lips are linked to officebean
...@@ -115,7 +115,6 @@ public class LocalOfficeConnection ...@@ -115,7 +115,6 @@ public class LocalOfficeConnection
NativeLibraryLoader.loadLibrary( LocalOfficeConnection.class.getClassLoader(), "officebean" ); NativeLibraryLoader.loadLibrary( LocalOfficeConnection.class.getClassLoader(), "officebean" );
} }
//-------------------------------------------------------------------------
/** /**
* Constructor. * Constructor.
...@@ -190,7 +189,7 @@ public class LocalOfficeConnection ...@@ -190,7 +189,7 @@ public class LocalOfficeConnection
} }
/** /**
* Sets an AWT container catory. * Sets an AWT container factory.
* *
* @param containerFactory This is a application provided AWT container * @param containerFactory This is a application provided AWT container
* factory. * factory.
...@@ -201,7 +200,7 @@ public class LocalOfficeConnection ...@@ -201,7 +200,7 @@ public class LocalOfficeConnection
} }
/** /**
* Retrives the UNO component context. * Retrieves the UNO component context.
* Establishes a connection if necessary and initialises the * Establishes a connection if necessary and initialises the
* UNO service manager if it has not already been initialised. * UNO service manager if it has not already been initialised.
* This method can return <code>null</code> if it fails to connect * This method can return <code>null</code> if it fails to connect
...@@ -242,12 +241,12 @@ public class LocalOfficeConnection ...@@ -242,12 +241,12 @@ public class LocalOfficeConnection
} }
mComponents.clear(); mComponents.clear();
//Terminate the bridge. It turned out that this is necessary for the bean // Terminate the bridge. It turned out that this is necessary for the bean
//to work properly when displayed in an applet within Internet Explorer. // to work properly when displayed in an applet within Internet Explorer.
//When navigating off the page which is showing the applet and then going // When navigating off the page which is showing the applet and then going
//back to it, then the Java remote bridge is damaged. That is the Java threads // back to it, then the Java remote bridge is damaged. That is the Java threads
//do not work properly anymore. Therefore when Applet.stop is called the connection // do not work properly anymore. Therefore when Applet.stop is called the connection
//to the office including the bridge needs to be terminated. // to the office including the bridge needs to be terminated.
if (mBridge != null) if (mBridge != null)
{ {
XComponent comp = UnoRuntime.queryInterface( XComponent comp = UnoRuntime.queryInterface(
...@@ -379,9 +378,9 @@ public class LocalOfficeConnection ...@@ -379,9 +378,9 @@ public class LocalOfficeConnection
} }
//The function is copied and adapted from the UrlResolver.resolve. // The function is copied and adapted from the UrlResolver.resolve.
//We cannot use the URLResolver because we need access to the bridge which has // We cannot use the URLResolver because we need access to the bridge which has
//to be disposed when Applet.stop is called. // to be disposed when Applet.stop is called.
private Object resolve(XComponentContext xLocalContext, String dcp) private Object resolve(XComponentContext xLocalContext, String dcp)
throws com.sun.star.connection.NoConnectException, throws com.sun.star.connection.NoConnectException,
com.sun.star.connection.ConnectionSetupException, com.sun.star.connection.ConnectionSetupException,
...@@ -391,7 +390,7 @@ public class LocalOfficeConnection ...@@ -391,7 +390,7 @@ public class LocalOfficeConnection
String protDcp = null; String protDcp = null;
String rootOid = null; String rootOid = null;
if(dcp.indexOf(';') == -1) {// use old style if(dcp.indexOf(';') == -1) { // use old style
conDcp = dcp; conDcp = dcp;
protDcp = "iiop"; protDcp = "iiop";
rootOid = "classic_uno"; rootOid = "classic_uno";
...@@ -437,9 +436,9 @@ public class LocalOfficeConnection ...@@ -437,9 +436,9 @@ public class LocalOfficeConnection
// connect to the server // connect to the server
XConnection xConnection = connector_xConnector.connect(conDcp); XConnection xConnection = connector_xConnector.connect(conDcp);
// create the bridge name. This should not be necessary if we pass an // create the bridge name. This should not be necessary if we pass an
//empty string as bridge name into createBridge. Then we should always get // empty string as bridge name into createBridge. Then we should always get
//a new bridge. This does not work because of (i51323). Therefore we // a new bridge. This does not work because of (i51323). Therefore we
//create unique bridge names for the current process. // create unique bridge names for the current process.
String sBridgeName = "OOoBean_private_bridge_" + String.valueOf(m_nBridgeCounter++); String sBridgeName = "OOoBean_private_bridge_" + String.valueOf(m_nBridgeCounter++);
try { try {
mBridge = xBridgeFactory.createBridge(sBridgeName, protDcp, xConnection, null); mBridge = xBridgeFactory.createBridge(sBridgeName, protDcp, xConnection, null);
...@@ -478,7 +477,7 @@ public class LocalOfficeConnection ...@@ -478,7 +477,7 @@ public class LocalOfficeConnection
private void parseUnoUrlWithOfficePath(String url, String prefix) private void parseUnoUrlWithOfficePath(String url, String prefix)
throws java.net.MalformedURLException throws java.net.MalformedURLException
{ {
// Extruct parameters. // Extract parameters.
int idx = url.indexOf(";urp;StarOffice.ServiceManager"); int idx = url.indexOf(";urp;StarOffice.ServiceManager");
if (idx < 0) if (idx < 0)
throw new java.net.MalformedURLException( throw new java.net.MalformedURLException(
...@@ -589,7 +588,7 @@ public class LocalOfficeConnection ...@@ -589,7 +588,7 @@ public class LocalOfficeConnection
} }
break; break;
case 5: // a delimeter after the value case 5: // a delimiter after the value
switch(ch) { switch(ch) {
case ' ': case ' ':
break; break;
...@@ -670,7 +669,7 @@ public class LocalOfficeConnection ...@@ -670,7 +669,7 @@ public class LocalOfficeConnection
implements NativeService implements NativeService
{ {
/** /**
* Retrive the office service identifier. * Retrieve the office service identifier.
* *
* @return The identifier of the office service. * @return The identifier of the office service.
*/ */
...@@ -690,12 +689,12 @@ public class LocalOfficeConnection ...@@ -690,12 +689,12 @@ public class LocalOfficeConnection
{ {
int nSizeCmdArray = 4; int nSizeCmdArray = 4;
String sOption = null; String sOption = null;
//examine if user specified command-line options in system properties. // examine if user specified command-line options in system properties.
//We may offer later a more sophisticated way of providing options if // We may offer later a more sophisticated way of providing options if
//the need arises. Currently this is intended to ease the pain during // the need arises. Currently this is intended to ease the pain during
//development with pre-release builds of LibO where one wants to start // development with pre-release builds of LibO where one wants to start
//LibO with the --norestore options. The value of the property is simple // LibO with the --norestore options. The value of the property is simple
//passed on to the Runtime.exec call. // passed on to the Runtime.exec call.
try { try {
sOption = System.getProperty("com.sun.star.officebean.Options"); sOption = System.getProperty("com.sun.star.officebean.Options");
if (sOption != null) if (sOption != null)
...@@ -712,7 +711,6 @@ public class LocalOfficeConnection ...@@ -712,7 +711,6 @@ public class LocalOfficeConnection
if (unoPath == null) if (unoPath == null)
throw new java.io.IOException( "UNO_PATH environment variable is not set (required system path to the office program directory)" ); throw new java.io.IOException( "UNO_PATH environment variable is not set (required system path to the office program directory)" );
// cmdArray[0] = (new File(getProgramPath(), OFFICE_APP_NAME)).getPath();
cmdArray[0] = (new File(unoPath, OFFICE_APP_NAME)).getPath(); cmdArray[0] = (new File(unoPath, OFFICE_APP_NAME)).getPath();
cmdArray[1] = "--nologo"; cmdArray[1] = "--nologo";
cmdArray[2] = "--nodefault"; cmdArray[2] = "--nodefault";
...@@ -736,9 +734,9 @@ public class LocalOfficeConnection ...@@ -736,9 +734,9 @@ public class LocalOfficeConnection
} }
/** /**
* Retrives the ammount of time to wait for the startup. * Retrieves the amount of time to wait for the startup.
* *
* @return The ammount of time to wait in seconds(?). * @return The amount of time to wait in seconds(?).
*/ */
public int getStartupTime() public int getStartupTime()
{ {
......
...@@ -66,7 +66,7 @@ public class LocalOfficeWindow ...@@ -66,7 +66,7 @@ public class LocalOfficeWindow
} }
/** /**
* Retrives an AWT component object associated with the OfficeWindow. * Retrieves an AWT component object associated with the OfficeWindow.
* *
* @return The AWT component object associated with the OfficeWindow. * @return The AWT component object associated with the OfficeWindow.
*/ */
...@@ -76,7 +76,7 @@ public class LocalOfficeWindow ...@@ -76,7 +76,7 @@ public class LocalOfficeWindow
} }
/** /**
* Retrives an UNO XWindowPeer object associated with the OfficeWindow. * Retrieves an UNO XWindowPeer object associated with the OfficeWindow.
* *
* @return The UNO XWindowPeer object associated with the OfficeWindow. * @return The UNO XWindowPeer object associated with the OfficeWindow.
*/ */
...@@ -233,24 +233,24 @@ public class LocalOfficeWindow ...@@ -233,24 +233,24 @@ public class LocalOfficeWindow
} }
/** /**
* Retrives a platform dependant system window identifier. * Retrieves a platform dependent system window identifier.
* *
* @return The system window identifier. * @return The system window identifier.
*/ */
private native long getNativeWindow(); private native long getNativeWindow();
/** /**
* Retrives a platform dependant system window type. * Retrieves a platform dependent system window type.
* *
* @return The system window type. * @return The system window type.
*/ */
private native int getNativeWindowSystemType(); private native int getNativeWindowSystemType();
/** /**
Returns an Any containing a sequences of com.sun.star.beans.NamedValue. One NamedValue * Returns an Any containing a sequences of com.sun.star.beans.NamedValue. One NamedValue
contains the name "WINDOW" and the value is a Long representing the window handle. * contains the name "WINDOW" and the value is a Long representing the window handle.
The second NamedValue has the name "XEMBED" and the value is true, when the XEmbed * The second NamedValue has the name "XEMBED" and the value is true, when the XEmbed
protocol shall be used fore embedding the native Window. * protocol shall be used fore embedding the native Window.
*/ */
protected Any getWrappedWindowHandle() protected Any getWrappedWindowHandle()
{ {
......
...@@ -24,16 +24,16 @@ import com.sun.star.connection.XConnection; ...@@ -24,16 +24,16 @@ import com.sun.star.connection.XConnection;
* *
* @deprecated. * @deprecated.
*/ */
/* package */ class NativeConnection class NativeConnection
implements XConnection implements XConnection
{ {
public native void connect(NativeService aNativeService) public native void connect(NativeService aNativeService)
throws com.sun.star.io.IOException; throws com.sun.star.io.IOException;
public native int read(/*OUT*/byte[][] aReadBytes, /*IN*/int nBytesToRead) public native int read(/*OUT*/ byte[][] aReadBytes, /*IN*/ int nBytesToRead)
throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException; throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException;
public native void write(/*IN*/byte[] aData) public native void write(/*IN*/ byte[] aData)
throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException; throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException;
public native void flush() public native void flush()
......
...@@ -21,7 +21,7 @@ package com.sun.star.comp.beans; ...@@ -21,7 +21,7 @@ package com.sun.star.comp.beans;
/* /*
* @deprecated * @deprecated
*/ */
/* package */ interface NativeService { interface NativeService {
public String getIdentifier(); public String getIdentifier();
public void startupService() throws java.io.IOException; public void startupService() throws java.io.IOException;
public int getStartupTime(); public int getStartupTime();
......
...@@ -20,7 +20,7 @@ package com.sun.star.comp.beans; ...@@ -20,7 +20,7 @@ package com.sun.star.comp.beans;
/** This exception is called when a method is called which /** This exception is called when a method is called which
needs an established connection but no connection is needs an established connection but no connection is
established yet or anymore. established yet.
@since OOo 2.0.0 @since OOo 2.0.0
*/ */
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
package com.sun.star.comp.beans; package com.sun.star.comp.beans;
/** indicates that an operation needed a document, but no document was loaded. /** Indicates that an operation needed a document, but no document was loaded.
@since OOo 2.0.0 @since OOo 2.0.0
*/ */
......
...@@ -50,8 +50,7 @@ public class OOoBean ...@@ -50,8 +50,7 @@ public class OOoBean
// @requirement FUNC.BEAN.VIEW/0.4 // @requirement FUNC.BEAN.VIEW/0.4
// @requirement FUNC.BEAN.EDIT/0.4 // @requirement FUNC.BEAN.EDIT/0.4
// This member contains the OOo window // This member contains the OOo window if a connection is established.
// if a connection is established.
// It is a child of the OOoBean canvas. // It is a child of the OOoBean canvas.
private OfficeWindow xFrameWindow; private OfficeWindow xFrameWindow;
...@@ -146,7 +145,7 @@ public class OOoBean ...@@ -146,7 +145,7 @@ public class OOoBean
nOOoCallTimeOut = nMilliSecs; nOOoCallTimeOut = nMilliSecs;
} }
/** Sets the period length in milli seconds to check the OOo connection. /** Sets the period length in milliseconds to check the OOo connection.
This method does not need a connection to an OOo instance. This method does not need a connection to an OOo instance.
*/ */
...@@ -155,7 +154,7 @@ public class OOoBean ...@@ -155,7 +154,7 @@ public class OOoBean
nOOoCheckCycle = nMilliSecs; nOOoCheckCycle = nMilliSecs;
} }
/** Sets the a connection to an OOo instance. /** Sets a connection to an OOo instance.
@internal @internal
*/ */
...@@ -209,8 +208,8 @@ public class OOoBean ...@@ -209,8 +208,8 @@ public class OOoBean
@deprecated This method is not useful in a multithreaded environment. Then @deprecated This method is not useful in a multithreaded environment. Then
all threads accessing the instance would have to be synchronized in order to all threads accessing the instance would have to be synchronized in order to
make is method work. It is better make is method work. It is better to call OOoBean's methods and be prepared
to call OOoBean's methods and be prepared to catch a NoConnectionException. to catch a NoConnectionException.
*/ */
public boolean isOOoConnected() public boolean isOOoConnected()
{ {
...@@ -247,16 +246,15 @@ public class OOoBean ...@@ -247,16 +246,15 @@ public class OOoBean
// @requirement FUNC.CON.STOP/0.4 (via XComponent.dispose()) // @requirement FUNC.CON.STOP/0.4 (via XComponent.dispose())
// @requirement FUNC.CON.NTFY/0.4 (via XComponent.addEventListener()) // @requirement FUNC.CON.NTFY/0.4 (via XComponent.addEventListener())
/** Returns the a connection to an OOo instance. /** Returns a connection to an OOo instance.
If no connection exists, a default connection will be created. An OfficeConnection 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, can be used to register listeners of type com.sun.star.lang.EventListener,
which are notified when the connection to the which are notified when the connection to the office dies. One should not call the
office dies. One should not call the dispose method, because this may result dispose method, because this may result in receiving com.sun.star.lang.DisposedExceptions
in receiving com.sun.star.lang.DisposedExceptions when calling when calling {@link #stopOOoConnection stopOOoConnection} or other API methods. If other
{@link #stopOOoConnection stopOOoConnection} or other API methods. If other instances share the instances share the same connection then they will stop function properly, because
same connection then they will stop function properly, because they loose their they lose their connection as well. The recommended way to end the connection is by
connection as well. The recommended way to end the connection is
calling {@link #stopOOoConnection stopOOoConnection}. calling {@link #stopOOoConnection stopOOoConnection}.
@throws NoConnectionException @throws NoConnectionException
...@@ -378,8 +376,8 @@ public class OOoBean ...@@ -378,8 +376,8 @@ public class OOoBean
{ {
CallWatchThread aCallWatchThread = CallWatchThread aCallWatchThread =
new CallWatchThread( nOOoCallTimeOut, "clear" ); new CallWatchThread( nOOoCallTimeOut, "clear" );
//By closing the frame we avoid that dialogs are displayed, for example when // By closing the frame we avoid that dialogs are displayed, for example when
//the document is modified. // the document is modified.
com.sun.star.util.XCloseable xCloseable = UnoRuntime.queryInterface( com.sun.star.util.XCloseable.class, aFrame ); com.sun.star.util.XCloseable xCloseable = UnoRuntime.queryInterface( com.sun.star.util.XCloseable.class, aFrame );
if ( xCloseable != null ) if ( xCloseable != null )
{ {
...@@ -446,16 +444,17 @@ public class OOoBean ...@@ -446,16 +444,17 @@ public class OOoBean
was made visible (java.lang.Component.setVisible(true)). was made visible (java.lang.Component.setVisible(true)).
<p> <p>
Another scenario is that a OOoBean contains a document and is removed Another scenario is that a OOoBean contains a document and is removed
from a Java container and later added again. Then aquireSystemWindow needs from a Java container and later added again. Then acquireSystemWindow needs
to be called after the container window is displayed. to be called after the container window is displayed.
<p>
@throws SystemWindowException @throws SystemWindowException
if no system window can be aquired. if no system window can be acquired.
@throws NoConnectionException @throws NoConnectionException
if the connection is not established. if the connection is not established.
*/ */
public synchronized void aquireSystemWindow() public synchronized void acquireSystemWindow()
throws throws
SystemWindowException, SystemWindowException,
...@@ -482,7 +481,7 @@ public class OOoBean ...@@ -482,7 +481,7 @@ public class OOoBean
from it's parent container. from it's parent container.
@throws SystemWindowException @throws SystemWindowException
if system window is not aquired. if system window is not acquired.
@throws NoConnectionException @throws NoConnectionException
if the connection is not established. if the connection is not established.
...@@ -608,14 +607,14 @@ public class OOoBean ...@@ -608,14 +607,14 @@ public class OOoBean
") without com.sun.star.frame.XComponentLoader" ); ") without com.sun.star.frame.XComponentLoader" );
} }
// Avoid Dialog 'Document changed' while reloading // Avoid dialog 'Document changed' while reloading
if ( aDocument != null ) if ( aDocument != null )
{ {
try { try {
aDocument.setModified(false); aDocument.setModified(false);
} catch (com.sun.star.beans.PropertyVetoException ep) { } catch (com.sun.star.beans.PropertyVetoException ep) {
//it dosn't make sense to throw the exception here. The interface does not // it doesn't make sense to throw the exception here. The interface does not
//offer a way to add/remove respective listeners. // offer a way to add/remove respective listeners.
} catch (com.sun.star.lang.DisposedException ed) { } catch (com.sun.star.lang.DisposedException ed) {
// can be disposed if user closed document via UI // can be disposed if user closed document via UI
} }
...@@ -643,10 +642,9 @@ public class OOoBean ...@@ -643,10 +642,9 @@ public class OOoBean
"MacroExecutionMode", -1, "MacroExecutionMode", -1,
new Short( com.sun.star.document.MacroExecMode.USE_CONFIG ), new Short( com.sun.star.document.MacroExecMode.USE_CONFIG ),
com.sun.star.beans.PropertyState.DIRECT_VALUE ) ); com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
//String fn = aFRame.getName();
com.sun.star.lang.XComponent xComponent = xLoader.loadComponentFromURL( com.sun.star.lang.XComponent xComponent = xLoader.loadComponentFromURL(
aURL, /*aFrame.getName()*/"_self", 0, aArgs ); aURL, "_self", 0, aArgs );
// nothing loaded? // nothing loaded?
if ( xComponent == null && aDocument != null ) if ( xComponent == null && aDocument != null )
...@@ -660,7 +658,6 @@ public class OOoBean ...@@ -660,7 +658,6 @@ public class OOoBean
throw new java.io.IOException( throw new java.io.IOException(
"Can not load a document: \"" + aURL + "\""); "Can not load a document: \"" + aURL + "\"");
} }
// mDocumentURL = aURL; TBD: still needed?
// Get document's XModifiable interface if any. // Get document's XModifiable interface if any.
aDocument = new OfficeDocument( aDocument = new OfficeDocument(
...@@ -717,13 +714,8 @@ public class OOoBean ...@@ -717,13 +714,8 @@ public class OOoBean
com.sun.star.util.CloseVetoException com.sun.star.util.CloseVetoException
{ {
// wrap Java stream into UNO stream // wrap Java stream into UNO stream
/*
com.sun.star.io.XInputStream xStream =
new com.sun.star.lib.uno.adapter.InputStreamToXInputStreamAdapter(
iInStream );
*/
// copy stream....
// copy stream....
int s = 4096; int s = 4096;
int r=0 ,n = 0; int r=0 ,n = 0;
byte[] buffer = new byte[s]; byte[] buffer = new byte[s];
...@@ -1004,7 +996,7 @@ public class OOoBean ...@@ -1004,7 +996,7 @@ public class OOoBean
Initially all tool bars are visible. By hiding all tool bars Initially all tool bars are visible. By hiding all tool bars
utilizing this method, it is possible to turn just a subset of utilizing this method, it is possible to turn just a subset of
tool bars on afterwards, no matter whether all available tool toolbars on afterwards, no matter whether all available tool
bars are known or not. bars are known or not.
<p> <p>
If an older OOoBean instance is used with a newer OOo instance, If an older OOoBean instance is used with a newer OOo instance,
...@@ -1147,7 +1139,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar"); ...@@ -1147,7 +1139,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
/** Returns the visibility of the menu bar. /** Returns the visibility of the menu bar.
This method works independently from a connetion or loaded document. This method works independently from a connection or loaded document.
If no connection is established or no document is loaded, If no connection is established or no document is loaded,
this method just returns a memorized status. this method just returns a memorized status.
...@@ -1195,7 +1187,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar"); ...@@ -1195,7 +1187,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
/** Returns the visibility of the main function bar. /** Returns the visibility of the main function bar.
This method works independently from a connetion or loaded document. This method works independently from a connection or loaded document.
If no connection is established or no document is loaded, If no connection is established or no document is loaded,
this method just returns a memorized status. this method just returns a memorized status.
...@@ -1243,7 +1235,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar"); ...@@ -1243,7 +1235,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
/** Returns the visibility of the tool function bar. /** Returns the visibility of the tool function bar.
This method works independently from a connetion or loaded document. This method works independently from a conneiction or loaded document.
If no connection is established or no document is loaded, If no connection is established or no document is loaded,
this method just returns a memorized status. this method just returns a memorized status.
...@@ -1291,7 +1283,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar"); ...@@ -1291,7 +1283,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
/** Returns the visibility of the status function bar. /** Returns the visibility of the status function bar.
This method works independently from a connetion or loaded document. This method works independently from a connection or loaded document.
If no connection is established or no document is loaded, If no connection is established or no document is loaded,
this method just returns a memorized status. this method just returns a memorized status.
...@@ -1492,7 +1484,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar"); ...@@ -1492,7 +1484,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
catch ( java.lang.InterruptedException aExc ) catch ( java.lang.InterruptedException aExc )
{ {
dbgPrint("EventListener(" + aTag + ") interupted."); dbgPrint("EventListener(" + aTag + ") interupted.");
//thread can be ended by EvendListener.end(); // thread can be ended by EvendListener.end();
break; break;
} }
} }
...@@ -1500,6 +1492,3 @@ xLayoutManager.showElement("private:resource/menubar/menubar"); ...@@ -1500,6 +1492,3 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
} }
} }
...@@ -24,7 +24,7 @@ import com.sun.star.lang.XComponent; ...@@ -24,7 +24,7 @@ import com.sun.star.lang.XComponent;
import com.sun.star.uno.XComponentContext; import com.sun.star.uno.XComponentContext;
/** /**
* This abstract class reprecents a connection to the office * This abstract class represents a connection to the office
* application. * application.
@deprecated @deprecated
...@@ -62,7 +62,7 @@ public interface OfficeConnection ...@@ -62,7 +62,7 @@ public interface OfficeConnection
* The window is either a sub-class of java.awt.Canvas (local) or * The window is either a sub-class of java.awt.Canvas (local) or
* java.awt.Container (RVP). * java.awt.Container (RVP).
* *
* This method does not add add the office window to its container. * This method does not add the office window to its container.
* *
* @param container This is an AWT container. * @param container This is an AWT container.
* @return The office window instance. * @return The office window instance.
......
...@@ -23,8 +23,8 @@ import java.awt.Component; ...@@ -23,8 +23,8 @@ import java.awt.Component;
import com.sun.star.awt.XWindowPeer; import com.sun.star.awt.XWindowPeer;
/** /**
* The concreate implementation of the OfficeWindow extends an * The concrete implementation of the OfficeWindow extends an
* approperate type of visual component (java.awt.Canvas for local * appropriate type of visual component (java.awt.Canvas for local
* and java.awt.Container for remote). * and java.awt.Container for remote).
@deprecated @deprecated
...@@ -32,14 +32,14 @@ import com.sun.star.awt.XWindowPeer; ...@@ -32,14 +32,14 @@ import com.sun.star.awt.XWindowPeer;
public interface OfficeWindow public interface OfficeWindow
{ {
/** /**
* Retrives an AWT component object associated with the OfficeWindow. * Retrieves an AWT component object associated with the OfficeWindow.
* *
* @return The AWT component object associated with the OfficeWindow. * @return The AWT component object associated with the OfficeWindow.
*/ */
Component getAWTComponent(); Component getAWTComponent();
/** /**
* Retrives an UNO XWindowPeer object associated with the OfficeWindow. * Retrieves an UNO XWindowPeer object associated with the OfficeWindow.
* *
* @return The UNO XWindowPeer object associated with the OfficeWindow. * @return The UNO XWindowPeer object associated with the OfficeWindow.
*/ */
......
...@@ -25,7 +25,7 @@ import com.sun.star.uno.UnoRuntime; ...@@ -25,7 +25,7 @@ import com.sun.star.uno.UnoRuntime;
mode of automatic runtime Java classes to get rid of the need for mode of automatic runtime Java classes to get rid of the need for
queryInterface. queryInterface.
Because its not worth the efford to create a runtime generated wrapper Because it's not worth the effort to create a runtime generated wrapper
for this purpose, as it might be for OOo 2.0, you still have to use for this purpose, as it might be for OOo 2.0, you still have to use
UnoRuntime.queryInterface() for interfaces which are optional or come UnoRuntime.queryInterface() for interfaces which are optional or come
from a subclass. But for non optional interfaces you can already from a subclass. But for non optional interfaces you can already
...@@ -71,7 +71,6 @@ class Wrapper ...@@ -71,7 +71,6 @@ class Wrapper
public Object queryInterface( com.sun.star.uno.Type aType ) public Object queryInterface( com.sun.star.uno.Type aType )
{ {
//System.err.println( "Wrapper::queryInterface(" + aType + ")" );
return xQueryInterface.queryInterface( aType ); return xQueryInterface.queryInterface( aType );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment