1ef39d40dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3ef39d40dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4ef39d40dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5ef39d40dSAndrew Rist  * distributed with this work for additional information
6ef39d40dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7ef39d40dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8ef39d40dSAndrew Rist  * "License"); you may not use this file except in compliance
9ef39d40dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10ef39d40dSAndrew Rist  *
11ef39d40dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12ef39d40dSAndrew Rist  *
13ef39d40dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14ef39d40dSAndrew Rist  * software distributed under the License is distributed on an
15ef39d40dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16ef39d40dSAndrew Rist  * KIND, either express or implied.  See the License for the
17ef39d40dSAndrew Rist  * specific language governing permissions and limitations
18ef39d40dSAndrew Rist  * under the License.
19ef39d40dSAndrew Rist  *
20ef39d40dSAndrew Rist  *************************************************************/
21ef39d40dSAndrew Rist 
22ef39d40dSAndrew Rist 
23cdf0e10cSrcweir package mod._forms;
24cdf0e10cSrcweir 
25cdf0e10cSrcweir import com.sun.star.beans.NamedValue;
26cdf0e10cSrcweir import java.io.PrintWriter;
27cdf0e10cSrcweir 
28cdf0e10cSrcweir import lib.TestEnvironment;
29cdf0e10cSrcweir import lib.TestParameters;
30cdf0e10cSrcweir import util.DBTools;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir 
34cdf0e10cSrcweir /**
35cdf0e10cSrcweir * Test for object which is represented by service
36cdf0e10cSrcweir * <code>com.sun.star.form.component.TextField</code>. <p>
37cdf0e10cSrcweir * Object implements the following interfaces :
38cdf0e10cSrcweir * <ul>
39cdf0e10cSrcweir *  <li> <code>com::sun::star::io::XPersistObject</code></li>
40cdf0e10cSrcweir *  <li> <code>com::sun::star::form::XReset</code></li>
41cdf0e10cSrcweir *  <li> <code>com::sun::star::form::XBoundComponent</code></li>
42cdf0e10cSrcweir *  <li> <code>com::sun::star::form::FormComponent</code></li>
43cdf0e10cSrcweir *  <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
44cdf0e10cSrcweir *  <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
45cdf0e10cSrcweir *  <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
46cdf0e10cSrcweir *  <li> <code>com::sun::star::form::component::TextField</code></li>
47cdf0e10cSrcweir *  <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
48cdf0e10cSrcweir *  <li> <code>com::sun::star::beans::XPropertyState</code></li>
49cdf0e10cSrcweir *  <li> <code>com::sun::star::form::FormControlModel</code></li>
50cdf0e10cSrcweir *  <li> <code>com::sun::star::container::XNamed</code></li>
51cdf0e10cSrcweir *  <li> <code>com::sun::star::awt::UnoControlEditModel</code></li>
52cdf0e10cSrcweir *  <li> <code>com::sun::star::form::component::DatabaseTextField</code></li>
53cdf0e10cSrcweir *  <li> <code>com::sun::star::lang::XComponent</code></li>
54cdf0e10cSrcweir *  <li> <code>com::sun::star::lang::XEventListener</code></li>
55cdf0e10cSrcweir *  <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
56cdf0e10cSrcweir *  <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
57cdf0e10cSrcweir *  <li> <code>com::sun::star::beans::XPropertySet</code></li>
58cdf0e10cSrcweir *  <li> <code>com::sun::star::form::XLoadListener</code></li>
59cdf0e10cSrcweir *  <li> <code>com::sun::star::container::XChild</code></li>
60cdf0e10cSrcweir * </ul>
61cdf0e10cSrcweir * The following files used by this test :
62cdf0e10cSrcweir * <ul>
63cdf0e10cSrcweir *  <li><b> TestDB </b> (directory) : directory with test database </li>
64cdf0e10cSrcweir *  <li><b> TestDB/TestDB.dbf </b> : table file. See
65cdf0e10cSrcweir *    {@link util.DBTools DBTools} class for more information.</li>
66cdf0e10cSrcweir * </ul> <p>
67cdf0e10cSrcweir * This object test <b> is NOT </b> designed to be run in several
68cdf0e10cSrcweir * threads concurently.
69cdf0e10cSrcweir * @see com.sun.star.io.XPersistObject
70cdf0e10cSrcweir * @see com.sun.star.form.XReset
71cdf0e10cSrcweir * @see com.sun.star.form.XBoundComponent
72cdf0e10cSrcweir * @see com.sun.star.form.FormComponent
73cdf0e10cSrcweir * @see com.sun.star.beans.XFastPropertySet
74cdf0e10cSrcweir * @see com.sun.star.beans.XMultiPropertySet
75cdf0e10cSrcweir * @see com.sun.star.form.XUpdateBroadcaster
76cdf0e10cSrcweir * @see com.sun.star.form.component.TextField
77cdf0e10cSrcweir * @see com.sun.star.form.DataAwareControlModel
78cdf0e10cSrcweir * @see com.sun.star.beans.XPropertyState
79*5496b966SPedro Giffuni * @see com.sun.star.form
80cdf0e10cSrcweir * @see com.sun.star.container.XNamed
81cdf0e10cSrcweir * @see com.sun.star.awt.UnoControlEditModel
82cdf0e10cSrcweir * @see com.sun.star.form.component.DatabaseTextField
83cdf0e10cSrcweir * @see com.sun.star.lang.XComponent
84cdf0e10cSrcweir * @see com.sun.star.lang.XEventListener
85cdf0e10cSrcweir * @see com.sun.star.beans.XPropertyAccess
86cdf0e10cSrcweir * @see com.sun.star.beans.XPropertyContainer
87cdf0e10cSrcweir * @see com.sun.star.beans.XPropertySet
88cdf0e10cSrcweir * @see com.sun.star.form.XLoadListener
89cdf0e10cSrcweir * @see com.sun.star.container.XChild
90cdf0e10cSrcweir * @see ifc.io._XPersistObject
91cdf0e10cSrcweir * @see ifc.form._XReset
92cdf0e10cSrcweir * @see ifc.form._XBoundComponent
93cdf0e10cSrcweir * @see ifc.form._FormComponent
94cdf0e10cSrcweir * @see ifc.beans._XFastPropertySet
95cdf0e10cSrcweir * @see ifc.beans._XMultiPropertySet
96cdf0e10cSrcweir * @see ifc.form._XUpdateBroadcaster
97cdf0e10cSrcweir * @see ifc.form.component._TextField
98cdf0e10cSrcweir * @see ifc.form._DataAwareControlModel
99cdf0e10cSrcweir * @see ifc.beans._XPropertyState
100cdf0e10cSrcweir * @see ifc.form._FormControlModel
101cdf0e10cSrcweir * @see ifc.container._XNamed
102cdf0e10cSrcweir * @see ifc.awt._UnoControlEditModel
103cdf0e10cSrcweir * @see ifc.form.component._DatabaseTextField
104cdf0e10cSrcweir * @see ifc.lang._XComponent
105cdf0e10cSrcweir * @see ifc.lang._XEventListener
106cdf0e10cSrcweir * @see ifc.beans._XPropertySet
107cdf0e10cSrcweir * @see ifc.form._XLoadListener
108cdf0e10cSrcweir * @see ifc.container._XChild
109cdf0e10cSrcweir */
110cdf0e10cSrcweir public class OEditModel extends GenericModelTest {
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     /**
113cdf0e10cSrcweir      * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
114cdf0e10cSrcweir      * <pre>
115cdf0e10cSrcweir      *    <super.m_ChangePropertyName</CODE> = "Text";
116cdf0e10cSrcweir      *    super.m_kindOfControl</CODE>="TextField";
117cdf0e10cSrcweir      *    super.m_ObjectName</CODE> = "Edit";
118cdf0e10cSrcweir      *    NamedValue myProp = new NamedValue();
119cdf0e10cSrcweir      *        myProp.Name = "DataField";
120cdf0e10cSrcweir      *        myProp.Value = DBTools.TST_STRING_F;
121cdf0e10cSrcweir      *        super.m_propertiesToSet.add(myProp);
122cdf0e10cSrcweir      *        super.m_LCShape_Type = "FixedText";
123cdf0e10cSrcweir      * </pre>
124cdf0e10cSrcweir      * Then <CODE>super.initialize()</CODE> was called.
125cdf0e10cSrcweir      * @param tParam the test parameter
126cdf0e10cSrcweir      * @param log the log writer
127cdf0e10cSrcweir      */
128cdf0e10cSrcweir 
initialize(TestParameters tParam, PrintWriter log)129cdf0e10cSrcweir     protected void initialize(TestParameters tParam, PrintWriter log) {
130cdf0e10cSrcweir 
131cdf0e10cSrcweir         super.initialize(tParam, log);
132cdf0e10cSrcweir 
133cdf0e10cSrcweir         super.m_kindOfControl="TextField";
134cdf0e10cSrcweir 
135cdf0e10cSrcweir         super.m_ObjectName = "stardiv.one.form.component.Edit";
136cdf0e10cSrcweir 
137cdf0e10cSrcweir         NamedValue myProp = new NamedValue();
138cdf0e10cSrcweir         myProp.Name = "DataField";
139cdf0e10cSrcweir         myProp.Value = DBTools.TST_STRING_F;
140cdf0e10cSrcweir         super.m_propertiesToSet.add(myProp);
141cdf0e10cSrcweir 
142cdf0e10cSrcweir         super.m_LCShape_Type = "FixedText";
143cdf0e10cSrcweir 
144cdf0e10cSrcweir         super.m_ChangePropertyName = "Text";
145cdf0e10cSrcweir     }
146cdf0e10cSrcweir     /**
147cdf0e10cSrcweir      * calls <CODE>cleanup()</CODE> from it's super class
148cdf0e10cSrcweir      * @param tParam the test parameter
149cdf0e10cSrcweir      * @param log the log writer
150cdf0e10cSrcweir      */
cleanup(TestParameters tParam, PrintWriter log)151cdf0e10cSrcweir     protected void cleanup(TestParameters tParam, PrintWriter log) {
152cdf0e10cSrcweir         super.cleanup(tParam, log);
153cdf0e10cSrcweir     }
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 
156cdf0e10cSrcweir     /**
157cdf0e10cSrcweir      * calls <CODE>createTestEnvironment()</CODE> from it's super class
158cdf0e10cSrcweir      * @param Param the test parameter
159cdf0e10cSrcweir      * @param log the log writer
160cdf0e10cSrcweir      * @return lib.TestEnvironment
161cdf0e10cSrcweir      */
createTestEnvironment(TestParameters Param, PrintWriter log)162cdf0e10cSrcweir     protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
163cdf0e10cSrcweir                                                                  PrintWriter log) {
164cdf0e10cSrcweir         return super.createTestEnvironment(Param, log);
165cdf0e10cSrcweir     }
166cdf0e10cSrcweir } // finish class OEditModel
167