1*b9b79128SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*b9b79128SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*b9b79128SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*b9b79128SAndrew Rist * distributed with this work for additional information 6*b9b79128SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*b9b79128SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*b9b79128SAndrew Rist * "License"); you may not use this file except in compliance 9*b9b79128SAndrew Rist * with the License. You may obtain a copy of the License at 10*b9b79128SAndrew Rist * 11*b9b79128SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*b9b79128SAndrew Rist * 13*b9b79128SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*b9b79128SAndrew Rist * software distributed under the License is distributed on an 15*b9b79128SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b9b79128SAndrew Rist * KIND, either express or implied. See the License for the 17*b9b79128SAndrew Rist * specific language governing permissions and limitations 18*b9b79128SAndrew Rist * under the License. 19*b9b79128SAndrew Rist * 20*b9b79128SAndrew Rist *************************************************************/ 21*b9b79128SAndrew Rist 22*b9b79128SAndrew Rist 23cdf0e10cSrcweir package integration.forms; 24cdf0e10cSrcweir 25cdf0e10cSrcweir /** base class for components validating the content of form controls 26cdf0e10cSrcweir * 27cdf0e10cSrcweir * @author fs@openoffice.org 28cdf0e10cSrcweir */ 29cdf0e10cSrcweir public abstract class ControlValidator implements com.sun.star.form.validation.XValidator 30cdf0e10cSrcweir { 31cdf0e10cSrcweir 32cdf0e10cSrcweir /** Creates a new instance of ControlValidator */ ControlValidator()33cdf0e10cSrcweir public ControlValidator() 34cdf0e10cSrcweir { 35cdf0e10cSrcweir } 36cdf0e10cSrcweir addValidityConstraintListener(com.sun.star.form.validation.XValidityConstraintListener xValidityConstraintListener)37cdf0e10cSrcweir public void addValidityConstraintListener(com.sun.star.form.validation.XValidityConstraintListener xValidityConstraintListener) 38cdf0e10cSrcweir { 39cdf0e10cSrcweir } 40cdf0e10cSrcweir removeValidityConstraintListener(com.sun.star.form.validation.XValidityConstraintListener xValidityConstraintListener)41cdf0e10cSrcweir public void removeValidityConstraintListener(com.sun.star.form.validation.XValidityConstraintListener xValidityConstraintListener) 42cdf0e10cSrcweir { 43cdf0e10cSrcweir } 44cdf0e10cSrcweir isVoid( Object Value )45cdf0e10cSrcweir protected boolean isVoid( Object Value ) 46cdf0e10cSrcweir { 47cdf0e10cSrcweir try 48cdf0e10cSrcweir { 49cdf0e10cSrcweir return ( com.sun.star.uno.AnyConverter.getType(Value).getTypeClass() 50cdf0e10cSrcweir == com.sun.star.uno.TypeClass.VOID ); 51cdf0e10cSrcweir } 52cdf0e10cSrcweir catch( java.lang.ClassCastException e ) 53cdf0e10cSrcweir { 54cdf0e10cSrcweir } 55cdf0e10cSrcweir return false; 56cdf0e10cSrcweir } 57cdf0e10cSrcweir } 58