2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package ifc
.form
.submission
;
21 import com
.sun
.star
.form
.submission
.XSubmission
;
22 import com
.sun
.star
.form
.submission
.XSubmissionSupplier
;
23 import com
.sun
.star
.form
.submission
.XSubmissionVetoListener
;
24 import com
.sun
.star
.task
.XInteractionHandler
;
25 import lib
.MultiMethodTest
;
27 public class _XSubmissionSupplier
extends MultiMethodTest
29 public XSubmissionSupplier oObj
= null;
30 public boolean submitWasCalled
= false;
32 public void _Submission() {
33 XSubmission stub
= new MyXSubmission();
34 oObj
.setSubmission (stub
);
35 XSubmission xSubmission
= oObj
.getSubmission ();
37 xSubmission
.submit ();
38 } catch (com
.sun
.star
.lang
.WrappedTargetException e
) {
39 log
.println("Exception during submit "+e
.getMessage ());
41 catch (com
.sun
.star
.util
.VetoException e
) {
42 log
.println("VetoException during submit "+e
.getMessage ());
44 tRes
.tested ("Submission()",submitWasCalled
);
47 private class MyXSubmission
implements XSubmission
{
49 public void submit () throws com
.sun
.star
.util
.VetoException
, com
.sun
.star
.lang
.WrappedTargetException
52 log
.println("MyXSubmission: someone called submit :-)");
55 public void submitWithInteraction( XInteractionHandler handler
) throws com
.sun
.star
.util
.VetoException
, com
.sun
.star
.lang
.WrappedTargetException
57 log
.println("MyXSubmission: someone called submitWithInteraction :-)");
60 public void addSubmissionVetoListener( XSubmissionVetoListener listener
) throws com
.sun
.star
.lang
.NoSupportException
62 throw new com
.sun
.star
.lang
.NoSupportException();
65 public void removeSubmissionVetoListener( XSubmissionVetoListener listener
) throws com
.sun
.star
.lang
.NoSupportException
67 throw new com
.sun
.star
.lang
.NoSupportException();