1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 package mod._forms; 28 29 import com.sun.star.beans.NamedValue; 30 import java.io.PrintWriter; 31 32 import lib.TestEnvironment; 33 import lib.TestParameters; 34 import util.DBTools; 35 36 37 38 /** 39 * Test for object which is represented by service 40 * <code>com.sun.star.form.component.TextField</code>. <p> 41 * Object implements the following interfaces : 42 * <ul> 43 * <li> <code>com::sun::star::io::XPersistObject</code></li> 44 * <li> <code>com::sun::star::form::XReset</code></li> 45 * <li> <code>com::sun::star::form::XBoundComponent</code></li> 46 * <li> <code>com::sun::star::form::FormComponent</code></li> 47 * <li> <code>com::sun::star::beans::XFastPropertySet</code></li> 48 * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li> 49 * <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li> 50 * <li> <code>com::sun::star::form::component::TextField</code></li> 51 * <li> <code>com::sun::star::form::DataAwareControlModel</code></li> 52 * <li> <code>com::sun::star::beans::XPropertyState</code></li> 53 * <li> <code>com::sun::star::form::FormControlModel</code></li> 54 * <li> <code>com::sun::star::container::XNamed</code></li> 55 * <li> <code>com::sun::star::awt::UnoControlEditModel</code></li> 56 * <li> <code>com::sun::star::form::component::DatabaseTextField</code></li> 57 * <li> <code>com::sun::star::lang::XComponent</code></li> 58 * <li> <code>com::sun::star::lang::XEventListener</code></li> 59 * <li> <code>com::sun::star::beans::XPropertyAccess</code></li> 60 * <li> <code>com::sun::star::beans::XPropertyContainer</code></li> 61 * <li> <code>com::sun::star::beans::XPropertySet</code></li> 62 * <li> <code>com::sun::star::form::XLoadListener</code></li> 63 * <li> <code>com::sun::star::container::XChild</code></li> 64 * </ul> 65 * The following files used by this test : 66 * <ul> 67 * <li><b> TestDB </b> (directory) : directory with test database </li> 68 * <li><b> TestDB/TestDB.dbf </b> : table file. See 69 * {@link util.DBTools DBTools} class for more information.</li> 70 * </ul> <p> 71 * This object test <b> is NOT </b> designed to be run in several 72 * threads concurently. 73 * @see com.sun.star.io.XPersistObject 74 * @see com.sun.star.form.XReset 75 * @see com.sun.star.form.XBoundComponent 76 * @see com.sun.star.form.FormComponent 77 * @see com.sun.star.beans.XFastPropertySet 78 * @see com.sun.star.beans.XMultiPropertySet 79 * @see com.sun.star.form.XUpdateBroadcaster 80 * @see com.sun.star.form.component.TextField 81 * @see com.sun.star.form.DataAwareControlModel 82 * @see com.sun.star.beans.XPropertyState 83 * @see com.sun.star.form.FormControlModel 84 * @see com.sun.star.container.XNamed 85 * @see com.sun.star.awt.UnoControlEditModel 86 * @see com.sun.star.form.component.DatabaseTextField 87 * @see com.sun.star.lang.XComponent 88 * @see com.sun.star.lang.XEventListener 89 * @see com.sun.star.beans.XPropertyAccess 90 * @see com.sun.star.beans.XPropertyContainer 91 * @see com.sun.star.beans.XPropertySet 92 * @see com.sun.star.form.XLoadListener 93 * @see com.sun.star.container.XChild 94 * @see ifc.io._XPersistObject 95 * @see ifc.form._XReset 96 * @see ifc.form._XBoundComponent 97 * @see ifc.form._FormComponent 98 * @see ifc.beans._XFastPropertySet 99 * @see ifc.beans._XMultiPropertySet 100 * @see ifc.form._XUpdateBroadcaster 101 * @see ifc.form.component._TextField 102 * @see ifc.form._DataAwareControlModel 103 * @see ifc.beans._XPropertyState 104 * @see ifc.form._FormControlModel 105 * @see ifc.container._XNamed 106 * @see ifc.awt._UnoControlEditModel 107 * @see ifc.form.component._DatabaseTextField 108 * @see ifc.lang._XComponent 109 * @see ifc.lang._XEventListener 110 * @see ifc.beans._XPropertySet 111 * @see ifc.form._XLoadListener 112 * @see ifc.container._XChild 113 */ 114 public class OEditModel extends GenericModelTest { 115 116 /** 117 * Set some member variable of the super class <CODE>GenericModelTest</CODE>: 118 * <pre> 119 * <super.m_ChangePropertyName</CODE> = "Text"; 120 * super.m_kindOfControl</CODE>="TextField"; 121 * super.m_ObjectName</CODE> = "Edit"; 122 * NamedValue myProp = new NamedValue(); 123 * myProp.Name = "DataField"; 124 * myProp.Value = DBTools.TST_STRING_F; 125 * super.m_propertiesToSet.add(myProp); 126 * super.m_LCShape_Type = "FixedText"; 127 * </pre> 128 * Then <CODE>super.initialize()</CODE> was called. 129 * @param tParam the test parameter 130 * @param log the log writer 131 */ 132 133 protected void initialize(TestParameters tParam, PrintWriter log) { 134 135 super.initialize(tParam, log); 136 137 super.m_kindOfControl="TextField"; 138 139 super.m_ObjectName = "stardiv.one.form.component.Edit"; 140 141 NamedValue myProp = new NamedValue(); 142 myProp.Name = "DataField"; 143 myProp.Value = DBTools.TST_STRING_F; 144 super.m_propertiesToSet.add(myProp); 145 146 super.m_LCShape_Type = "FixedText"; 147 148 super.m_ChangePropertyName = "Text"; 149 } 150 /** 151 * calls <CODE>cleanup()</CODE> from it's super class 152 * @param tParam the test parameter 153 * @param log the log writer 154 */ 155 protected void cleanup(TestParameters tParam, PrintWriter log) { 156 super.cleanup(tParam, log); 157 } 158 159 160 /** 161 * calls <CODE>createTestEnvironment()</CODE> from it's super class 162 * @param Param the test parameter 163 * @param log the log writer 164 * @return lib.TestEnvironment 165 */ 166 protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, 167 PrintWriter log) { 168 return super.createTestEnvironment(Param, log); 169 } 170 } // finish class OEditModel 171