diff options
Diffstat (limited to 'kdejava/koala/test/dcop')
-rw-r--r-- | kdejava/koala/test/dcop/JavaDCOPObject.java | 45 | ||||
-rw-r--r-- | kdejava/koala/test/dcop/README | 28 | ||||
-rw-r--r-- | kdejava/koala/test/dcop/Test.java | 30 |
3 files changed, 0 insertions, 103 deletions
diff --git a/kdejava/koala/test/dcop/JavaDCOPObject.java b/kdejava/koala/test/dcop/JavaDCOPObject.java deleted file mode 100644 index babb1056..00000000 --- a/kdejava/koala/test/dcop/JavaDCOPObject.java +++ /dev/null @@ -1,45 +0,0 @@ -import org.kde.koala.*; -import org.kde.qt.*; -import java.util.*; -import java.io.*; - -public class JavaDCOPObject extends DCOPObject{ - public JavaDCOPObject(){ - super("JavaDCOPObject"); - } - public ArrayList functions(){ - ArrayList operations = new ArrayList(); - operations.add("TQString myOperation()"); - return operations; - } - public ArrayList interfaces(){ - ArrayList list = new ArrayList(); - list.add("JavaDCOPObject"); - return list; - } - public DCOPAnswer javaProcess( String fun, byte[] data){ - DCOPAnswer answer = new DCOPAnswer(); - try{ - if("myOperation()".equals(fun)){ - answer.setReplyType("TQString"); - answer.setSucces(true); - - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - DataOutputStream os = new DataOutputStream(stream); - Marchaller.write_QString(os, this.myOperation()); - answer.setReplyData(stream.toByteArray()); - return answer; - } else{ - return answer; - } - }catch(IOException ioe){ - ioe.printStackTrace(); - return answer; - } - } - - public String myOperation(){ - return "test from Java"; - } - -} diff --git a/kdejava/koala/test/dcop/README b/kdejava/koala/test/dcop/README deleted file mode 100644 index 1fb7fac7..00000000 --- a/kdejava/koala/test/dcop/README +++ /dev/null @@ -1,28 +0,0 @@ -This directory contains a test for using a DCOPObject written Java. - -The java DCOP object is in JavaDCOPObject.java -The test app is in Test.java - - -To test it, you should do the following: - -set your CLASSPATH (qtjava.jar & koala.jar) -set your LD_LIBRARY_PATH (${TDEDIR}/lib - -compile it (javac *.java) -$javac *.java - -run it -$java Test - -open kdcop and look voor a program called "JavaTest" -open it and the JavaDCOPObjet appears. The JavaDCOPObject contains one -operation called myOperation. If you select it and run it, you should see 'test from Java' - -You can quit the java program by calling quit() on the application dcop object! (or just hit ctrl-c) - - -Note that the JavaDCOPObject implements javaProcess(), interfaces() and functions(). -These should be generated, but for the timebeing this is done manually. - - diff --git a/kdejava/koala/test/dcop/Test.java b/kdejava/koala/test/dcop/Test.java deleted file mode 100644 index 3e6a087a..00000000 --- a/kdejava/koala/test/dcop/Test.java +++ /dev/null @@ -1,30 +0,0 @@ -import org.kde.qt.*; -import org.kde.koala.*; - -public class Test{ - static String description = "DCOP test application for Java"; - - - /** - * test the DCOP stuff. - * - * This test doesn't simply construct a DCOPClient, because - * dcop needs the eventloop (app.exec()) - */ - public static void main(String[] argv){ - TDEAboutData aboutData = new TDEAboutData( "test", "Test", - "0.1", description, TDEAboutData.License_GPL, - "(C) 2002 Gert-Jan van der Heiden"); - TDECmdLineArgs.init( argv, aboutData ); - - TDEApplication app = new TDEApplication(); - app.dcopClient().registerAs("JavaTest", false); - JavaDCOPObject object = new JavaDCOPObject(); - app.exec(); - } - - static{ - qtjava.initialize(); - kdejava.initialize(); - } -} |