1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package ifc.form.submission;
25 
26 import com.sun.star.form.submission.XSubmission;
27 import com.sun.star.form.submission.XSubmissionSupplier;
28 import com.sun.star.form.submission.XSubmissionVetoListener;
29 import com.sun.star.task.XInteractionHandler;
30 import lib.MultiMethodTest;
31 
32 public class _XSubmissionSupplier extends MultiMethodTest
33 {
34     public XSubmissionSupplier oObj = null;
35     public boolean submitWasCalled = false;
36 
_Submission()37     public void _Submission() {
38         XSubmission stub = new MyXSubmission();
39         oObj.setSubmission (stub);
40         XSubmission xSubmission = oObj.getSubmission ();
41         try {
42             xSubmission.submit ();
43         } catch (com.sun.star.lang.WrappedTargetException e) {
44             log.println("Exception during submit "+e.getMessage ());
45         }
46         catch (com.sun.star.util.VetoException e) {
47             log.println("VetoException during submit "+e.getMessage ());
48         }
49         tRes.tested ("Submission()",submitWasCalled);
50     }
51 
52     private class MyXSubmission implements XSubmission {
53 
submit()54         public void submit () throws com.sun.star.util.VetoException, com.sun.star.lang.WrappedTargetException
55         {
56             submitWasCalled=true;
57             log.println("MyXSubmission: someone called submit :-)");
58         }
59 
submitWithInteraction( XInteractionHandler handler )60         public void submitWithInteraction( XInteractionHandler handler ) throws com.sun.star.util.VetoException, com.sun.star.lang.WrappedTargetException
61         {
62             log.println("MyXSubmission: someone called submitWithInteraction :-)");
63         }
64 
addSubmissionVetoListener( XSubmissionVetoListener listener )65         public void addSubmissionVetoListener( XSubmissionVetoListener listener ) throws com.sun.star.lang.NoSupportException
66         {
67             throw new com.sun.star.lang.NoSupportException();
68         }
69 
removeSubmissionVetoListener( XSubmissionVetoListener listener )70         public void removeSubmissionVetoListener( XSubmissionVetoListener listener ) throws com.sun.star.lang.NoSupportException
71         {
72             throw new com.sun.star.lang.NoSupportException();
73         }
74 
75     }
76 
77 }
78