summaryrefslogtreecommitdiff
path: root/jut
diff options
context:
space:
mode:
authorKay Ramme <kr@openoffice.org>2000-09-29 08:40:25 +0000
committerKay Ramme <kr@openoffice.org>2000-09-29 08:40:25 +0000
commit77762a0acaf6db730c051d8a518c5f296927be46 (patch)
treee0d6ea1f354fade053f571aec1d24be2d4604511 /jut
parent832e2e75796a6f0b3bace29646f654be636a4ba7 (diff)
the -smgr takes a komma separated list of XSingle-, XMultiServiceFactory(s)
Diffstat (limited to 'jut')
-rw-r--r--jut/com/sun/star/tools/uno/UnoApp.java45
1 files changed, 37 insertions, 8 deletions
diff --git a/jut/com/sun/star/tools/uno/UnoApp.java b/jut/com/sun/star/tools/uno/UnoApp.java
index fd2676641ab7..c31cad39f262 100644
--- a/jut/com/sun/star/tools/uno/UnoApp.java
+++ b/jut/com/sun/star/tools/uno/UnoApp.java
@@ -2,9 +2,9 @@
*
* $RCSfile: UnoApp.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: kr $ $Date: 2000-09-28 17:10:02 $
+ * last change: $Author: kr $ $Date: 2000-09-29 09:40:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,6 +100,8 @@ import com.sun.star.uno.Type;
* <p>
*/
public class UnoApp {
+ static public final boolean DEBUG = true;
+
/**
* Bootstraps a servicemanager with some base components registered.
* <p>
@@ -436,6 +438,8 @@ public class UnoApp {
}
void set(UnoApp unoApp, String args[], int index[]) throws Exception {
+ if(DEBUG) System.err.println("##### " + getClass().getName() + ".set:" + args[0]);
+
unoApp._context = args[index[0] ++];
unoApp._creator = this;
}
@@ -516,19 +520,27 @@ public class UnoApp {
void set(UnoApp unoApp, String args[], int index[]) throws Exception {
String arg = args[index[0] ++];
- if(arg.charAt(0) == '"')
- arg = arg.substring(0, arg.length() - 1).substring(1);
+ if(DEBUG) System.err.println("##### " + getClass().getName() + ".set:" + arg);
- String comps[] = parseString(arg);
+ Vector comps = new Vector();
+ int idx = arg.indexOf(',');
+ while(idx != -1) {
+ comps.addElement(arg.substring(0, idx));
+ arg = arg.substring(idx + 1);
+
+ idx = arg.indexOf(',');
+ }
+ comps.addElement(arg);
XMultiServiceFactory xMultiServiceFactory = unoApp._xMultiServiceFactory;
// now use the XSet interface at the ServiceManager to add the factory of the loader
XSet xSet = (XSet) UnoRuntime.queryInterface(XSet.class, xMultiServiceFactory);
- for(int i = 0; i < comps.length; ++ i) {
- Object object = new UnoApp(comps[i]).getObject();
+ for(int i = 0; i < comps.size(); ++ i) {
+ Object object = new UnoApp((String)comps.elementAt(i)).getObject();
+
XSingleServiceFactory xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
object);
if(xSingleServiceFactory == null) {
@@ -614,6 +626,7 @@ public class UnoApp {
String arg = mergeString(args);
UnoApp unoApp = new UnoApp(arg);
+// UnoApp unoApp = new UnoApp(args);
if(unoApp._uno_url != null) // see, if we have to export the object
export(unoApp._xMultiServiceFactory, unoApp._uno_url, unoApp.getObject());
@@ -630,7 +643,7 @@ public class UnoApp {
/**
* Initializes <code>UnoApp</code>.
- * If string only is one word and the does not start with "-"
+ * If string only is one word and the word does not start with "-"
* set the context with string.
* <p>
* @param string the arguments
@@ -647,6 +660,22 @@ public class UnoApp {
}
/**
+ * Initializes <code>UnoApp</code>.
+ * If args contains only one word and the word does not start with "-"
+ * set the context with string.
+ * <p>
+ * @param string the arguments
+ */
+ UnoApp(String args[]) throws Exception {
+ _xMultiServiceFactory = createSimpleServiceManager();
+
+ if(args.length == 1 && args[0].charAt(0) != '-')
+ _context = args[0];
+ else
+ parseArgs(args);
+ }
+
+ /**
* Interprets the args as a sequence of option names
* followed by option parameters.
* <p>