summaryrefslogtreecommitdiff
path: root/bean
diff options
context:
space:
mode:
Diffstat (limited to 'bean')
-rw-r--r--bean/com/sun/star/beans/ContainerFactory.java4
-rw-r--r--bean/com/sun/star/beans/JavaWindowPeerFake.java6
-rw-r--r--bean/com/sun/star/beans/LocalOfficeConnection.java188
-rw-r--r--bean/com/sun/star/beans/LocalOfficeWindow.java38
-rw-r--r--bean/com/sun/star/beans/NativeConnection.java6
-rw-r--r--bean/com/sun/star/beans/NativeService.java4
-rw-r--r--bean/com/sun/star/beans/OfficeConnection.java16
-rw-r--r--bean/com/sun/star/beans/OfficeWindow.java6
-rw-r--r--bean/com/sun/star/comp/beans/CallWatchThread.java2
-rw-r--r--bean/com/sun/star/comp/beans/ContainerFactory.java4
-rw-r--r--bean/com/sun/star/comp/beans/Controller.java14
-rw-r--r--bean/com/sun/star/comp/beans/Frame.java26
-rw-r--r--bean/com/sun/star/comp/beans/HasConnectionException.java2
-rw-r--r--bean/com/sun/star/comp/beans/InvalidArgumentException.java2
-rw-r--r--bean/com/sun/star/comp/beans/JavaWindowPeerFake.java10
-rw-r--r--bean/com/sun/star/comp/beans/LocalOfficeConnection.java256
-rw-r--r--bean/com/sun/star/comp/beans/LocalOfficeWindow.java40
-rw-r--r--bean/com/sun/star/comp/beans/NativeConnection.java6
-rw-r--r--bean/com/sun/star/comp/beans/NativeService.java4
-rw-r--r--bean/com/sun/star/comp/beans/NoConnectionException.java6
-rw-r--r--bean/com/sun/star/comp/beans/NoDocumentException.java2
-rw-r--r--bean/com/sun/star/comp/beans/OOoBean.java508
-rw-r--r--bean/com/sun/star/comp/beans/OfficeConnection.java16
-rw-r--r--bean/com/sun/star/comp/beans/OfficeDocument.java34
-rw-r--r--bean/com/sun/star/comp/beans/OfficeWindow.java6
-rw-r--r--bean/com/sun/star/comp/beans/SystemWindowException.java4
-rw-r--r--bean/com/sun/star/comp/beans/Wrapper.java22
-rw-r--r--bean/native/unix/com_sun_star_beans_LocalOfficeWindow.c10
-rw-r--r--bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c14
-rw-r--r--bean/native/win32/com_sun_star_beans_LocalOfficeWindow.c2
-rw-r--r--bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c2
-rw-r--r--bean/qa/complex/OOoBeanTest.java52
-rw-r--r--bean/qa/complex/ScreenComparer.java16
-rw-r--r--bean/qa/complex/WriterFrame.java12
-rw-r--r--bean/test/Test.java4
-rw-r--r--bean/test/applet/oooapplet/OOoViewer.java26
36 files changed, 685 insertions, 685 deletions
diff --git a/bean/com/sun/star/beans/ContainerFactory.java b/bean/com/sun/star/beans/ContainerFactory.java
index 493ea1cbc338..8d42c67ad946 100644
--- a/bean/com/sun/star/beans/ContainerFactory.java
+++ b/bean/com/sun/star/beans/ContainerFactory.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,7 +30,7 @@ package com.sun.star.beans;
import java.awt.Container;
/**
- * This interface reprecents an AWT container factory.
+ * This interface reprecents an AWT container factory.
*
* @see OfficeBean
* @deprecated
diff --git a/bean/com/sun/star/beans/JavaWindowPeerFake.java b/bean/com/sun/star/beans/JavaWindowPeerFake.java
index c89978c894c5..54ca0c1d8910 100644
--- a/bean/com/sun/star/beans/JavaWindowPeerFake.java
+++ b/bean/com/sun/star/beans/JavaWindowPeerFake.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -52,7 +52,7 @@ import com.sun.star.awt.*;
/** <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.
*/
- public Object getWindowHandle(/*IN*/byte[] ProcessId, /*IN*/short SystemType)
+ public Object getWindowHandle(/*IN*/byte[] ProcessId, /*IN*/short SystemType)
throws com.sun.star.uno.RuntimeException
{
@@ -61,7 +61,7 @@ import com.sun.star.awt.*;
}
else return null;
}
-
+
/** not really neaded.
*/
public XToolkit getToolkit()
diff --git a/bean/com/sun/star/beans/LocalOfficeConnection.java b/bean/com/sun/star/beans/LocalOfficeConnection.java
index 11283066cc34..cb2d61f0fbea 100644
--- a/bean/com/sun/star/beans/LocalOfficeConnection.java
+++ b/bean/com/sun/star/beans/LocalOfficeConnection.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -48,36 +48,36 @@ import com.sun.star.lib.util.NativeLibraryLoader;
public class LocalOfficeConnection
implements OfficeConnection
{
- public static final String OFFICE_APP_NAME = "soffice";
- public static final String OFFICE_LIB_NAME = "officebean";
- public static final String OFFICE_ID_SUFFIX = "_Office";
-
- private Process mProcess;
- private ContainerFactory mContainerFactory;
- private XComponentContext mContext;
-
- private String mURL;
- private String mProgramPath;
- private String mConnType;
- private String mPipe;
- private String mPort;
- private String mProtocol;
- private String mInitialObject;
-
- private List mComponents = new Vector();
-
+ public static final String OFFICE_APP_NAME = "soffice";
+ public static final String OFFICE_LIB_NAME = "officebean";
+ public static final String OFFICE_ID_SUFFIX = "_Office";
+
+ private Process mProcess;
+ private ContainerFactory mContainerFactory;
+ private XComponentContext mContext;
+
+ private String mURL;
+ private String mProgramPath;
+ private String mConnType;
+ private String mPipe;
+ private String mPort;
+ private String mProtocol;
+ private String mInitialObject;
+
+ private List mComponents = new Vector();
+
/**
* Constructor.
- * Sets up paths to the office application and native libraries if
- * values are available in <code>OFFICE_PROP_FILE</code> in the user
+ * Sets up paths to the office application and native libraries if
+ * values are available in <code>OFFICE_PROP_FILE</code> in the user
* home directory.<br />
- * "com.sun.star.beans.path" - the office application directory;<br/>
+ * "com.sun.star.beans.path" - the office application directory;<br/>
* "com.sun.star.beans.libpath" - native libraries directory.
*/
public LocalOfficeConnection()
- {
+ {
// init member vars
- try
+ try
{
setUnoUrl( "uno:pipe,name=" + getPipeName() + ";urp;StarOffice.ServiceManager" );
}
@@ -92,7 +92,7 @@ public class LocalOfficeConnection
/**
* Sets a connection URL.
- * This implementation accepts a UNO URL with following format:<br />
+ * This implementation accepts a UNO URL with following format:<br />
* <pre>
* url := uno:localoffice[,&lt;params&gt;];urp;StarOffice.ServiceManager
* params := &lt;path&gt;[,&lt;pipe&gt;]
@@ -107,7 +107,7 @@ public class LocalOfficeConnection
public void setUnoUrl(String url)
throws java.net.MalformedURLException
{
- mURL = null;
+ mURL = null;
String prefix = "uno:localoffice";
if ( url.startsWith(prefix) )
@@ -130,25 +130,25 @@ public class LocalOfficeConnection
"Invalid UNO connection URL.");
}
}
- mURL = url;
+ mURL = url;
}
/**
* Sets an AWT container catory.
*
- * @param containerFactory This is a application provided AWT container
- * factory.
+ * @param containerFactory This is a application provided AWT container
+ * factory.
*/
public void setContainerFactory(ContainerFactory containerFactory)
{
- mContainerFactory = containerFactory;
+ mContainerFactory = containerFactory;
}
/**
* Retrives 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.
- * This method can return <code>null</code> if it fails to connect
+ * This method can return <code>null</code> if it fails to connect
* to the office application.
*
* @return The office UNO component context.
@@ -162,8 +162,8 @@ public class LocalOfficeConnection
/**
* Creates an office window.
- * The window is either a sub-class of java.awt.Canvas (local) or
- * java.awt.Container (RVP).
+ * The window is either a sub-class of java.awt.Canvas (local) or
+ * java.awt.Container (RVP).
*
* @param container This is an AWT container.
* @return The office window instance.
@@ -201,7 +201,7 @@ public class LocalOfficeConnection
}
/**
- * Removes an event listener from the listener list.
+ * Removes an event listener from the listener list.
*
* @param listener is a listener object.
*/
@@ -215,15 +215,15 @@ public class LocalOfficeConnection
*/
private XComponentContext connect()
{
- try
+ try
{
// create default local component context
XComponentContext xLocalContext =
com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null);
-
+
// initial serviceManager
XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager();
-
+
// create a urlresolver
Object urlResolver = xLocalServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", xLocalContext );
@@ -234,7 +234,7 @@ public class LocalOfficeConnection
// try to connect to soffice
Object aInitialObject = null;
- try
+ try
{
aInitialObject = xUrlResolver.resolve( mURL );
}
@@ -243,12 +243,12 @@ public class LocalOfficeConnection
// launch soffice
OfficeService aSOffice = new OfficeService();
aSOffice.startupService();
-
+
// wait until soffice is started
long nMaxMillis = System.currentTimeMillis() + 1000*aSOffice.getStartupTime();
while ( aInitialObject == null )
{
- try
+ try
{
// try to connect to soffice
Thread.currentThread().sleep( 500 );
@@ -263,16 +263,16 @@ public class LocalOfficeConnection
}
}
}
- finally
- {
+ finally
+ {
}
-
+
// XComponentContext
if( null != aInitialObject )
{
XPropertySet xPropertySet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, aInitialObject);
- Object xContext = xPropertySet.getPropertyValue("DefaultContext");
+ Object xContext = xPropertySet.getPropertyValue("DefaultContext");
XComponentContext xComponentContext = (XComponentContext) UnoRuntime.queryInterface(
XComponentContext.class, xContext);
return xComponentContext;
@@ -320,14 +320,14 @@ public class LocalOfficeConnection
*/
private String getProgramPath()
{
- if (mProgramPath == null)
+ if (mProgramPath == null)
{
// determine name of executable soffice
String aExec = OFFICE_APP_NAME; // default for UNIX
String aOS = System.getProperty("os.name");
// running on Windows?
- if (aOS.startsWith("Windows"))
+ if (aOS.startsWith("Windows"))
aExec = OFFICE_APP_NAME + ".exe";
// add other non-UNIX operating systems here
@@ -349,7 +349,7 @@ public class LocalOfficeConnection
/**
* Parses a connection URL.
- * This method accepts a UNO URL with following format:<br />
+ * This method accepts a UNO URL with following format:<br />
* <pre>
* url := uno:localoffice[,&lt;params&gt;];urp;StarOffice.NamingService
* params := &lt;path&gt;[,&lt;pipe&gt;]
@@ -361,64 +361,64 @@ public class LocalOfficeConnection
*
* <h4>Examples</h4>
* <ul>
- * <li>"uno:localoffice,pipe=xyz_Office,path=/opt/openoffice11/program;urp;StarOffice.ServiceManager";
- * <li>"uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager";
+ * <li>"uno:localoffice,pipe=xyz_Office,path=/opt/openoffice11/program;urp;StarOffice.ServiceManager";
+ * <li>"uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager";
* </ul>
*
* @param url This is UNO URL which describes the type of a connection.
- * @exception java.net.MalformedURLException when inappropreate URL was
- * provided.
+ * @exception java.net.MalformedURLException when inappropreate URL was
+ * provided.
*/
private void parseUnoUrlWithOfficePath(String url, String prefix)
throws java.net.MalformedURLException
{
// Extruct parameters.
- int idx = url.indexOf(";urp;StarOffice.NamingService");
+ int idx = url.indexOf(";urp;StarOffice.NamingService");
if (idx < 0)
throw new java.net.MalformedURLException(
"Invalid UNO connection URL.");
- String params = url.substring(prefix.length(), idx + 1);
+ String params = url.substring(prefix.length(), idx + 1);
// Parse parameters.
- String name = null;
- String path = null;
- String pipe = null;
- char ch;
- int state = 0;
- StringBuffer buffer = new StringBuffer();
+ String name = null;
+ String path = null;
+ String pipe = null;
+ char ch;
+ int state = 0;
+ StringBuffer buffer = new StringBuffer();
for(idx = 0; idx < params.length(); idx += 1) {
- ch = params.charAt(idx);
+ ch = params.charAt(idx);
switch (state) {
- case 0: // initial state
+ case 0: // initial state
switch(ch) {
case ',':
buffer.delete(0, buffer.length());
- state = 1;
+ state = 1;
break;
case ';':
- state = 7;
+ state = 7;
break;
default:
buffer.delete(0, buffer.length());
buffer.append(ch);
- state = 1;
+ state = 1;
break;
}
break;
- case 1: // parameter name
+ case 1: // parameter name
switch(ch) {
case ' ':
case '=':
- name = buffer.toString();
- state = (ch == ' ')? 2: 3;
+ name = buffer.toString();
+ state = (ch == ' ')? 2: 3;
break;
case ',':
case ';':
- state = -6; // error: invalid name
+ state = -6; // error: invalid name
break;
default:
@@ -427,22 +427,22 @@ public class LocalOfficeConnection
}
break;
- case 2: // equal between the name and the value
+ case 2: // equal between the name and the value
switch(ch) {
case '=':
- state = 3;
+ state = 3;
break;
case ' ':
break;
default:
- state = -1; // error: missing '='
+ state = -1; // error: missing '='
break;
}
break;
- case 3: // value leading spaces
+ case 3: // value leading spaces
switch(ch) {
case ' ':
break;
@@ -450,30 +450,30 @@ public class LocalOfficeConnection
default:
buffer.delete(0, buffer.length());
buffer.append(ch);
- state = 4;
+ state = 4;
break;
}
break;
- case 4: // value
+ case 4: // value
switch(ch) {
case ' ':
case ',':
case ';':
- idx -= 1; // put back the last read character
- state = 5;
+ idx -= 1; // put back the last read character
+ state = 5;
if (name.equals("path")) {
if (path == null)
- path = buffer.toString();
+ path = buffer.toString();
else
- state = -3; // error: more then one 'path'
+ state = -3; // error: more then one 'path'
} else if (name.equals("pipe")) {
if (pipe == null)
- pipe = buffer.toString();
+ pipe = buffer.toString();
else
- state = -4; // error: more then one 'pipe'
+ state = -4; // error: more then one 'pipe'
} else
- state = -2; // error: unknown parameter
+ state = -2; // error: unknown parameter
buffer.delete(0, buffer.length());
break;
@@ -483,26 +483,26 @@ public class LocalOfficeConnection
}
break;
- case 5: // a delimeter after the value
+ case 5: // a delimeter after the value
switch(ch) {
case ' ':
break;
case ',':
- state = 6;
+ state = 6;
break;
case ';':
- state = 7;
+ state = 7;
break;
default:
- state = -5; // error: ' ' inside the value
+ state = -5; // error: ' ' inside the value
break;
}
break;
- case 6: // leading spaces before next parameter name
+ case 6: // leading spaces before next parameter name
switch(ch) {
case ' ':
break;
@@ -510,7 +510,7 @@ public class LocalOfficeConnection
default:
buffer.delete(0, buffer.length());
buffer.append(ch);
- state = 1;
+ state = 1;
break;
}
break;
@@ -532,7 +532,7 @@ public class LocalOfficeConnection
}
/* replaces each substring aSearch in aString by aReplace.
-
+
StringBuffer.replaceAll() is not avaialable in Java 1.3.x.
*/
private static String replaceAll(String aString, String aSearch, String aReplace )
@@ -541,7 +541,7 @@ public class LocalOfficeConnection
int nPos = aString.length();
int nOfs = aSearch.length();
-
+
while ( ( nPos = aString.lastIndexOf( aSearch, nPos - 1 ) ) > -1 )
aBuffer.replace( nPos, nPos+nOfs, aReplace );
@@ -558,8 +558,8 @@ public class LocalOfficeConnection
aPipeName = replaceAll( aPipeName, "_", "%B7" );
return replaceAll( replaceAll( java.net.URLEncoder.encode(aPipeName), "\\+", "%20" ), "%", "_" );
}
-
- /**
+
+ /**
* @para This is an implementation of the native office service.
* @deprecated
*/
@@ -572,8 +572,8 @@ public class LocalOfficeConnection
* @return The identifier of the office service.
*/
public String getIdentifier()
- {
- if ( mPipe == null)
+ {
+ if ( mPipe == null)
return getPipeName();
else
return mPipe;
diff --git a/bean/com/sun/star/beans/LocalOfficeWindow.java b/bean/com/sun/star/beans/LocalOfficeWindow.java
index 7d4470415856..d6606664553b 100644
--- a/bean/com/sun/star/beans/LocalOfficeWindow.java
+++ b/bean/com/sun/star/beans/LocalOfficeWindow.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -46,27 +46,27 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
/**
- * This class represents a local office window.
+ * This class represents a local office window.
* @deprecated
*/
public class LocalOfficeWindow
extends java.awt.Canvas
implements OfficeWindow, XEventListener
{
- private transient OfficeConnection mConnection;
- private transient XWindowPeer mParentProxy;
- private transient XWindowPeer mWindow;
- private boolean bPeer = false;
+ private transient OfficeConnection mConnection;
+ private transient XWindowPeer mParentProxy;
+ private transient XWindowPeer mWindow;
+ private boolean bPeer = false;
/**
* Construnctor.
*
- * @param connection The office connection object the window
- * belongs to.
+ * @param connection The office connection object the window
+ * belongs to.
*/
/* package */ LocalOfficeWindow(OfficeConnection connection)
{
- mConnection = connection;
+ mConnection = connection;
mConnection.addEventListener((XEventListener)this);
}
@@ -102,14 +102,14 @@ public class LocalOfficeWindow
{
// the window will be disposed by the framework
mWindow = null;
- mConnection = null;
+ mConnection = null;
}
/**
* Returns an AWT toolkit.
*/
private XToolkit queryAWTToolkit()
- throws com.sun.star.uno.Exception
+ throws com.sun.star.uno.Exception
{
// Create a UNO toolkit.
XMultiComponentFactory compfactory;
@@ -126,7 +126,7 @@ public class LocalOfficeWindow
else
return null;
}
-
+
/// called when system parent is available, reparents the bean window
private void aquireSystemWindow()
{
@@ -163,7 +163,7 @@ public class LocalOfficeWindow
/// callback handler to get to know when we become visible
//@deprecated
- class ComponentEventHandler
+ class ComponentEventHandler
extends java.awt.event.ComponentAdapter
{
public void componentHidden( java.awt.event.ComponentEvent e)
@@ -194,14 +194,14 @@ public class LocalOfficeWindow
aquireSystemWindow();
else
releaseSystemWindow();
- }
-
+ }
+
/** Factory method for a UNO AWT toolkit window as a child of this Java window.
*
*/
private XWindowPeer createUNOWindowPeer()
{
- try
+ try
{
// get this windows native window type
int type = getNativeWindowSystemType();
@@ -229,9 +229,9 @@ public class LocalOfficeWindow
desc.Parent = parentPeer;
desc.Bounds = aRect;
desc.WindowServiceName = "workwindow";
- desc.WindowAttributes = (type == SystemDependent.SYSTEM_WIN32)
+ desc.WindowAttributes = (type == SystemDependent.SYSTEM_WIN32)
? WindowAttribute.SHOW : 0;
- mWindow = queryAWTToolkit().createWindow(desc);
+ mWindow = queryAWTToolkit().createWindow(desc);
// to get notified when we become visible
addComponentListener( new ComponentEventHandler() );
@@ -239,7 +239,7 @@ public class LocalOfficeWindow
// set initial visibility
XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow);
aWindow.setVisible( bPeer );
- }
+ }
catch (com.sun.star.uno.Exception exp) {
}
diff --git a/bean/com/sun/star/beans/NativeConnection.java b/bean/com/sun/star/beans/NativeConnection.java
index 7cf2bcb581a5..786ffce4e2e2 100644
--- a/bean/com/sun/star/beans/NativeConnection.java
+++ b/bean/com/sun/star/beans/NativeConnection.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -54,6 +54,6 @@ import com.sun.star.connection.XConnection;
return Description;
}
- private long NativeHandle;
- private String Description;
+ private long NativeHandle;
+ private String Description;
}
diff --git a/bean/com/sun/star/beans/NativeService.java b/bean/com/sun/star/beans/NativeService.java
index ad7f73c29a0f..3a808b97839c 100644
--- a/bean/com/sun/star/beans/NativeService.java
+++ b/bean/com/sun/star/beans/NativeService.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,6 +31,6 @@ package com.sun.star.beans;
*/
/* package */ interface NativeService {
public String getIdentifier();
- public void startupService() throws java.io.IOException;
+ public void startupService() throws java.io.IOException;
public int getStartupTime();
}
diff --git a/bean/com/sun/star/beans/OfficeConnection.java b/bean/com/sun/star/beans/OfficeConnection.java
index 6d25015e87f1..438f42277330 100644
--- a/bean/com/sun/star/beans/OfficeConnection.java
+++ b/bean/com/sun/star/beans/OfficeConnection.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,7 +33,7 @@ import com.sun.star.lang.XComponent;
import com.sun.star.uno.XComponentContext;
/**
- * This abstract class reprecents a connection to the office
+ * This abstract class reprecents a connection to the office
* application.
* @deprecated
*/
@@ -51,14 +51,14 @@ public interface OfficeConnection
/**
* Sets an AWT container catory.
*
- * @param containerFactory This is a application provided AWT container
- * factory.
+ * @param containerFactory This is a application provided AWT container
+ * factory.
*/
void setContainerFactory(ContainerFactory containerFactory);
/**
* Retrives 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.
*
* @return The office UNO component context.
@@ -67,9 +67,9 @@ public interface OfficeConnection
/**
* Creates an office window.
- * The window is either a sub-class of java.awt.Canvas (local) or
- * java.awt.Container (RVP).
- *
+ * The window is either a sub-class of java.awt.Canvas (local) or
+ * java.awt.Container (RVP).
+ *
* This method does not add add the office window to its container.
*
* @param container This is an AWT container.
diff --git a/bean/com/sun/star/beans/OfficeWindow.java b/bean/com/sun/star/beans/OfficeWindow.java
index 0e7232bab617..f3efaedade7e 100644
--- a/bean/com/sun/star/beans/OfficeWindow.java
+++ b/bean/com/sun/star/beans/OfficeWindow.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,8 +32,8 @@ import java.awt.Component;
import com.sun.star.awt.XWindowPeer;
/**
- * The concreate implementation of the OfficeWindow extends an
- * approperate type of visual component (java.awt.Canvas for local
+ * The concreate implementation of the OfficeWindow extends an
+ * approperate type of visual component (java.awt.Canvas for local
* and java.awt.Container for remote).
* @deprecated
*/
diff --git a/bean/com/sun/star/comp/beans/CallWatchThread.java b/bean/com/sun/star/comp/beans/CallWatchThread.java
index 1ab89337c74e..b25868d2156f 100644
--- a/bean/com/sun/star/comp/beans/CallWatchThread.java
+++ b/bean/com/sun/star/comp/beans/CallWatchThread.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/bean/com/sun/star/comp/beans/ContainerFactory.java b/bean/com/sun/star/comp/beans/ContainerFactory.java
index c7f084df5d8c..f622ee329aca 100644
--- a/bean/com/sun/star/comp/beans/ContainerFactory.java
+++ b/bean/com/sun/star/comp/beans/ContainerFactory.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,7 +30,7 @@ package com.sun.star.comp.beans;
import java.awt.Container;
/**
- * This interface reprecents an AWT container factory.
+ * This interface reprecents an AWT container factory.
*
* @deprecated
*
diff --git a/bean/com/sun/star/comp/beans/Controller.java b/bean/com/sun/star/comp/beans/Controller.java
index db99de7a5d5f..22e055630b73 100644
--- a/bean/com/sun/star/comp/beans/Controller.java
+++ b/bean/com/sun/star/comp/beans/Controller.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -53,7 +53,7 @@ public class Controller
//==============================================================
// com.sun.star.frame.XController
//--------------------------------------------------------------
-
+
public void attachFrame( /*IN*/ com.sun.star.frame.XFrame xFrame )
{
xController.attachFrame( xFrame );
@@ -92,16 +92,16 @@ public class Controller
//==============================================================
// com.sun.star.frame.XDispatchProvider
//--------------------------------------------------------------
-
- public com.sun.star.frame.XDispatch queryDispatch(
- /*IN*/ com.sun.star.util.URL aURL,
- /*IN*/ String aTargetFrameName,
+
+ public com.sun.star.frame.XDispatch queryDispatch(
+ /*IN*/ com.sun.star.util.URL aURL,
+ /*IN*/ String aTargetFrameName,
/*IN*/ int nSearchFlags )
{
return xDispatchProvider.queryDispatch( aURL, aTargetFrameName, nSearchFlags );
}
- public com.sun.star.frame.XDispatch[] queryDispatches(
+ public com.sun.star.frame.XDispatch[] queryDispatches(
/*IN*/ com.sun.star.frame.DispatchDescriptor[] aRequests )
{
return xDispatchProvider.queryDispatches( aRequests );
diff --git a/bean/com/sun/star/comp/beans/Frame.java b/bean/com/sun/star/comp/beans/Frame.java
index 59382eeaebb9..28f95bd80f8b 100644
--- a/bean/com/sun/star/comp/beans/Frame.java
+++ b/bean/com/sun/star/comp/beans/Frame.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,9 +33,9 @@ import com.sun.star.uno.UnoRuntime;
*
* @since OOo 2.0.0
*/
-public class Frame
+public class Frame
extends Wrapper
- implements
+ implements
com.sun.star.frame.XFrame,
com.sun.star.frame.XDispatchProvider,
com.sun.star.frame.XDispatchProviderInterception
@@ -43,7 +43,7 @@ public class Frame
private com.sun.star.frame.XFrame xFrame;
private com.sun.star.frame.XDispatchProvider xDispatchProvider;
private com.sun.star.frame.XDispatchProviderInterception xDispatchProviderInterception;
-
+
public Frame( com.sun.star.frame.XFrame xFrame )
{
super( xFrame );
@@ -59,7 +59,7 @@ public class Frame
//==============================================================
// com.sun.star.frame.XFrame
//--------------------------------------------------------------
-
+
public void initialize( /*IN*/com.sun.star.awt.XWindow xWindow )
{
xFrame.initialize( xWindow );
@@ -148,16 +148,16 @@ public class Frame
//==============================================================
// com.sun.star.frame.XDispatchProvider
//--------------------------------------------------------------
-
- public com.sun.star.frame.XDispatch queryDispatch(
- /*IN*/ com.sun.star.util.URL aURL,
- /*IN*/ String aTargetFrameName,
+
+ public com.sun.star.frame.XDispatch queryDispatch(
+ /*IN*/ com.sun.star.util.URL aURL,
+ /*IN*/ String aTargetFrameName,
/*IN*/ int nSearchFlags )
{
return xDispatchProvider.queryDispatch( aURL, aTargetFrameName, nSearchFlags );
}
- public com.sun.star.frame.XDispatch[] queryDispatches(
+ public com.sun.star.frame.XDispatch[] queryDispatches(
/*IN*/ com.sun.star.frame.DispatchDescriptor[] aRequests )
{
return xDispatchProvider.queryDispatches( aRequests );
@@ -166,14 +166,14 @@ public class Frame
//==============================================================
// com.sun.star.frame.XDispatchProviderInterception
//--------------------------------------------------------------
-
- public void registerDispatchProviderInterceptor(
+
+ public void registerDispatchProviderInterceptor(
/*IN*/ com.sun.star.frame.XDispatchProviderInterceptor xInterceptor )
{
xDispatchProviderInterception.registerDispatchProviderInterceptor( xInterceptor );
}
- public void releaseDispatchProviderInterceptor(
+ public void releaseDispatchProviderInterceptor(
/*IN*/ com.sun.star.frame.XDispatchProviderInterceptor xInterceptor )
{
xDispatchProviderInterception.releaseDispatchProviderInterceptor( xInterceptor );
diff --git a/bean/com/sun/star/comp/beans/HasConnectionException.java b/bean/com/sun/star/comp/beans/HasConnectionException.java
index fcebebf9334f..475e4c69ce0a 100644
--- a/bean/com/sun/star/comp/beans/HasConnectionException.java
+++ b/bean/com/sun/star/comp/beans/HasConnectionException.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/bean/com/sun/star/comp/beans/InvalidArgumentException.java b/bean/com/sun/star/comp/beans/InvalidArgumentException.java
index b9e0690a86f4..03e9eea8b433 100644
--- a/bean/com/sun/star/comp/beans/InvalidArgumentException.java
+++ b/bean/com/sun/star/comp/beans/InvalidArgumentException.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/bean/com/sun/star/comp/beans/JavaWindowPeerFake.java b/bean/com/sun/star/comp/beans/JavaWindowPeerFake.java
index 75069385dd32..82ae588a3d4b 100644
--- a/bean/com/sun/star/comp/beans/JavaWindowPeerFake.java
+++ b/bean/com/sun/star/comp/beans/JavaWindowPeerFake.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,21 +39,21 @@ import com.sun.star.awt.*;
{
protected int localSystemType;
protected Any wrappedHandle;
-
+
/** Create the faked window peer.
* @param _hWindow the system handle to the window.
* @param _systemType specifies the system type.
*/
public JavaWindowPeerFake(Any _hWindow, int _systemType)
{
- localSystemType = _systemType;
+ localSystemType = _systemType;
wrappedHandle = _hWindow;
}
/** <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.
*/
- public Object getWindowHandle(/*IN*/byte[] ProcessId, /*IN*/short SystemType)
+ public Object getWindowHandle(/*IN*/byte[] ProcessId, /*IN*/short SystemType)
throws com.sun.star.uno.RuntimeException
{
if (SystemType == localSystemType) {
@@ -61,7 +61,7 @@ import com.sun.star.awt.*;
}
else return null;
}
-
+
/** not really neaded.
*/
public XToolkit getToolkit()
diff --git a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java
index 8467f1b75812..c645de536146 100644
--- a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java
+++ b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -55,25 +55,25 @@ import com.sun.star.lib.util.NativeLibraryLoader;
public class LocalOfficeConnection
implements OfficeConnection
{
- public static final String OFFICE_APP_NAME = "soffice";
- public static final String OFFICE_LIB_NAME = "officebean";
- public static final String OFFICE_ID_SUFFIX = "_Office";
-
- private static String mProgramPath;
-
- private Process mProcess;
- private ContainerFactory mContainerFactory;
- private XComponentContext mContext;
- private XBridge mBridge;
-
- private String mURL;
- private String mConnType;
- private String mPipe;
- private String mPort;
- private String mProtocol;
- private String mInitialObject;
-
- private List mComponents = new Vector();
+ public static final String OFFICE_APP_NAME = "soffice";
+ public static final String OFFICE_LIB_NAME = "officebean";
+ public static final String OFFICE_ID_SUFFIX = "_Office";
+
+ private static String mProgramPath;
+
+ private Process mProcess;
+ private ContainerFactory mContainerFactory;
+ private XComponentContext mContext;
+ private XBridge mBridge;
+
+ private String mURL;
+ private String mConnType;
+ private String mPipe;
+ private String mPort;
+ private String mProtocol;
+ private String mInitialObject;
+
+ private List mComponents = new Vector();
private static long m_nBridgeCounter = 0;
//-------------------------------------------------------------------------
@@ -82,51 +82,51 @@ public class LocalOfficeConnection
// preload shared libraries whichs import lips are linked to officebean
if ( System.getProperty( "os.name" ).startsWith( "Windows" ) )
{
- try
+ try
{
NativeLibraryLoader.loadLibrary(LocalOfficeConnection.class.getClassLoader(), "msvcr70");
- }
+ }
catch (Throwable e)
{
// loading twice would fail
System.err.println( "cannot find msvcr70" );
- }
+ }
- try
+ try
{
NativeLibraryLoader.loadLibrary(LocalOfficeConnection.class.getClassLoader(), "msvcr71");
- }
+ }
catch (Throwable e)
{
// loading twice would fail
System.err.println( "cannot find msvcr71" );
- }
+ }
- try
+ try
{
NativeLibraryLoader.loadLibrary(LocalOfficeConnection.class.getClassLoader(), "uwinapi");
- }
+ }
catch (Throwable e)
{
// loading twice would fail
System.err.println( "cannot find uwinapi" );
- }
+ }
- try
+ try
{
NativeLibraryLoader.loadLibrary(LocalOfficeConnection.class.getClassLoader(), "jawt");
- }
+ }
catch (Throwable e)
{
// loading twice would fail
System.err.println( "cannot find jawt" );
- }
+ }
}
// load shared library for JNI code
NativeLibraryLoader.loadLibrary( LocalOfficeConnection.class.getClassLoader(), "officebean" );
}
-
+
//-------------------------------------------------------------------------
// debugging method
private void dbgPrint( String aMessage )
@@ -136,16 +136,16 @@ public class LocalOfficeConnection
/**
* Constructor.
- * Sets up paths to the office application and native libraries if
- * values are available in <code>OFFICE_PROP_FILE</code> in the user
+ * Sets up paths to the office application and native libraries if
+ * values are available in <code>OFFICE_PROP_FILE</code> in the user
* home directory.<br />
- * "com.sun.star.beans.path" - the office application directory;<br/>
+ * "com.sun.star.beans.path" - the office application directory;<br/>
* "com.sun.star.beans.libpath" - native libraries directory.
*/
public LocalOfficeConnection()
- {
+ {
// init member vars
- try
+ try
{
setUnoUrl( "uno:pipe,name=" + getPipeName() + ";urp;StarOffice.ServiceManager" );
}
@@ -155,7 +155,7 @@ public class LocalOfficeConnection
/**
* Sets a connection URL.
- * This implementation accepts a UNO URL with following format:<br />
+ * This implementation accepts a UNO URL with following format:<br />
* <pre>
* url := uno:localoffice[,&lt;params&gt;];urp;StarOffice.ServiceManager
* params := &lt;path&gt;[,&lt;pipe&gt;]
@@ -170,7 +170,7 @@ public class LocalOfficeConnection
public void setUnoUrl(String url)
throws java.net.MalformedURLException
{
- mURL = null;
+ mURL = null;
String prefix = "uno:localoffice";
if ( url.startsWith(prefix) )
@@ -193,25 +193,25 @@ public class LocalOfficeConnection
"Invalid UNO connection URL.");
}
}
- mURL = url;
+ mURL = url;
}
/**
* Sets an AWT container catory.
*
- * @param containerFactory This is a application provided AWT container
- * factory.
+ * @param containerFactory This is a application provided AWT container
+ * factory.
*/
public void setContainerFactory(ContainerFactory containerFactory)
{
- mContainerFactory = containerFactory;
+ mContainerFactory = containerFactory;
}
/**
* Retrives 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.
- * This method can return <code>null</code> if it fails to connect
+ * This method can return <code>null</code> if it fails to connect
* to the office application.
*
* @return The office UNO component context.
@@ -225,8 +225,8 @@ public class LocalOfficeConnection
/**
* Creates an office window.
- * The window is either a sub-class of java.awt.Canvas (local) or
- * java.awt.Container (RVP).
+ * The window is either a sub-class of java.awt.Canvas (local) or
+ * java.awt.Container (RVP).
*
* @param container This is an AWT container.
* @return The office window instance.
@@ -249,9 +249,9 @@ public class LocalOfficeConnection
}
mComponents.clear();
- //Terminate the bridge. It turned out that this is necessary for the bean
- //to work properly when displayed in an applet within Internet Explorer.
- //When navigating off the page which is showing the applet and then going
+ //Terminate the bridge. It turned out that this is necessary for the bean
+ //to work properly when displayed in an applet within Internet Explorer.
+ //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
//do not work properly anymore. Therefore when Applet.stop is called the connection
//to the office including the bridge needs to be terminated.
@@ -259,11 +259,11 @@ public class LocalOfficeConnection
{
XComponent comp = (XComponent)UnoRuntime.queryInterface(
XComponent.class, mBridge);
- if (comp != null)
+ if (comp != null)
comp.dispose();
else
System.err.println("LocalOfficeConnection: could not dispose bridge!");
-
+
mBridge = null;
}
@@ -282,7 +282,7 @@ public class LocalOfficeConnection
}
/**
- * Removes an event listener from the listener list.
+ * Removes an event listener from the listener list.
*
* @param listener is a listener object.
*/
@@ -296,18 +296,18 @@ public class LocalOfficeConnection
*/
private XComponentContext connect()
{
- try
+ try
{
// create default local component context
XComponentContext xLocalContext =
com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null);
-
+
// initial serviceManager
XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager();
-
+
// try to connect to soffice
Object aInitialObject = null;
- try
+ try
{
aInitialObject = resolve(xLocalContext, mURL);
}
@@ -316,12 +316,12 @@ public class LocalOfficeConnection
// launch soffice
OfficeService aSOffice = new OfficeService();
aSOffice.startupService();
-
+
// wait until soffice is started
long nMaxMillis = System.currentTimeMillis() + 1000*aSOffice.getStartupTime();
while ( aInitialObject == null )
{
- try
+ try
{
// try to connect to soffice
Thread.currentThread().sleep( 500 );
@@ -336,16 +336,16 @@ public class LocalOfficeConnection
}
}
}
- finally
- {
+ finally
+ {
}
-
+
// XComponentContext
if( null != aInitialObject )
{
XPropertySet xPropertySet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, aInitialObject);
- Object xContext = xPropertySet.getPropertyValue("DefaultContext");
+ Object xContext = xPropertySet.getPropertyValue("DefaultContext");
XComponentContext xComponentContext = (XComponentContext) UnoRuntime.queryInterface(
XComponentContext.class, xContext);
return xComponentContext;
@@ -386,12 +386,12 @@ public class LocalOfficeConnection
return null;
}
-
+
//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.
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.lang.IllegalArgumentException
{
@@ -422,11 +422,11 @@ public class LocalOfficeConnection
Object rootObject = null;
XBridgeFactory xBridgeFactory= null;
-
+
XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager();
try {
xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(
- XBridgeFactory.class,
+ XBridgeFactory.class,
xLocalServiceManager.createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", xLocalContext));
} catch (com.sun.star.uno.Exception e) {
@@ -440,13 +440,13 @@ public class LocalOfficeConnection
"com.sun.star.connection.Connector", xLocalContext);
} catch (com.sun.star.uno.Exception e) {
throw new com.sun.star.uno.RuntimeException(e.getMessage());
- }
+ }
XConnector connector_xConnector = (XConnector)UnoRuntime.queryInterface(XConnector.class, connector);
// connect to the server
XConnection xConnection = connector_xConnector.connect(conDcp);
// 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
- //a new bridge. This does not work because of (i51323). Therefore we
+ //empty string as bridge name into createBridge. Then we should always get
+ //a new bridge. This does not work because of (i51323). Therefore we
//create unique bridge names for the current process.
String sBridgeName = "OOoBean_private_bridge_" + String.valueOf(m_nBridgeCounter++);
try {
@@ -468,14 +468,14 @@ public class LocalOfficeConnection
*/
static private String getProgramPath()
{
- if (mProgramPath == null)
+ if (mProgramPath == null)
{
// determine name of executable soffice
String aExec = OFFICE_APP_NAME; // default for UNIX
String aOS = System.getProperty("os.name");
// running on Windows?
- if (aOS.startsWith("Windows"))
+ if (aOS.startsWith("Windows"))
aExec = OFFICE_APP_NAME + ".exe";
// add other non-UNIX operating systems here
@@ -484,7 +484,7 @@ public class LocalOfficeConnection
// find soffice executable relative to this class's class loader:
File path = NativeLibraryLoader.getResource(
LocalOfficeConnection.class.getClassLoader(), aExec);
- if (path != null)
+ if (path != null)
mProgramPath = path.getParent();
// default is ""
@@ -496,7 +496,7 @@ public class LocalOfficeConnection
/**
* Parses a connection URL.
- * This method accepts a UNO URL with following format:<br />
+ * This method accepts a UNO URL with following format:<br />
* <pre>
* url := uno:localoffice[,&lt;params&gt;];urp;StarOffice.NamingService
* params := &lt;path&gt;[,&lt;pipe&gt;]
@@ -508,64 +508,64 @@ public class LocalOfficeConnection
*
* <h4>Examples</h4>
* <ul>
- * <li>"uno:localoffice,pipe=xyz_Office,path=/opt/openoffice11/program;urp;StarOffice.ServiceManager";
- * <li>"uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager";
+ * <li>"uno:localoffice,pipe=xyz_Office,path=/opt/openoffice11/program;urp;StarOffice.ServiceManager";
+ * <li>"uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager";
* </ul>
*
* @param url This is UNO URL which describes the type of a connection.
- * @exception java.net.MalformedURLException when inappropreate URL was
- * provided.
+ * @exception java.net.MalformedURLException when inappropreate URL was
+ * provided.
*/
private void parseUnoUrlWithOfficePath(String url, String prefix)
throws java.net.MalformedURLException
{
// Extruct parameters.
- int idx = url.indexOf(";urp;StarOffice.NamingService");
+ int idx = url.indexOf(";urp;StarOffice.NamingService");
if (idx < 0)
throw new java.net.MalformedURLException(
"Invalid UNO connection URL.");
- String params = url.substring(prefix.length(), idx + 1);
+ String params = url.substring(prefix.length(), idx + 1);
// Parse parameters.
- String name = null;
- String path = null;
- String pipe = null;
- char ch;
- int state = 0;
- StringBuffer buffer = new StringBuffer();
+ String name = null;
+ String path = null;
+ String pipe = null;
+ char ch;
+ int state = 0;
+ StringBuffer buffer = new StringBuffer();
for(idx = 0; idx < params.length(); idx += 1) {
- ch = params.charAt(idx);
+ ch = params.charAt(idx);
switch (state) {
- case 0: // initial state
+ case 0: // initial state
switch(ch) {
case ',':
buffer.delete(0, buffer.length());
- state = 1;
+ state = 1;
break;
case ';':
- state = 7;
+ state = 7;
break;
default:
buffer.delete(0, buffer.length());
buffer.append(ch);
- state = 1;
+ state = 1;
break;
}
break;
- case 1: // parameter name
+ case 1: // parameter name
switch(ch) {
case ' ':
case '=':
- name = buffer.toString();
- state = (ch == ' ')? 2: 3;
+ name = buffer.toString();
+ state = (ch == ' ')? 2: 3;
break;
case ',':
case ';':
- state = -6; // error: invalid name
+ state = -6; // error: invalid name
break;
default:
@@ -574,22 +574,22 @@ public class LocalOfficeConnection
}
break;
- case 2: // equal between the name and the value
+ case 2: // equal between the name and the value
switch(ch) {
case '=':
- state = 3;
+ state = 3;
break;
case ' ':
break;
default:
- state = -1; // error: missing '='
+ state = -1; // error: missing '='
break;
}
break;
- case 3: // value leading spaces
+ case 3: // value leading spaces
switch(ch) {
case ' ':
break;
@@ -597,30 +597,30 @@ public class LocalOfficeConnection
default:
buffer.delete(0, buffer.length());
buffer.append(ch);
- state = 4;
+ state = 4;
break;
}
break;
- case 4: // value
+ case 4: // value
switch(ch) {
case ' ':
case ',':
case ';':
- idx -= 1; // put back the last read character
- state = 5;
+ idx -= 1; // put back the last read character
+ state = 5;
if (name.equals("path")) {
if (path == null)
- path = buffer.toString();
+ path = buffer.toString();
else
- state = -3; // error: more then one 'path'
+ state = -3; // error: more then one 'path'
} else if (name.equals("pipe")) {
if (pipe == null)
- pipe = buffer.toString();
+ pipe = buffer.toString();
else
- state = -4; // error: more then one 'pipe'
+ state = -4; // error: more then one 'pipe'
} else
- state = -2; // error: unknown parameter
+ state = -2; // error: unknown parameter
buffer.delete(0, buffer.length());
break;
@@ -630,26 +630,26 @@ public class LocalOfficeConnection
}
break;
- case 5: // a delimeter after the value
+ case 5: // a delimeter after the value
switch(ch) {
case ' ':
break;
case ',':
- state = 6;
+ state = 6;
break;
case ';':
- state = 7;
+ state = 7;
break;
default:
- state = -5; // error: ' ' inside the value
+ state = -5; // error: ' ' inside the value
break;
}
break;
- case 6: // leading spaces before next parameter name
+ case 6: // leading spaces before next parameter name
switch(ch) {
case ' ':
break;
@@ -657,7 +657,7 @@ public class LocalOfficeConnection
default:
buffer.delete(0, buffer.length());
buffer.append(ch);
- state = 1;
+ state = 1;
break;
}
break;
@@ -679,7 +679,7 @@ public class LocalOfficeConnection
}
/* replaces each substring aSearch in aString by aReplace.
-
+
StringBuffer.replaceAll() is not avaialable in Java 1.3.x.
*/
private static String replaceAll(String aString, String aSearch, String aReplace )
@@ -688,7 +688,7 @@ public class LocalOfficeConnection
int nPos = aString.length();
int nOfs = aSearch.length();
-
+
while ( ( nPos = aString.lastIndexOf( aSearch, nPos - 1 ) ) > -1 )
aBuffer.replace( nPos, nPos+nOfs, aReplace );
@@ -705,8 +705,8 @@ public class LocalOfficeConnection
aPipeName = replaceAll( aPipeName, "_", "%B7" );
return replaceAll( replaceAll( java.net.URLEncoder.encode(aPipeName), "+", "%20" ), "%", "_" );
}
-
- /**
+
+ /**
* @para This is an implementation of the native office service.
*/
private class OfficeService
@@ -718,8 +718,8 @@ public class LocalOfficeConnection
* @return The identifier of the office service.
*/
public String getIdentifier()
- {
- if ( mPipe == null)
+ {
+ if ( mPipe == null)
return getPipeName();
else
return mPipe;
@@ -746,7 +746,7 @@ public class LocalOfficeConnection
} catch (java.lang.SecurityException e)
{
e.printStackTrace();
- }
+ }
// create call with arguments
String[] cmdArray = new String[nSizeCmdArray];
@@ -754,8 +754,8 @@ public class LocalOfficeConnection
String unoPath = System.getenv("UNO_PATH");
if (unoPath == null)
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(getProgramPath(), OFFICE_APP_NAME)).getPath();
cmdArray[0] = (new File(unoPath, OFFICE_APP_NAME)).getPath();
cmdArray[1] = "-nologo";
cmdArray[2] = "-nodefault";
@@ -766,7 +766,7 @@ public class LocalOfficeConnection
cmdArray[3] = "-accept=socket,port=" + mPort + ";urp";
else
throw new java.io.IOException( "not connection specified" );
-
+
if (sOption != null)
cmdArray[4] = sOption;
@@ -795,14 +795,14 @@ public class LocalOfficeConnection
{
java.io.InputStream m_in;
java.io.PrintStream m_print;
-
+
public StreamProcessor(final java.io.InputStream in, final java.io.PrintStream out)
{
m_in = in;
m_print = out;
start();
}
-
+
public void run() {
java.io.BufferedReader r = new java.io.BufferedReader(
new java.io.InputStreamReader(m_in) );
diff --git a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
index b7c7ccd16f41..b99f83c0c6c0 100644
--- a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
+++ b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -49,7 +49,7 @@ import com.sun.star.uno.Type;
import com.sun.star.beans.NamedValue;
/**
- * This class represents a local office window.
+ * This class represents a local office window.
*
* @since OOo 2.0.0
*/
@@ -57,20 +57,20 @@ public class LocalOfficeWindow
extends java.awt.Canvas
implements OfficeWindow, XEventListener
{
- private transient OfficeConnection mConnection;
- private transient XWindowPeer mParentProxy;
- private transient XWindowPeer mWindow;
- private boolean bPeer = false;
+ private transient OfficeConnection mConnection;
+ private transient XWindowPeer mParentProxy;
+ private transient XWindowPeer mWindow;
+ private boolean bPeer = false;
/**
* Construnctor.
*
- * @param connection The office connection object the window
- * belongs to.
+ * @param connection The office connection object the window
+ * belongs to.
*/
protected LocalOfficeWindow(OfficeConnection connection)
{
- mConnection = connection;
+ mConnection = connection;
mConnection.addEventListener((XEventListener)this);
}
@@ -106,14 +106,14 @@ public class LocalOfficeWindow
{
// the window will be disposed by the framework
mWindow = null;
- mConnection = null;
+ mConnection = null;
}
/**
* Returns an AWT toolkit.
*/
private XToolkit queryAWTToolkit()
- throws com.sun.star.uno.Exception
+ throws com.sun.star.uno.Exception
{
// Create a UNO toolkit.
XMultiComponentFactory compfactory;
@@ -130,7 +130,7 @@ public class LocalOfficeWindow
else
return null;
}
-
+
/// called when system parent is available, reparents the bean window
private synchronized void aquireSystemWindow()
{
@@ -177,14 +177,14 @@ public class LocalOfficeWindow
aquireSystemWindow();
else
releaseSystemWindow();
- }
-
+ }
+
/** Factory method for a UNO AWT toolkit window as a child of this Java window.
*
*/
private synchronized XWindowPeer createUNOWindowPeer()
{
- try
+ try
{
// get this windows native window type
int type = getNativeWindowSystemType();
@@ -212,15 +212,15 @@ public class LocalOfficeWindow
desc.Parent = parentPeer;
desc.Bounds = aRect;
desc.WindowServiceName = "workwindow";
- desc.WindowAttributes = (type == SystemDependent.SYSTEM_WIN32)
+ desc.WindowAttributes = (type == SystemDependent.SYSTEM_WIN32)
? WindowAttribute.SHOW : 0;
- mWindow = queryAWTToolkit().createWindow(desc);
+ mWindow = queryAWTToolkit().createWindow(desc);
// set initial visibility
XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow);
aWindow.setVisible( bPeer );
- }
+ }
catch (com.sun.star.uno.Exception exp) {
}
@@ -228,7 +228,7 @@ public class LocalOfficeWindow
}
/** We make sure that the office window is notified that the parent
* will be removed.
- */
+ */
public void removeNotify()
{
try {
@@ -263,7 +263,7 @@ public class LocalOfficeWindow
*/
protected Any getWrappedWindowHandle()
{
-
+
NamedValue window = new NamedValue(
"WINDOW", new Any(new Type(Long.class), new Long(getNativeWindow())));
NamedValue xembed = new NamedValue(
diff --git a/bean/com/sun/star/comp/beans/NativeConnection.java b/bean/com/sun/star/comp/beans/NativeConnection.java
index ab8bd7b7bf01..d418d81f9d43 100644
--- a/bean/com/sun/star/comp/beans/NativeConnection.java
+++ b/bean/com/sun/star/comp/beans/NativeConnection.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -57,6 +57,6 @@ import com.sun.star.connection.XConnection;
return Description;
}
- private long NativeHandle;
- private String Description;
+ private long NativeHandle;
+ private String Description;
}
diff --git a/bean/com/sun/star/comp/beans/NativeService.java b/bean/com/sun/star/comp/beans/NativeService.java
index c28ca10a1901..b8faec55e715 100644
--- a/bean/com/sun/star/comp/beans/NativeService.java
+++ b/bean/com/sun/star/comp/beans/NativeService.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,6 +32,6 @@ package com.sun.star.comp.beans;
*/
/* package */ interface NativeService {
public String getIdentifier();
- public void startupService() throws java.io.IOException;
+ public void startupService() throws java.io.IOException;
public int getStartupTime();
}
diff --git a/bean/com/sun/star/comp/beans/NoConnectionException.java b/bean/com/sun/star/comp/beans/NoConnectionException.java
index a351983a7aad..c62c003d9efc 100644
--- a/bean/com/sun/star/comp/beans/NoConnectionException.java
+++ b/bean/com/sun/star/comp/beans/NoConnectionException.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -27,10 +27,10 @@
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
established yet or anymore.
-
+
@since OOo 2.0.0
*/
public class NoConnectionException extends Exception
diff --git a/bean/com/sun/star/comp/beans/NoDocumentException.java b/bean/com/sun/star/comp/beans/NoDocumentException.java
index d9aa3b162bdd..cc73453bf8b8 100644
--- a/bean/com/sun/star/comp/beans/NoDocumentException.java
+++ b/bean/com/sun/star/comp/beans/NoDocumentException.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/bean/com/sun/star/comp/beans/OOoBean.java b/bean/com/sun/star/comp/beans/OOoBean.java
index b10becb3ce9a..8727ac8cc9e1 100644
--- a/bean/com/sun/star/comp/beans/OOoBean.java
+++ b/bean/com/sun/star/comp/beans/OOoBean.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,7 +33,7 @@ import com.sun.star.uno.UnoRuntime;
// @requirement FUNC.PERF.LOC/0.6
// @requirement FUNC.PERF.FIX/0.6
/** This is the basic JavaBean for all OOo application modules.
-
+
@requirement FUNC.RES.OTH/0.2
No other resources are needed yet.
@@ -44,7 +44,7 @@ public class OOoBean
// @requirement FUNC.BEAN.VIEW/0.4
extends java.awt.Container
- implements
+ implements
// @requirement FUNC.PER/0.2
java.io.Externalizable
{
@@ -54,12 +54,12 @@ public class OOoBean
int nOOoCheckCycle = 1000;
// This member contains the connection to an OOo instance if established.
- private transient OfficeConnection iConnection;
- private transient EventListener xConnectionListener;
+ private transient OfficeConnection iConnection;
+ private transient EventListener xConnectionListener;
// @requirement FUNC.BEAN.VIEW/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.
// It is a child of the OOoBean canvas.
private OfficeWindow xFrameWindow;
@@ -76,14 +76,14 @@ public class OOoBean
// slot command execution environment
private transient com.sun.star.frame.XDispatchProvider xDispatcher;
private transient com.sun.star.util.XURLTransformer xURLTransformer;
-
+
// properties
private boolean bIgnoreVisibility = false; // to show even if already visible
private boolean bMenuBarVisible = true;
private boolean bStandardBarVisible = true;
private boolean bToolBarVisible = true;
private boolean bStatusBarVisible = true;
-
+
// debugging method
private void dbgPrint( String aMessage )
@@ -110,7 +110,7 @@ public class OOoBean
}
/** Generic constructor of the OOoBean.
-
+
Neither a connection is established nor any document loaded.
*/
public OOoBean()
@@ -118,14 +118,14 @@ public class OOoBean
// @requirement FUNC.CON.MULT/0.3
/** Constructor for an OOoBean which uses a specific office connection.
-
+
The connection must be established but no document is loaded.
@throws NoConnectionException
if the connection is not established.
-
- @deprecated Clients could use the getOOoConnection to obtain an OfficeConnection
- and use it as argument in a constructor for another OOoBean instance. Calling
+
+ @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.
*/
@@ -165,11 +165,11 @@ public class OOoBean
}
/** Sets the a connection to an OOo instance.
-
+
@internal
*/
private synchronized void setOOoConnection( OfficeConnection iNewConnection )
- throws HasConnectionException, NoConnectionException
+ throws HasConnectionException, NoConnectionException
{
// the connection cannot be exchanged
if ( iConnection != null )
@@ -202,7 +202,7 @@ public class OOoBean
if the specified connection cannot be established
*/
public void startOOoConnection( String aConnectionURL )
- throws java.net.MalformedURLException,
+ throws java.net.MalformedURLException,
HasConnectionException,
NoConnectionException
{
@@ -215,9 +215,9 @@ public class OOoBean
// @requirement FUNC.CON.CHK/0.7
/** Returns true if this OOoBean is connected to an OOo instance,
false otherwise.
-
- @deprecated This method is not useful in a multithreaded environment. Then
- all threads accessing the instance would have to be synchronized in order to
+
+ @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.
*/
@@ -231,8 +231,8 @@ public class OOoBean
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
+
+ When the OOoBean is displayed in an applet by a web browser, then this
method must be called from within java.applet.Applet.stop.
*/
public synchronized void stopOOoConnection()
@@ -251,26 +251,26 @@ public class OOoBean
iConnection = null;
iExConnection.dispose();
}
-
+
}
// @requirement FUNC.CON.STOP/0.4 (via XComponent.dispose())
// @requirement FUNC.CON.NTFY/0.4 (via XComponent.addEventListener())
/** Returns the 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
+ in receiving com.sun.star.lang.DisposedExceptions when calling
{@link #stopOOoConnection 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 {@link #stopOOoConnection stopOOoConnection}.
+ calling {@link #stopOOoConnection stopOOoConnection}.
@throws NoConnectionException
if no connection can be established
-
+
*/
public synchronized OfficeConnection getOOoConnection()
throws NoConnectionException
@@ -285,8 +285,8 @@ public class OOoBean
throw new NoConnectionException();
return iConnection;
}
-
- /** Returns the service factory used by this OOoBean instance.
+
+ /** Returns the service factory used by this OOoBean instance.
@throws NoConnectionException
if no connection is established and no default connection can be established.
@@ -304,8 +304,8 @@ public class OOoBean
{
com.sun.star.lang.XMultiComponentFactory aFactory =
iConn.getComponentContext().getServiceManager();
- xServiceFactory = (com.sun.star.lang.XMultiServiceFactory)
- UnoRuntime.queryInterface(
+ xServiceFactory = (com.sun.star.lang.XMultiServiceFactory)
+ UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, aFactory );
}
};
@@ -314,7 +314,7 @@ public class OOoBean
catch ( java.lang.InterruptedException aExc )
{ throw new NoConnectionException(); }
if ( xServiceFactory == null )
- throw new NoConnectionException();
+ throw new NoConnectionException();
}
return xServiceFactory;
@@ -339,13 +339,13 @@ public class OOoBean
catch ( com.sun.star.uno.Exception aExc )
{} // TBD: what if no connection exists?
}
-
+
return xDesktop;
}
/** Resets this bean to an empty document.
-
- If a document is loaded and the content modified,
+
+ 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.
@@ -354,17 +354,17 @@ public class OOoBean
@param bClearStateToo
Not only the document content but also the state of the bean,
like visibility of child components is cleared.
-
+
@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 {@link #clear} which discards
+ should call the clearDocument of the deriving class or {@link #clear} which discards
the currently displayed document.
*/
public synchronized void clearDocument( boolean bClearStateToo )
- throws
+ throws
com.sun.star.util.CloseVetoException,
NoConnectionException
{
@@ -372,8 +372,8 @@ public class OOoBean
clear();
}
- /** Resets the OOoBean to an empty status.
-
+ /** 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.
@@ -386,15 +386,15 @@ public class OOoBean
try
{
- CallWatchThread aCallWatchThread =
+ CallWatchThread aCallWatchThread =
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.
com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
UnoRuntime.queryInterface( com.sun.star.util.XCloseable.class, aFrame );
if ( xCloseable != null )
{
- try
+ try
{
xCloseable.close(true);
}
@@ -402,7 +402,7 @@ public class OOoBean
{ // a print job may be running
}
}
-
+
aDocument = null;
xDispatcher = null;
aFrame = null;
@@ -425,7 +425,7 @@ public class OOoBean
try
{
com.sun.star.lang.XComponent xComp = (com.sun.star.lang.XComponent)
- UnoRuntime.queryInterface(
+ UnoRuntime.queryInterface(
com.sun.star.lang.XComponent.class, xURLTransformer );
if ( xComp != null )
xComp.dispose();
@@ -437,7 +437,7 @@ public class OOoBean
xDesktop = null;
xServiceFactory = null;
-
+
aCallWatchThread.cancel();
}
catch ( java.lang.InterruptedException aExc )
@@ -447,20 +447,20 @@ public class OOoBean
// @requirement FUNC.PAR.LWP/0.4
/** 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
- {@link #loadFromURL loadFromURL}, {@link #loadFromStream loadFromStream1},
+ 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
+ {@link #loadFromURL loadFromURL}, {@link #loadFromStream loadFromStream1},
or {@link #loadFromByteArray 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 showing, then this method needs to be called after the container window
was made visible (java.lang.Component.setVisible(true)).
<p>
- Another scenario is that a OOoBean contains a document and is removed
- from a Java container and later added again. Then aquireSystemWindow needs
+ 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.
-
+
@throws SystemWindowException
if no system window can be aquired.
@@ -468,7 +468,7 @@ public class OOoBean
if the connection is not established.
*/
public synchronized void aquireSystemWindow()
- throws
+ throws
SystemWindowException,
// @requirement FUNC.CON.LOST/0.2
@@ -483,14 +483,14 @@ public class OOoBean
xFrameWindow.getAWTComponent().setVisible(true);
doLayout();
}
-
+
// @requirement FUNC.PAR.RWL/0.4
// @estimation 16h
/** This method must be called when the OOoBean before the
sytem window may be released by it's 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
+ This is the case when java.awt.Component.isDisplayable() returns
+ true. This is definitely the case when the OOoBean is removed
from it's parent container.
@throws SystemWindowException
@@ -498,13 +498,13 @@ public class OOoBean
@throws NoConnectionException
if the connection is not established.
-
- @deprecated When Component.removeNotify of the parent window of the actual
+
+ @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.
+ needed to be called previously.
*/
public synchronized void releaseSystemWindow()
- throws
+ throws
SystemWindowException,
// @requirement FUNC.CON.LOST/0.2
@@ -515,14 +515,14 @@ public class OOoBean
try { xFrameWindow.getAWTComponent().setVisible(false); }
catch ( com.sun.star.lang.DisposedException aExc )
- { throw new NoConnectionException(); }
+ { throw new NoConnectionException(); }
}
-
+
// @requirement FUNC.BEAN.LOAD/0.4
// @requirement FUNC.CON.AUTO/0.3
/** Loads the bean from the given URL.
-
- If a document is already loaded and the content modified,
+
+ If a document is already loaded and the content modified,
the changes are dismissed.
If no connection exists, a default connection is established.
@@ -535,30 +535,30 @@ public class OOoBean
@throws com.sun.star.lang.NoConnectionException
if no connection can be established.
-
+
@throws com.sun.star.util.CloseVetoException
- if the currently displayed document cannot be closed because it is
+ if the currently displayed document cannot be closed because it is
still be used, for example it is printed.
*/
- public void loadFromURL(
- final String aURL,
+ public void loadFromURL(
+ final String aURL,
final com.sun.star.beans.PropertyValue aArguments[] )
- throws
+ throws
// @requirement FUNC.CON.LOST/0.2
NoConnectionException,
- java.io.IOException,
+ java.io.IOException,
com.sun.star.lang.IllegalArgumentException,
com.sun.star.util.CloseVetoException
{
dbgPrint( "loadFromURL()" );
// try loading
- try
+ try
{
boolean bLoaded = false;
while ( !bLoaded )
{
// watch loading in a thread with a timeout (if OOo hangs)
- CallWatchThread aCallWatchThread =
+ CallWatchThread aCallWatchThread =
new CallWatchThread( nOOoStartTimeOut, "loadFromURL" );
try
@@ -577,29 +577,29 @@ public class OOoBean
add( xFrameWindow.getAWTComponent() );
}
- // create the document frame from UNO window.
+ // create the document frame from UNO window.
if ( aFrame == null )
{
// create the frame
- com.sun.star.awt.XWindow xWindow =
+ com.sun.star.awt.XWindow xWindow =
(com.sun.star.awt.XWindow) UnoRuntime.queryInterface(
com.sun.star.awt.XWindow.class, xFrameWindow.getUNOWindowPeer());
Object xFrame = xServiceFactory.createInstance( "com.sun.star.frame.Frame");
- aFrame = new Frame( (com.sun.star.frame.XFrame)UnoRuntime.queryInterface(
+ aFrame = new Frame( (com.sun.star.frame.XFrame)UnoRuntime.queryInterface(
com.sun.star.frame.XFrame.class, xFrame ) );
aFrame.initialize( xWindow );
aFrame.setName( aFrame.toString() );
// register the frame at the desktop
- com.sun.star.frame.XFrames xFrames =
- ( (com.sun.star.frame.XFramesSupplier)UnoRuntime.queryInterface(
+ com.sun.star.frame.XFrames xFrames =
+ ( (com.sun.star.frame.XFramesSupplier)UnoRuntime.queryInterface(
com.sun.star.frame.XFramesSupplier.class, getOOoDesktop() ) ).getFrames();
xFrames.append( aFrame );
}
// Initializes the slot command execution environment.
- xURLTransformer = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
- com.sun.star.util.XURLTransformer.class,
+ xURLTransformer = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+ com.sun.star.util.XURLTransformer.class,
xServiceFactory.createInstance( "com.sun.star.util.URLTransformer") );
xDispatcher = (com.sun.star.frame.XDispatchProvider)UnoRuntime.queryInterface(
com.sun.star.frame.XDispatchProvider.class, aFrame );
@@ -609,8 +609,8 @@ public class OOoBean
UnoRuntime.queryInterface( com.sun.star.frame.XComponentLoader.class, aFrame );
if ( xLoader == null )
{
- throw new java.lang.RuntimeException(
- "com.sun.star.frame.Frame(" + aFrame +
+ throw new java.lang.RuntimeException(
+ "com.sun.star.frame.Frame(" + aFrame +
") without com.sun.star.frame.XComponentLoader" );
}
@@ -618,40 +618,40 @@ public class OOoBean
if ( aDocument != null )
{
try {
- aDocument.setModified(false);
+ aDocument.setModified(false);
} catch (com.sun.star.beans.PropertyVetoException ep) {
- //it dosn't make sense to throw the exception here. The interface does not
+ //it dosn't make sense to throw the exception here. The interface does not
//offer a way to add/remove respective listeners.
} catch (com.sun.star.lang.DisposedException ed) {
// can be disposed if user closed document via UI
}
-
+
com.sun.star.frame.XController xOldController = null;
if ( aFrame != null )
xOldController = aFrame.getController();
-
- try
+
+ try
{
if ( aFrame != null && xOldController != null )
if (xOldController.suspend(true) == false)
throw new com.sun.star.util.CloseVetoException(
"Dokument is still being used and cannot be closed.", this);
-
- }
- catch (java.lang.IllegalStateException exp)
+
+ }
+ catch (java.lang.IllegalStateException exp)
{}
}
-
+
// load the document.
- com.sun.star.beans.PropertyValue aArgs[] =
- addArgument( aArguments, new com.sun.star.beans.PropertyValue(
- "MacroExecutionMode", -1,
+ com.sun.star.beans.PropertyValue aArgs[] =
+ addArgument( aArguments, new com.sun.star.beans.PropertyValue(
+ "MacroExecutionMode", -1,
new Short( com.sun.star.document.MacroExecMode.USE_CONFIG ),
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 );
// nothing loaded?
@@ -669,7 +669,7 @@ public class OOoBean
// mDocumentURL = aURL; TBD: still needed?
// Get document's XModifiable interface if any.
- aDocument = new OfficeDocument(
+ aDocument = new OfficeDocument(
(com.sun.star.frame.XModel) UnoRuntime.queryInterface(
com.sun.star.frame.XModel.class, xComponent ) );
bLoaded = true;
@@ -693,9 +693,9 @@ public class OOoBean
aCallWatchThread.cancel();
if ( xServiceFactory == null )
- throw new NoConnectionException();
+ throw new NoConnectionException();
}
- if ( iConnection == null )
+ if ( iConnection == null )
{
throw new NoConnectionException();
}
@@ -703,33 +703,33 @@ public class OOoBean
applyToolVisibilities();
}
catch ( java.lang.InterruptedException aExc )
- {
+ {
throw new NoConnectionException();
}
}
/** Loads a document from a Java stream.
-
+
See loadFromURL() for further information.
*/
- public void loadFromStream(
+ public void loadFromStream(
final java.io.InputStream iInStream,
final com.sun.star.beans.PropertyValue aArguments[] )
- throws
+ throws
// @requirement FUNC.CON.LOST/0.2
NoConnectionException,
- java.io.IOException,
+ java.io.IOException,
com.sun.star.lang.IllegalArgumentException,
com.sun.star.util.CloseVetoException
{
// wrap Java stream into UNO stream
/*
- com.sun.star.io.XInputStream xStream =
+ com.sun.star.io.XInputStream xStream =
new com.sun.star.lib.uno.adapter.InputStreamToXInputStreamAdapter(
iInStream );
*/
// copy stream....
-
+
int s = 4096;
int r=0 ,n = 0;
byte[] buffer = new byte[s];
@@ -747,12 +747,12 @@ public class OOoBean
System.arraycopy(buffer, 0, newBuffer, 0, n);
buffer = newBuffer;
}
- com.sun.star.io.XInputStream xStream =
+ com.sun.star.io.XInputStream xStream =
new com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter(buffer);
-
+
// add stream to arguments
- com.sun.star.beans.PropertyValue[] aExtendedArguments =
- addArgument( aArguments, new com.sun.star.beans.PropertyValue(
+ com.sun.star.beans.PropertyValue[] aExtendedArguments =
+ addArgument( aArguments, new com.sun.star.beans.PropertyValue(
"InputStream", -1, xStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
// call normal load method
@@ -760,27 +760,27 @@ public class OOoBean
}
/** Loads a document from a byte array.
-
+
See loadFromURL() for further information.
*/
- public void loadFromByteArray(
+ public void loadFromByteArray(
final byte aInBuffer[],
final com.sun.star.beans.PropertyValue aArguments[] )
- throws
+ throws
// @requirement FUNC.CON.LOST/0.2
NoConnectionException,
- java.io.IOException,
+ java.io.IOException,
com.sun.star.lang.IllegalArgumentException,
com.sun.star.util.CloseVetoException
{
// wrap byte arrray into UNO stream
- com.sun.star.io.XInputStream xStream =
+ com.sun.star.io.XInputStream xStream =
new com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter(
aInBuffer );
-
+
// add stream to arguments
- com.sun.star.beans.PropertyValue[] aExtendedArguments =
- addArgument( aArguments, new com.sun.star.beans.PropertyValue(
+ com.sun.star.beans.PropertyValue[] aExtendedArguments =
+ addArgument( aArguments, new com.sun.star.beans.PropertyValue(
"InputStream", -1, xStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
// call normal load method
@@ -789,13 +789,13 @@ public class OOoBean
/** Stores a document to the given URL.
<p>
- 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 {@link #storeToByteArray storeToByteArray} and
- {@link #storeToStream storeToStream}. The workaround
+ 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 {@link #storeToByteArray storeToByteArray} and
+ {@link #storeToStream 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
+ 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:
<pre>
java -Dcom.sun.star.officebean.Options=-norestore ...
@@ -814,15 +814,15 @@ public class OOoBean
if no connection is established.
@throws NoDocumentException
- if no document is loaded
+ if no document is loaded
*/
- public void storeToURL(
+ public void storeToURL(
final String aURL,
final com.sun.star.beans.PropertyValue aArguments[] )
- throws
+ throws
// @requirement FUNC.CON.LOST/0.2
NoConnectionException,
- java.io.IOException,
+ java.io.IOException,
com.sun.star.lang.IllegalArgumentException,
NoDocumentException
{
@@ -833,7 +833,7 @@ public class OOoBean
try
{
// start runtime timeout
- CallWatchThread aCallWatchThread =
+ CallWatchThread aCallWatchThread =
new CallWatchThread( nOOoCallTimeOut, "storeToURL" );
// store the document
@@ -849,18 +849,18 @@ public class OOoBean
}
/** Stores a document to a stream.
-
+
See {@link #storeToURL storeToURL} for further information.
@see #storeToURL storeToURL
*/
- public java.io.OutputStream storeToStream(
+ public java.io.OutputStream storeToStream(
java.io.OutputStream aOutStream,
final com.sun.star.beans.PropertyValue aArguments[] )
- throws
+ throws
// @requirement FUNC.CON.LOST/0.2
NoConnectionException,
NoDocumentException,
- java.io.IOException,
+ java.io.IOException,
com.sun.star.lang.IllegalArgumentException
{
@@ -868,10 +868,10 @@ public class OOoBean
com.sun.star.lib.uno.adapter.OutputStreamToXOutputStreamAdapter aStream =
new com.sun.star.lib.uno.adapter.OutputStreamToXOutputStreamAdapter(
aOutStream );
-
+
// add stream to arguments
- com.sun.star.beans.PropertyValue[] aExtendedArguments =
- addArgument( aArguments, new com.sun.star.beans.PropertyValue(
+ com.sun.star.beans.PropertyValue[] aExtendedArguments =
+ addArgument( aArguments, new com.sun.star.beans.PropertyValue(
"OutputStream", -1, aStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
// call normal store method
@@ -889,28 +889,28 @@ public class OOoBean
}
/** Stores a document to a byte array.
-
+
See {@link #storeToURL storeToURL} for further information.
@see #storeToURL storeToURL
*/
- public byte[] storeToByteArray(
+ public byte[] storeToByteArray(
byte aOutBuffer[],
final com.sun.star.beans.PropertyValue aArguments[] )
- throws
+ throws
// @requirement FUNC.CON.LOST/0.2
NoConnectionException,
NoDocumentException,
- java.io.IOException,
+ java.io.IOException,
com.sun.star.lang.IllegalArgumentException
{
// wrap byte arrray into UNO stream
com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter aStream =
new com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter(
aOutBuffer );
-
+
// add stream to arguments
- com.sun.star.beans.PropertyValue[] aExtendedArguments =
- addArgument( aArguments, new com.sun.star.beans.PropertyValue(
+ com.sun.star.beans.PropertyValue[] aExtendedArguments =
+ addArgument( aArguments, new com.sun.star.beans.PropertyValue(
"OutputStream", -1, aStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
// call normal store method
@@ -929,9 +929,9 @@ public class OOoBean
// @requirement FUNC.BEAN.PROG/0.5
// @requirement API.SIM.SEAP/0.2
- /** returns the <type scope="com::sun::star::frame">Frame</a>
+ /** returns the <type scope="com::sun::star::frame">Frame</a>
of the bean.
-
+
@returns
a Java class which implements all interfaces which the service
<type scope="com::sun::star::frame">Frame</a> implements.
@@ -946,12 +946,12 @@ public class OOoBean
*/
public Frame getFrame()
- throws
+ throws
NoConnectionException // @requirement FUNC.CON.LOST/0.2
{
if ( iConnection == null )
throw new NoConnectionException();
- return aFrame;
+ return aFrame;
}
// @requirement FUNC.BEAN.PROG/0.5
@@ -983,12 +983,12 @@ public class OOoBean
// @requirement FUNC.BEAN.STOR/0.4
// @requirement FUNC.BEAN.PRNT/0.4
// @requirement API.SIM.SEAP/0.2
- /** returns the <type scope="com::sun::star::document::OfficeDocument">
+ /** returns the <type scope="com::sun::star::document::OfficeDocument">
of the bean.
@returns
a Java class which implements all interfaces which the service
- <type scope="com::sun::star::document">OfficeDocument</a>
+ <type scope="com::sun::star::document">OfficeDocument</a>
implements.
Thus, methods can be called directly without queryInterface.
This feature might be implemented by UNO or explicitely coded.
@@ -996,39 +996,39 @@ public class OOoBean
@throws NoConnectionException
if the connection is not established.
*/
- public OfficeDocument getDocument()
+ public OfficeDocument getDocument()
// @requirement FUNC.CON.LOST/0.2
throws NoConnectionException
{
if ( iConnection == null )
throw new NoConnectionException();
- return aDocument;
+ return aDocument;
}
- /** 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
- tool bars on afterwards, no matter whether all available tool
+ /** 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
+ tool bars on afterwards, no matter whether all available tool
bars are known or not.
<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,
some tool bars might not be affected by this method.
<p>
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.
-
+
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
which can be obtained from a frame, to control toolbars. For example:
<pre>
-com.sun.star.beans.XPropertySet xPropSet =
+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 xLayoutManager =
(com.sun.star.frame.XLayoutManager) UnoRuntime.queryInterface(
- com.sun.star.frame.XLayoutManager.class,
+ com.sun.star.frame.XLayoutManager.class,
xPropSet.getPropertyValue( "LayoutManager" ) );
xLayoutManager.showElement("private:resource/menubar/menubar");
</pre>
@@ -1044,10 +1044,10 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
}
//--------------------------------------------------------------------------
- /** Applies all tool visiblities to the real thing.
-
+ /** Applies all tool visiblities to the real thing.
+
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
+ which can be obtained from a frame, to control toolbars. See also
{@link #setAllBarsVisible setAllBarsVisible}.
*/
protected void applyToolVisibilities()
@@ -1062,24 +1062,24 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
bIgnoreVisibility = false;
}
- /** Helper method to set tool bar visibilty.
-
+ /** Helper method to set tool bar visibilty.
+
@param bnewValue
If false, the tool bar is disabled,
If true, the tool bar is visible.
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
+ which can be obtained from a frame, to control toolbars. See also
{@link #setAllBarsVisible}.
*/
protected boolean setToolVisible( String aProperty, String aResourceURL,
boolean bOldValue, boolean bNewValue )
-
+
throws
java.lang.InterruptedException
{
// start runtime timeout
- CallWatchThread aCallWatchThread =
+ CallWatchThread aCallWatchThread =
new CallWatchThread( nOOoCallTimeOut, "setToolVisible" );
// Does a frame exist?
@@ -1087,14 +1087,14 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
{
if ( bIgnoreVisibility || bOldValue != bNewValue )
{
- try
+ try
{
- com.sun.star.beans.XPropertySet xPropSet =
+ 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 xLayoutManager =
(com.sun.star.frame.XLayoutManager) UnoRuntime.queryInterface(
- com.sun.star.frame.XLayoutManager.class,
+ com.sun.star.frame.XLayoutManager.class,
xPropSet.getPropertyValue( "LayoutManager" ) );
if ( bNewValue )
xLayoutManager.showElement( aResourceURL );
@@ -1122,37 +1122,37 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
return bNewValue;
}
- /** Sets the visibility of the menu bar.
-
+ /** Sets the visibility of the menu bar.
+
Initially the menu bar is visible.
<p>
- If not connected or no document loaded, the value is stored
+ 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.
- @param bVisible
+ @param bVisible
If false, the menu bar is disabled,
If true, the menu bar is visible.
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
+ which can be obtained from a frame, to control toolbars. See also
{@link #setAllBarsVisible}.
*/
public void setMenuBarVisible(boolean bVisible)
{
try
{
- bMenuBarVisible = setToolVisible( "MenuBarVisible",
- "private:resource/menubar/menubar", bMenuBarVisible, bVisible );
+ bMenuBarVisible = setToolVisible( "MenuBarVisible",
+ "private:resource/menubar/menubar", bMenuBarVisible, bVisible );
}
catch ( java.lang.InterruptedException aExc )
- {
- bMenuBarVisible = bVisible;
+ {
+ bMenuBarVisible = bVisible;
}
}
/** Returns the visibility of the menu bar.
-
+
This method works independently from a connetion or loaded document.
If no connection is established or no document is loaded,
this method just returns a memorized status.
@@ -1162,7 +1162,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
false if the menu bar is hidden.
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
+ which can be obtained from a frame, to control toolbars. See also
{@link #setAllBarsVisible}.
*/
public boolean isMenuBarVisible()
@@ -1170,37 +1170,37 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
return bMenuBarVisible;
}
- /** Sets the main function bar visibilty.
-
+ /** Sets the main function bar visibilty.
+
Initially the standard bar is visible.
-
- If not connected or no document loaded, the value is stored
+
+ 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.
-
- @param bVisible
+
+ @param bVisible
If false, the main function bar is disabled,
If true, the main function bar is visible.
-
+
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
- {@link #setAllBarsVisible}.
+ which can be obtained from a frame, to control toolbars. See also
+ {@link #setAllBarsVisible}.
*/
public void setStandardBarVisible(boolean bVisible)
{
try
{
- bStandardBarVisible = setToolVisible( "StandardBarVisible",
- "private:resource/toolbar/standardbar", bStandardBarVisible, bVisible );
+ bStandardBarVisible = setToolVisible( "StandardBarVisible",
+ "private:resource/toolbar/standardbar", bStandardBarVisible, bVisible );
}
catch ( java.lang.InterruptedException aExc )
- {
- bMenuBarVisible = bVisible;
+ {
+ bMenuBarVisible = bVisible;
}
}
/** Returns the visibility of the main function bar.
-
+
This method works independently from a connetion or loaded document.
If no connection is established or no document is loaded,
this method just returns a memorized status.
@@ -1210,45 +1210,45 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
false if the main function bar is hidden.
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
- {@link #setAllBarsVisible}.
+ which can be obtained from a frame, to control toolbars. See also
+ {@link #setAllBarsVisible}.
*/
public boolean isStandardBarVisible()
{
return bStandardBarVisible;
}
- /** Sets the tool function bar visibilty.
-
+ /** Sets the tool function bar visibilty.
+
Initially the tool bar is visible.
-
- If not connected or no document loaded, the value is stored
+
+ 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.
-
- @param bVisible
+
+ @param bVisible
If false, the tool function bar is disabled,
If true, the tool function bar is visible.
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
- {@link #setAllBarsVisible}.
+ which can be obtained from a frame, to control toolbars. See also
+ {@link #setAllBarsVisible}.
*/
public void setToolBarVisible(boolean bVisible)
{
- try
+ try
{
- bToolBarVisible = setToolVisible( "ToolBarVisible",
- "private:resource/toolbar/toolbar", bToolBarVisible, bVisible );
+ bToolBarVisible = setToolVisible( "ToolBarVisible",
+ "private:resource/toolbar/toolbar", bToolBarVisible, bVisible );
}
catch ( java.lang.InterruptedException aExc )
- {
+ {
bMenuBarVisible = bVisible;
}
}
/** Returns the visibility of the tool function bar.
-
+
This method works independently from a connetion or loaded document.
If no connection is established or no document is loaded,
this method just returns a memorized status.
@@ -1258,45 +1258,45 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
false if the tool function bar is hidden.
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
- {@link #setAllBarsVisible}.
+ which can be obtained from a frame, to control toolbars. See also
+ {@link #setAllBarsVisible}.
*/
public boolean isToolBarVisible()
{
return bToolBarVisible;
}
- /** Sets the status function bar visibilty.
-
+ /** Sets the status function bar visibilty.
+
Initially the status bar is visible.
-
- If not connected or no document loaded, the value is stored
+
+ 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.
-
- @param bVisible
+
+ @param bVisible
If false, the status function bar is disabled,
If true, the status function bar is visible.
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
- {@link #setAllBarsVisible}.
+ which can be obtained from a frame, to control toolbars. See also
+ {@link #setAllBarsVisible}.
*/
public void setStatusBarVisible(boolean bVisible)
{
- try
+ try
{
- bStatusBarVisible = setToolVisible( "StatusBarVisible",
- "private:resource/statusbar/statusbar", bStatusBarVisible, bVisible );
+ bStatusBarVisible = setToolVisible( "StatusBarVisible",
+ "private:resource/statusbar/statusbar", bStatusBarVisible, bVisible );
}
catch ( java.lang.InterruptedException aExc )
- {
- bMenuBarVisible = bVisible;
+ {
+ bMenuBarVisible = bVisible;
}
}
- /** 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.
If no connection is established or no document is loaded,
this method just returns a memorized status.
@@ -1306,8 +1306,8 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
false if the status function bar is hidden.
@deprecated Clients should use the service com.sun.star.frame.LayoutManager,
- which can be obtained from a frame, to control toolbars. See also
- {@link #setAllBarsVisible}.
+ which can be obtained from a frame, to control toolbars. See also
+ {@link #setAllBarsVisible}.
*/
public boolean isStatusBarVisible()
{
@@ -1317,14 +1317,14 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
//===========================================================================
// Helper Methods / Internal Methods
//---------------------------------------------------------------------------
-
+
// general instance intializer
{
setLayout(new java.awt.BorderLayout());
}
-
+
/**
- @deprecated
+ @deprecated
*/
public void paint( java.awt.Graphics aGraphics )
{
@@ -1339,7 +1339,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
a new array is created, aArgument added and the new
array returned.
*/
- protected com.sun.star.beans.PropertyValue[] addArgument(
+ protected com.sun.star.beans.PropertyValue[] addArgument(
com.sun.star.beans.PropertyValue aArguments[],
final com.sun.star.beans.PropertyValue aArgument )
{
@@ -1362,7 +1362,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
}
// create extended arguments
- com.sun.star.beans.PropertyValue[] aExtendedArguments =
+ com.sun.star.beans.PropertyValue[] aExtendedArguments =
new com.sun.star.beans.PropertyValue[ nNumArgs + 1 ];
// copy current arguments
@@ -1379,19 +1379,19 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
//===========================================================================
// Helper Classes
//---------------------------------------------------------------------------
-
+
/** Helper class to listen on the connection to learn when it dies.
-
+
@internal
*/
- private class EventListener
+ private class EventListener
extends Thread
- implements
+ implements
com.sun.star.lang.XEventListener,
com.sun.star.frame.XTerminateListener
{
String aTag;
-
+
EventListener( String aTag )
throws NoConnectionException
{
@@ -1431,11 +1431,11 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
public void disposing( /*IN*/ com.sun.star.lang.EventObject Source )
{
// empty the OOoBean and cut the connection
- stopOOoConnection();
+ stopOOoConnection();
}
/// gets called when the user wants to terminate OOo
- public void queryTermination( /*IN*/ com.sun.star.lang.EventObject Event )
+ public void queryTermination( /*IN*/ com.sun.star.lang.EventObject Event )
throws com.sun.star.frame.TerminationVetoException
{
// disallow termination of OOo while a OOoBean exists
@@ -1446,32 +1446,32 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
public void notifyTermination( /*IN*/ com.sun.star.lang.EventObject Event )
{
// empty the OOoBean and cut the connection
- stopOOoConnection();
+ stopOOoConnection();
}
- /// watching the connection
+ /// watching the connection
public void run()
{
dbgPrint( "EventListener(" + aTag + ").run()" );
// remote call might hang => watch try
- CallWatchThread aCallWatchThread =
+ CallWatchThread aCallWatchThread =
new CallWatchThread( nOOoCallTimeOut, "EventListener(" + aTag + ")" );
// continue to trying to connect the OOo instance
long n = 0;
- while ( isInterrupted() == false
- && iConnection != null
+ while ( isInterrupted() == false
+ && iConnection != null
&& iConnection.getComponentContext() != null )
{
dbgPrint( "EventListener(" + aTag + ").running() #" + ++n );
// still alive?
com.sun.star.lang.XMultiComponentFactory xServiceManager = null;
- try
- {
+ try
+ {
// an arbitrary (but cheap) call into OOo
- xServiceManager = iConnection.getComponentContext().getServiceManager();
+ xServiceManager = iConnection.getComponentContext().getServiceManager();
// call successfully performed, restart watch for next loop
try
@@ -1492,8 +1492,8 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
}
// sleep
- try {
- sleep(nOOoCheckCycle);
+ try {
+ sleep(nOOoCheckCycle);
}
catch ( java.lang.InterruptedException aExc )
{
diff --git a/bean/com/sun/star/comp/beans/OfficeConnection.java b/bean/com/sun/star/comp/beans/OfficeConnection.java
index 9087b34fae47..85f480b9d621 100644
--- a/bean/com/sun/star/comp/beans/OfficeConnection.java
+++ b/bean/com/sun/star/comp/beans/OfficeConnection.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,7 +33,7 @@ import com.sun.star.lang.XComponent;
import com.sun.star.uno.XComponentContext;
/**
- * This abstract class reprecents a connection to the office
+ * This abstract class reprecents a connection to the office
* application.
@deprecated
@@ -52,14 +52,14 @@ public interface OfficeConnection
/**
* Sets an AWT container catory.
*
- * @param containerFactory This is a application provided AWT container
- * factory.
+ * @param containerFactory This is a application provided AWT container
+ * factory.
*/
void setContainerFactory(ContainerFactory containerFactory);
/**
* Retrives 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.
*
* @return The office UNO component context.
@@ -68,9 +68,9 @@ public interface OfficeConnection
/**
* Creates an office window.
- * The window is either a sub-class of java.awt.Canvas (local) or
- * java.awt.Container (RVP).
- *
+ * The window is either a sub-class of java.awt.Canvas (local) or
+ * java.awt.Container (RVP).
+ *
* This method does not add add the office window to its container.
*
* @param container This is an AWT container.
diff --git a/bean/com/sun/star/comp/beans/OfficeDocument.java b/bean/com/sun/star/comp/beans/OfficeDocument.java
index 8e3a970bd03c..41676d1fdb10 100644
--- a/bean/com/sun/star/comp/beans/OfficeDocument.java
+++ b/bean/com/sun/star/comp/beans/OfficeDocument.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,7 +30,7 @@ package com.sun.star.comp.beans;
import com.sun.star.uno.UnoRuntime;
//==========================================================================
-/** Wrapper class for service OfficeDocument which emulates the upcoming
+/** Wrapper class for service OfficeDocument which emulates the upcoming
mode of automatic runtime Java classes to get rid of the need for
queryInterface.
@@ -40,7 +40,7 @@ import com.sun.star.uno.UnoRuntime;
@since OOo 2.0.0
*/
public class OfficeDocument extends Wrapper
- implements
+ implements
com.sun.star.frame.XModel,
com.sun.star.util.XModifiable,
com.sun.star.frame.XStorable,
@@ -57,13 +57,13 @@ public class OfficeDocument extends Wrapper
this.xModel = xModel;
this.xModifiable = (com.sun.star.util.XModifiable)
- UnoRuntime.queryInterface(
+ UnoRuntime.queryInterface(
com.sun.star.util.XModifiable.class, xModel );
this.xPrintable = (com.sun.star.view.XPrintable)
- UnoRuntime.queryInterface(
+ UnoRuntime.queryInterface(
com.sun.star.view.XPrintable.class, xModel );
this.xStorable = (com.sun.star.frame.XStorable)
- UnoRuntime.queryInterface(
+ UnoRuntime.queryInterface(
com.sun.star.frame.XStorable.class, xModel );
}
@@ -71,7 +71,7 @@ public class OfficeDocument extends Wrapper
// com.sun.star.frame.XModel
//----------------------------------------------------------
- public boolean attachResource( /*IN*/String aURL,
+ public boolean attachResource( /*IN*/String aURL,
/*IN*/com.sun.star.beans.PropertyValue[] aArguments )
{
return xModel.attachResource( aURL, aArguments );
@@ -87,13 +87,13 @@ public class OfficeDocument extends Wrapper
return xModel.getArgs();
}
- public void connectController(
+ public void connectController(
/*IN*/ com.sun.star.frame.XController xController )
{
xModel.connectController( xController );
}
- public void disconnectController(
+ public void disconnectController(
/*IN*/ com.sun.star.frame.XController xController )
{
xModel.disconnectController( xController );
@@ -119,8 +119,8 @@ public class OfficeDocument extends Wrapper
return xModel.getCurrentController();
}
- public void setCurrentController(
- /*IN*/ com.sun.star.frame.XController xController )
+ public void setCurrentController(
+ /*IN*/ com.sun.star.frame.XController xController )
throws com.sun.star.container.NoSuchElementException
{
xModel.setCurrentController( xController );
@@ -156,7 +156,7 @@ public class OfficeDocument extends Wrapper
return xModifiable.isModified();
}
- public void setModified( /*IN*/boolean bModified )
+ public void setModified( /*IN*/boolean bModified )
throws com.sun.star.beans.PropertyVetoException
{
xModifiable.setModified( bModified );
@@ -171,13 +171,13 @@ public class OfficeDocument extends Wrapper
return xPrintable.getPrinter();
}
- public void setPrinter( /*IN*/ com.sun.star.beans.PropertyValue[] aPrinter )
+ public void setPrinter( /*IN*/ com.sun.star.beans.PropertyValue[] aPrinter )
throws com.sun.star.lang.IllegalArgumentException
{
xPrintable.setPrinter( aPrinter );
}
- public void print( /*IN*/ com.sun.star.beans.PropertyValue[] xOptions )
+ public void print( /*IN*/ com.sun.star.beans.PropertyValue[] xOptions )
throws com.sun.star.lang.IllegalArgumentException
{
xPrintable.print( xOptions );
@@ -202,19 +202,19 @@ public class OfficeDocument extends Wrapper
return xStorable.isReadonly();
}
- public void store( )
+ public void store( )
throws com.sun.star.io.IOException
{
xStorable.store();
}
- public void storeAsURL( /*IN*/ String aURL, /*IN*/ com.sun.star.beans.PropertyValue[] aArguments )
+ public void storeAsURL( /*IN*/ String aURL, /*IN*/ com.sun.star.beans.PropertyValue[] aArguments )
throws com.sun.star.io.IOException
{
xStorable.storeAsURL( aURL, aArguments );
}
- public void storeToURL( /*IN*/ String aURL, /*IN*/ com.sun.star.beans.PropertyValue[] aArguments )
+ public void storeToURL( /*IN*/ String aURL, /*IN*/ com.sun.star.beans.PropertyValue[] aArguments )
throws com.sun.star.io.IOException
{
xStorable.storeToURL( aURL, aArguments );
diff --git a/bean/com/sun/star/comp/beans/OfficeWindow.java b/bean/com/sun/star/comp/beans/OfficeWindow.java
index 0b755ce58cc0..455fe66ca59b 100644
--- a/bean/com/sun/star/comp/beans/OfficeWindow.java
+++ b/bean/com/sun/star/comp/beans/OfficeWindow.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,8 +32,8 @@ import java.awt.Component;
import com.sun.star.awt.XWindowPeer;
/**
- * The concreate implementation of the OfficeWindow extends an
- * approperate type of visual component (java.awt.Canvas for local
+ * The concreate implementation of the OfficeWindow extends an
+ * approperate type of visual component (java.awt.Canvas for local
* and java.awt.Container for remote).
@deprecated
diff --git a/bean/com/sun/star/comp/beans/SystemWindowException.java b/bean/com/sun/star/comp/beans/SystemWindowException.java
index 2742eac8c837..3748418a8842 100644
--- a/bean/com/sun/star/comp/beans/SystemWindowException.java
+++ b/bean/com/sun/star/comp/beans/SystemWindowException.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -27,7 +27,7 @@
package com.sun.star.comp.beans;
-/** indicates that an operation needed a system window,
+/** indicates that an operation needed a system window,
but no system window was aquired yet.
@see com.sun.star.comp.beans.OOoBean.aquireSystemWindow
diff --git a/bean/com/sun/star/comp/beans/Wrapper.java b/bean/com/sun/star/comp/beans/Wrapper.java
index b5b259752e5f..824a81266b61 100644
--- a/bean/com/sun/star/comp/beans/Wrapper.java
+++ b/bean/com/sun/star/comp/beans/Wrapper.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,23 +30,23 @@ package com.sun.star.comp.beans;
import com.sun.star.uno.UnoRuntime;
//==========================================================================
-/** Wrapper base class for UNO services which emulates the upcoming
+/** Wrapper base class for UNO services which emulates the upcoming
mode of automatic runtime Java classes to get rid of the need for
queryInterface.
Because its not worth the efford to create a runtime generated wrapper
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
- from a subclass. But for non optional interfaces you can already
+ from a subclass. But for non optional interfaces you can already
directly call their methods.
This wrapper will only work for UNO objects via a bridge, not for
- direct Java objects.
+ direct Java objects.
@since OOo 2.0.0
*/
class Wrapper
- implements
+ implements
com.sun.star.lib.uno.Proxy,
// see the comment in com.sun.star.lib.uno.bridges.java_remote
// .java_remote_bridge.mapInterfaceTo for the consequences of this
@@ -61,25 +61,25 @@ class Wrapper
{
xQueryInterface = (com.sun.star.uno.IQueryInterface) xProxy;
xComponent = (com.sun.star.lang.XComponent)
- UnoRuntime.queryInterface(
+ UnoRuntime.queryInterface(
com.sun.star.lang.XComponent.class, xProxy );
}
//==============================================================
// com.sun.star.uno.IQueryInterface
//--------------------------------------------------------------
-
- public String getOid()
+
+ public String getOid()
{
return xQueryInterface.getOid();
}
- public boolean isSame( Object aObject )
+ public boolean isSame( Object aObject )
{
return xQueryInterface.isSame( aObject );
}
- 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 );
@@ -88,7 +88,7 @@ class Wrapper
//==============================================================
// com.sun.star.lang.XComponent
//--------------------------------------------------------------
-
+
public void dispose( )
{
xComponent.dispose();
diff --git a/bean/native/unix/com_sun_star_beans_LocalOfficeWindow.c b/bean/native/unix/com_sun_star_beans_LocalOfficeWindow.c
index 944c9ff5a38f..3e8e736463d3 100644
--- a/bean/native/unix/com_sun_star_beans_LocalOfficeWindow.c
+++ b/bean/native/unix/com_sun_star_beans_LocalOfficeWindow.c
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -68,8 +68,8 @@ JNIEXPORT jlong JNICALL Java_com_sun_star_comp_beans_LocalOfficeWindow_getNative
JNIEXPORT jint JNICALL Java_com_sun_star_beans_LocalOfficeWindow_getNativeWindowSystemType
(JNIEnv * env, jobject obj_this)
{
- (void) env; /* avoid warning about unused parameter */
- (void) obj_this; /* avoid warning about unused parameter */
+ (void) env; /* avoid warning about unused parameter */
+ (void) obj_this; /* avoid warning about unused parameter */
return (SYSTEM_XWINDOW);
}
@@ -83,8 +83,8 @@ JNIEXPORT jint JNICALL Java_com_sun_star_beans_LocalOfficeWindow_getNativeWindow
JNIEXPORT jlong JNICALL Java_com_sun_star_beans_LocalOfficeWindow_getNativeWindow
(JNIEnv * env, jobject obj_this)
{
- (void) env; /* avoid warning about unused parameter */
- (void) obj_this; /* avoid warning about unused parameter */
+ (void) env; /* avoid warning about unused parameter */
+ (void) obj_this; /* avoid warning about unused parameter */
return Java_com_sun_star_comp_beans_LocalOfficeWindow_getNativeWindow(env, obj_this);
}
diff --git a/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c b/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c
index fc20f39283df..8badd673e722 100644
--- a/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c
+++ b/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -75,8 +75,8 @@ static void ThrowException(JNIEnv * env, char const * type, char const * msg) {
JNIEXPORT jint JNICALL Java_com_sun_star_comp_beans_LocalOfficeWindow_getNativeWindowSystemType
(JNIEnv * env, jobject obj_this)
{
- (void) env; /* avoid warning about unused parameter */
- (void) obj_this; /* avoid warning about unused parameter */
+ (void) env; /* avoid warning about unused parameter */
+ (void) obj_this; /* avoid warning about unused parameter */
return (SYSTEM_XWINDOW);
}
@@ -106,23 +106,23 @@ JNIEXPORT jlong JNICALL Java_com_sun_star_comp_beans_LocalOfficeWindow_getNative
result = JAWT_GetAWT(env, &awt);
if (result == JNI_FALSE)
ThrowException(env, "java/lang/RuntimeException", "JAWT_GetAWT failed");
-
+
/* Get the drawing surface */
if ((ds = awt.GetDrawingSurface(env, obj_this)) == NULL)
return 0L;
-
+
/* Lock the drawing surface */
lock = ds->Lock(ds);
if ( (lock & JAWT_LOCK_ERROR) != 0)
ThrowException(env, "java/lang/RuntimeException",
"Could not get AWT drawing surface.");
-
+
/* Get the drawing surface info */
dsi = ds->GetDrawingSurfaceInfo(ds);
/* Get the platform-specific drawing info */
dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo;
-
+
drawable = dsi_x11->drawable;
display = dsi_x11->display;
diff --git a/bean/native/win32/com_sun_star_beans_LocalOfficeWindow.c b/bean/native/win32/com_sun_star_beans_LocalOfficeWindow.c
index f7f86d8973b3..65f40b2fddce 100644
--- a/bean/native/win32/com_sun_star_beans_LocalOfficeWindow.c
+++ b/bean/native/win32/com_sun_star_beans_LocalOfficeWindow.c
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c b/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c
index c1be77fc2ba0..e09cadec76d0 100644
--- a/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c
+++ b/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/bean/qa/complex/OOoBeanTest.java b/bean/qa/complex/OOoBeanTest.java
index 2d038e8b37af..791c3abaa5f5 100644
--- a/bean/qa/complex/OOoBeanTest.java
+++ b/bean/qa/complex/OOoBeanTest.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -53,7 +53,7 @@ import java.awt.*;
public class OOoBeanTest extends ComplexTestCase
{
-
+
public String[] getTestMethodNames()
{
// TODO think about trigger of sub-tests from outside
@@ -89,7 +89,7 @@ public class OOoBeanTest extends ComplexTestCase
{
boolean ret = false;
String os = System.getProperty("os.name");
- if (os != null)
+ if (os != null)
{
os = os.trim();
if (os.indexOf("Win") == 0)
@@ -131,7 +131,7 @@ public class OOoBeanTest extends ComplexTestCase
/** Sizing, painting
*/
- public void test2() throws Exception
+ public void test2() throws Exception
{
WriterFrame f = null;
ScreenComparer capturer = null;
@@ -178,7 +178,7 @@ public class OOoBeanTest extends ComplexTestCase
f.setExtendedState(Frame.NORMAL);
Thread.sleep(getSleepTime(200));
if (f.checkUnoFramePosition() == false)
- failed("Sizing error: Frame set from maximized to normal.", true);
+ failed("Sizing error: Frame set from maximized to normal.", true);
capturer.grabTwo(f.getClientArea());
if (capturer.compare() == false)
{
@@ -195,14 +195,14 @@ public class OOoBeanTest extends ComplexTestCase
Thread.sleep(getSleepTime(200));
if (f.checkUnoFramePosition() == false)
failed("Sizing error: Frame moved.", true);
-
+
capturer.grabTwo(f.getClientArea());
if (capturer.compare() == false)
{
failed("Painting error: Move frame to a different position.", true);
capturer.writeImages();
}
-
+
//move Window down
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
int maxY = dim.height - f.getBounds().height;
@@ -225,7 +225,7 @@ public class OOoBeanTest extends ComplexTestCase
}
//obscure the window and make it visible again
-
+
oldPosition = f.getBounds();
Rectangle pos = new Rectangle(oldPosition.x - 50, oldPosition.y - 50,
@@ -276,7 +276,7 @@ public class OOoBeanTest extends ComplexTestCase
f = new WriterFrame(100, 100, 500, 300, true);
if (f.checkUnoFramePosition() == false)
failed("Sizing error.", true);
-
+
}
finally
{
@@ -332,7 +332,7 @@ public class OOoBeanTest extends ComplexTestCase
f.removeOOoBean();
f.addOOoBean();
}
-
+
f.goToStart();
f.pageDown();
Thread.sleep(getSleepTime(200));
@@ -344,7 +344,7 @@ public class OOoBeanTest extends ComplexTestCase
"repeatedly to java.lang.Frame.", true);
capturer.writeImages();
}
-
+
if (f.checkUnoFramePosition() == false)
failed("Sizing error.", true);
@@ -359,7 +359,7 @@ public class OOoBeanTest extends ComplexTestCase
}
- /** Test focus (i49454). After repeatedly adding and removing the bean to a window
+ /** Test focus (i49454). After repeatedly adding and removing the bean to a window
* it should still be possible to enter text in the window. This does not
* work all the time on Windows. This is probably a timing problem. When using
* Thread.sleep (position #1) then it should work.
@@ -380,7 +380,7 @@ public class OOoBeanTest extends ComplexTestCase
bean.loadFromURL("private:factory/swriter", null);
// #1
Thread.sleep(1000);
-
+
StringBuffer buf = new StringBuffer(1000);
for (int i = 0; i < 1; i++)
{
@@ -393,7 +393,7 @@ public class OOoBeanTest extends ComplexTestCase
bean.aquireSystemWindow();
// frame.validate();
}
-
+
if (isWindows() == false)
Thread.sleep(5000);
@@ -401,7 +401,7 @@ public class OOoBeanTest extends ComplexTestCase
roby.keyPress(KeyEvent.VK_H);
roby.keyRelease(KeyEvent.VK_H);
buf.append("h");
-
+
String s = getText(bean);
if ( ! s.equals(buf.toString()))
{
@@ -416,12 +416,12 @@ public class OOoBeanTest extends ComplexTestCase
{
Thread.sleep(2000);
}
-
+
} finally {
bean.stopOOoConnection();
frame.dispose();
}
- }
+ }
}
/** Tests focus problem just like test6, but the implementation is a little
@@ -448,7 +448,7 @@ public class OOoBeanTest extends ComplexTestCase
Thread.sleep(1000);
StringBuffer buf = new StringBuffer(1000);
int i = 0;
-
+
for (; i < 1; i++)
{
EventQueue q = Toolkit.getDefaultToolkit().getSystemEventQueue();
@@ -456,14 +456,14 @@ public class OOoBeanTest extends ComplexTestCase
public void run() {
try {
- bean.releaseSystemWindow();
+ bean.releaseSystemWindow();
frame.remove(bean);
frame.validate();
} catch (Exception e) {
e.printStackTrace();
}
-
+
}
});
// #2
@@ -480,11 +480,11 @@ public class OOoBeanTest extends ComplexTestCase
}
}
});
-
+
// #3
Thread.sleep(1000);
}
-
+
if (isWindows() == false)
Thread.sleep(5000);
@@ -501,7 +501,7 @@ public class OOoBeanTest extends ComplexTestCase
roby.waitForIdle();
buf.append("h");
- Thread.sleep(1000);
+ Thread.sleep(1000);
String s = getText(bean);
System.out.println(" getText: " + s);
if ( ! s.equals(buf.toString()))
@@ -516,7 +516,7 @@ public class OOoBeanTest extends ComplexTestCase
roby.waitForIdle();
String sH = "h";
- Thread.sleep(1000);
+ Thread.sleep(1000);
String s2 = getText(bean);
if ( ! sH.equals(s2))
@@ -534,7 +534,7 @@ public class OOoBeanTest extends ComplexTestCase
{
// Thread.sleep(2000);
}
-
+
} finally {
bean.stopOOoConnection();
frame.dispose();
@@ -597,7 +597,7 @@ public class OOoBeanTest extends ComplexTestCase
c.gridx = 0;
c.gridy = 0;
f.add(bp1, c);
-
+
c.gridx = 1;
c.insets = new Insets(0, 0, 0, 0);
f.add(bp2, c);
diff --git a/bean/qa/complex/ScreenComparer.java b/bean/qa/complex/ScreenComparer.java
index a2547a763c58..c169c45f4998 100644
--- a/bean/qa/complex/ScreenComparer.java
+++ b/bean/qa/complex/ScreenComparer.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -83,7 +83,7 @@ class ScreenComparer
{
grabOne(m_rect);
}
-
+
public void grabOne(Rectangle r) throws Exception
{
java.awt.Robot robot = new java.awt.Robot();
@@ -94,7 +94,7 @@ class ScreenComparer
{
grabTwo(m_rect);
}
-
+
public void grabTwo(Rectangle r) throws Exception
{
java.awt.Robot robot = new java.awt.Robot();
@@ -130,7 +130,7 @@ class ScreenComparer
pixel1 = m_img1.getRGB(x, y);
else
bOutOfRange = true;
-
+
if (x < w2 && y < h2)
pixel2 = m_img2.getRGB(x, y);
else
@@ -140,7 +140,7 @@ class ScreenComparer
m_imgDiff.setRGB(x, y, m_diffColor);
else
m_imgDiff.setRGB(x, y, pixel1);
-
+
}
}
return false;
@@ -179,7 +179,7 @@ class ScreenComparer
if (pixels1[offset] != pixels2[offset])
{
ret = ret && false;
- m_imgDiff.setRGB(x, y, m_diffColor);
+ m_imgDiff.setRGB(x, y, m_diffColor);
}
else
{
@@ -193,7 +193,7 @@ class ScreenComparer
/** Writes Images to a location. The
* directory is determined by the java property OOoBean.Images
- *
+ *
*/
public void writeImages() throws Exception
{
@@ -228,6 +228,6 @@ class ScreenComparer
System.out.println("Diff image: " + file1.getPath() + "\n");
}
}
-
+
}
diff --git a/bean/qa/complex/WriterFrame.java b/bean/qa/complex/WriterFrame.java
index b2aff726ad05..370662929868 100644
--- a/bean/qa/complex/WriterFrame.java
+++ b/bean/qa/complex/WriterFrame.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -73,7 +73,7 @@ class WriterFrame extends java.awt.Frame
m_bean.aquireSystemWindow();
}
}
-
+
public WriterFrame() throws Exception
{
this(0, 0, 800, 400, false);
@@ -88,7 +88,7 @@ class WriterFrame extends java.awt.Frame
com.sun.star.text.XText xText = myDoc.getText();
com.sun.star.text.XTextCursor xTCursor = xText.createTextCursor();
//inserting some Text
- xText.insertString( xTCursor, s, false );
+ xText.insertString( xTCursor, s, false );
}
public String getText() throws Exception
@@ -128,7 +128,7 @@ class WriterFrame extends java.awt.Frame
xTViewCursor.gotoStart(false);
}
-
+
public void pageDown() throws Exception
{
com.sun.star.frame.XModel xModel = (com.sun.star.frame.XModel)m_bean.getDocument();
@@ -146,7 +146,7 @@ class WriterFrame extends java.awt.Frame
public Rectangle getClientArea()
{
-
+
Insets i = getInsets();
Rectangle r = getBounds();
Rectangle rc = new Rectangle(r.x + i.left, r.y + i.top,
@@ -204,6 +204,6 @@ class WriterFrame extends java.awt.Frame
m_bean.aquireSystemWindow();
validate();
}
-
+
}
diff --git a/bean/test/Test.java b/bean/test/Test.java
index 04f3a42132f9..84578f9f7599 100644
--- a/bean/test/Test.java
+++ b/bean/test/Test.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -55,7 +55,7 @@ public class Test
public void windowClosing( java.awt.event.WindowEvent e){
b.stopOOoConnection();
System.exit(0);
-
+
}});
}
catch (Exception e)
diff --git a/bean/test/applet/oooapplet/OOoViewer.java b/bean/test/applet/oooapplet/OOoViewer.java
index c7c96b6a0ab8..8139b9ffa352 100644
--- a/bean/test/applet/oooapplet/OOoViewer.java
+++ b/bean/test/applet/oooapplet/OOoViewer.java
@@ -1,7 +1,7 @@
//*************************************************************************
//
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,9 +42,9 @@ public class OOoViewer extends Applet {
private OOoBean oBean;
static private CustomURLClassLoader m_loader;
-
+
Object m_objBean;
-
+
public void init() {
try {
if (m_loader == null) {
@@ -88,7 +88,7 @@ public class OOoViewer extends Applet {
Method methLoad = beanClass.getMethod(
"loadFromURL", new Class[] {
String.class, arProp.getClass() });
-
+
methLoad.invoke(m_objBean, new Object[] {"private:factory/swriter", null});
} catch (ClassNotFoundException e) {
e.printStackTrace();
@@ -102,9 +102,9 @@ public class OOoViewer extends Applet {
e.printStackTrace();
} catch (java.lang.NoSuchMethodException e) {
e.printStackTrace(); }
-
-
-
+
+
+
validate();
}
@@ -135,11 +135,11 @@ public class OOoViewer extends Applet {
final class CustomURLClassLoader extends URLClassLoader {
private Vector resourcePaths;
-
+
public CustomURLClassLoader( URL[] urls ) {
super( urls );
}
-
+
protected Class findClass( String name ) throws ClassNotFoundException {
// This is only called via this.loadClass -> super.loadClass ->
// this.findClass, after this.loadClass has already called
@@ -149,10 +149,10 @@ final class CustomURLClassLoader extends URLClassLoader {
}
-
+
protected Class loadClass( String name, boolean resolve )
throws ClassNotFoundException
- {
+ {
Class c = findLoadedClass( name );
if ( c == null ) {
try {
@@ -179,12 +179,12 @@ final class CustomURLClassLoader extends URLClassLoader {
public URL getResource(String name) {
if (resourcePaths == null) return null;
-
+
URL result = super.getResource(name);
if (result != null) {
return result;
}
-
+
URL u = null;
URI uri = null;
for (Enumeration e = resourcePaths.elements(); e.hasMoreElements();) {