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.awt; 25 26 import lib.MultiPropertyTest; 27 28 /* 29 * Testing <code>com.sun.star.awt.UnoControlButtonModel</code> 30 * service properties : 31 * <ul> 32 * <li><code> BackgroundColor</code></li> 33 * <li><code> DefaultButton</code></li> 34 * <li><code> DefaultControl</code></li> 35 * <li><code> Enabled</code></li> 36 * <li><code> FontDescriptor</code></li> 37 * <li><code> Label</code></li> 38 * <li><code> Printable</code></li> 39 * <li><code> Tabstop</code></li> 40 * <li><code> TextColor</code></li> 41 * </ul> 42 * @see com.sun.star.awt.UnoControlButtonModel 43 */ 44 public class _UnoControlButtonModel extends MultiPropertyTest { 45 46 /** 47 * Redefined method returns value, that differs from property value. 48 */ 49 protected PropertyTester ColorTester = new PropertyTester() { 50 protected Object getNewValue(String propName, Object oldValue) { 51 if (util.ValueComparer.equalValue(oldValue, new Integer(17))) 52 return new Integer(25); 53 else 54 return new Integer(17); 55 } 56 }; 57 58 /** 59 * Redefined method returns value, that differs from property value. 60 */ 61 protected PropertyTester BoolTester = new PropertyTester() { 62 protected Object getNewValue(String propName, Object oldValue) { 63 if (util.ValueComparer.equalValue(oldValue, new Boolean(true))) 64 return new Boolean(false); 65 else 66 return new Boolean(true); 67 } 68 }; 69 70 /** 71 * This property can be void, so if old value is <code> null </code> 72 * new value must be specified. 73 */ _BackgroundColor()74 public void _BackgroundColor() { 75 log.println("Testing with custom Property tester") ; 76 testProperty("BackgroundColor", ColorTester) ; 77 } 78 79 /** 80 * This property can be void, so if old value is <code> null </code> 81 * new value must be specified. 82 */ _TextLineColor()83 public void _TextLineColor() { 84 log.println("Testing with custom Property tester") ; 85 testProperty("TextLineColor", ColorTester) ; 86 } 87 88 /** 89 * This property can be void, so if old value is <code> null </code> 90 * new value must be specified. 91 */ _TextColor()92 public void _TextColor() { 93 log.println("Testing with custom Property tester") ; 94 testProperty("TextColor", ColorTester) ; 95 } 96 97 /** 98 * This property can be void, so if old value is <code> null </code> 99 * new value must be specified. 100 */ _Tabstop()101 public void _Tabstop() { 102 log.println("Testing with custom Property tester") ; 103 testProperty("Tabstop", BoolTester) ; 104 } 105 106 /** 107 * This property can be void, so if old value is <code> null </code> 108 * new value must be specified. 109 */ _PushButtonType()110 public void _PushButtonType() { 111 log.println("Testing with custom Property tester") ; 112 testProperty("PushButtonType", 113 new Short((short)0), new Short((short)1)); 114 } 115 116 117 } 118 119