xref: /aoo41x/main/bean/test/Test.java (revision d4cc1e8c)
1*d4cc1e8cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*d4cc1e8cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d4cc1e8cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d4cc1e8cSAndrew Rist  * distributed with this work for additional information
6*d4cc1e8cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d4cc1e8cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d4cc1e8cSAndrew Rist  * "License"); you may not use this file except in compliance
9*d4cc1e8cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*d4cc1e8cSAndrew Rist  *
11*d4cc1e8cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*d4cc1e8cSAndrew Rist  *
13*d4cc1e8cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d4cc1e8cSAndrew Rist  * software distributed under the License is distributed on an
15*d4cc1e8cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d4cc1e8cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*d4cc1e8cSAndrew Rist  * specific language governing permissions and limitations
18*d4cc1e8cSAndrew Rist  * under the License.
19*d4cc1e8cSAndrew Rist  *
20*d4cc1e8cSAndrew Rist  *************************************************************/
21*d4cc1e8cSAndrew Rist 
22*d4cc1e8cSAndrew Rist 
23cdf0e10cSrcweir package test;
24cdf0e10cSrcweir 
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import java.io.*;
27cdf0e10cSrcweir import java.awt.*;
28cdf0e10cSrcweir import java.awt.event.*;
29cdf0e10cSrcweir import com.sun.star.comp.beans.OOoBean;
30cdf0e10cSrcweir import com.sun.star.uno.UnoRuntime;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir import java.awt.*;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir public class Test
36cdf0e10cSrcweir {
37cdf0e10cSrcweir 
main(String [] args)38cdf0e10cSrcweir     public static void main(String [] args)
39cdf0e10cSrcweir     {
40cdf0e10cSrcweir         try {
41cdf0e10cSrcweir         Frame f = new Frame();
42cdf0e10cSrcweir         final OOoBean b = new OOoBean();
43cdf0e10cSrcweir         f.add(b, BorderLayout.CENTER);
44cdf0e10cSrcweir         f.pack();
45cdf0e10cSrcweir         f.setSize(500, 400);
46cdf0e10cSrcweir         f.setVisible(true);
47cdf0e10cSrcweir         b.loadFromURL("private:factory/swriter", null);
48cdf0e10cSrcweir         f.validate();
49cdf0e10cSrcweir 
50cdf0e10cSrcweir         f.addWindowListener(new WindowAdapter() {
51cdf0e10cSrcweir                 public void windowClosing( java.awt.event.WindowEvent e){
52cdf0e10cSrcweir                     b.stopOOoConnection();
53cdf0e10cSrcweir                     System.exit(0);
54cdf0e10cSrcweir 
55cdf0e10cSrcweir                 }});
56cdf0e10cSrcweir         }
57cdf0e10cSrcweir         catch (Exception e)
58cdf0e10cSrcweir         {
59cdf0e10cSrcweir             e.printStackTrace();
60cdf0e10cSrcweir         }
61cdf0e10cSrcweir     }
62cdf0e10cSrcweir }
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 
65