1 /*
2  * Licensed under the Apache License, Version 2.0 (the "License");
3  * you may not use this file except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14package org.tp23.antinstaller.renderer.swing;
15
16import javax.swing.JPanel;
17
18import org.tp23.antinstaller.input.HiddenPropertyInput;
19import org.tp23.antinstaller.input.OutputField;
20import org.tp23.gui.GBCF;
21
22/**
23 * Swing UI hidden property renderer - displays nothing
24 *
25 * @author mwilson
26 * @version $Id
27 * @since 0.7.4 patch 6
28 */
29public class HiddenPropertyInputRenderer extends SwingOutputFieldRenderer
30{
31    HiddenPropertyInput inputField;
32
33    public void setOutputField( OutputField ioField )
34    {
35        inputField = (HiddenPropertyInput) ioField;
36        inputField.setInputResult( inputField.getDefaultValue() );
37    }
38
39    public void initComponent( JPanel parent )
40    {
41
42    }
43
44    public void updateInputField()
45    {
46
47    }
48
49    public void updateDefaultValue()
50    {
51        if( !inputField.isEditted() )
52        {
53            inputField.setInputResult( inputField.getDefaultValue() );
54        }
55    }
56
57    public void renderError()
58    {
59
60    }
61
62    public int addSelf( JPanel content, GBCF cf, int row, boolean overflow )
63    {
64        return row;
65    }
66}
67