001 /* 002 * Copyright 2002-2005 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 005 * use this file except in compliance with the License. You may obtain a copy of 006 * the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 013 * License for the specific language governing permissions and limitations under 014 * the License. 015 */ 016 package org.springframework.binding.form; 017 018 import javax.swing.AbstractButton; 019 import javax.swing.Icon; 020 import javax.swing.JLabel; 021 022 import org.springframework.richclient.core.DescribedElement; 023 import org.springframework.richclient.core.LabelInfo; 024 import org.springframework.richclient.core.VisualizedElement; 025 026 /** 027 * Provides metadata related to the visualization of a form property and 028 * convenience methods for configuring GUI components using the metadata. 029 * 030 * @author Oliver Hutchison 031 */ 032 public interface FieldFace extends DescribedElement, VisualizedElement { 033 034 /** 035 * The name of the property in human readable form, typically used for 036 * validation messages. 037 */ 038 String getDisplayName(); 039 040 /** 041 * A short caption describing the property, typically used for tool tips. 042 */ 043 String getCaption(); 044 045 /** 046 * A longer caption describing the property. 047 */ 048 String getDescription(); 049 050 /** 051 * The text, mnemonic and mnemonicIndex for any labels created for the 052 * property. 053 */ 054 LabelInfo getLabelInfo(); 055 056 /** 057 * The icon that is used for any labels created for this property. 058 */ 059 Icon getIcon(); 060 061 /** 062 * Configures the supplied JLabel using LabelInfo and Icon. 063 */ 064 void configure(JLabel label); 065 066 /** 067 * Configures the supplied button using LabelInfo and Icon. 068 */ 069 void configure(AbstractButton button); 070 }