Skip to main content
summaryrefslogtreecommitdiffstats
blob: 089c92f5b50639badc105d44ce12518cdb1672db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*******************************************************************************
 * Copyright (c) 2006 Sybase, Inc. and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http:// www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Sybase, Inc. - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.pagedesigner.jsf.ui.converter.jsfhtml;

/**
 * This class emulate a javax.faces.model.SelectItem
 * 
 * @author mengbo
 * @version 1.5
 */
public class SelectItemModel
{
    private String _description;
    private String _label;
    private String _itemValue;
    private String _value;
    private String _id;
    private boolean _disabled;
    
    /**
     * @return Returns the disabled.
     */
    public boolean isDisabled()
    {
        return _disabled;
    }
    
    /**
     * @param disabled The disabled to set.
     */
    public void setDisabled(boolean disabled)
    {
        this._disabled = disabled;
    }
    
    /**
     * Return a description of this item, for use in development tools.
     * @return the description
     */ 
    public String 	getDescription()
    {
        return _description;
    }

    /**
     * Return the label of this item, to be rendered visibly for the user.
     * @return the label for this item
     */
    public String 	getLabel()
    {
        return _label;
    }

    /**
	 * Set the description of this item, for use in development tools.
	 * @param description
	 */
    public void 	setDescription(java.lang.String description)
    {
        _description = description;
    }

    /**
	 * Set the label of this item, to be rendered visibly for the user.
	 * @param label
	 */
    public void 	setLabel(java.lang.String label)
    {
        this._label = label;
    }
    /**
     * @return the item value
     */
    public String getItemValue()
    {
        return _itemValue;
    }

    /**
     * @param itemValue
     */
    public void setItemValue(String itemValue)
    {
        this._itemValue = itemValue;
    }

    /**
     * @return the value
     */
    public String getValue()
    {
        return _value;
    }

    /**
     * @param value
     */
    public void setValue(String value)
    {
        this._value = value;
    }

    /**
     * @return the id
     */
    public String getId()
    {
        return _id;
    }

    /**
     * @param id
     */
    public void setId(String id)
    {
        _id = id;
    }

    /**
     * @return the display string
     */
    public String getDisplayString()
    {
        if (_label != null && _label.length() > 0)
        {
            return _label;
        }
        else if (_value != null && _value.length() > 0)
        {
            return _value;
        }
        else if (_description != null && _description.length() > 0)
        {
            return _description;
        }
        else if (_itemValue != null && _itemValue.length() > 0)
        {
            return _itemValue;
        }
        else
        {
            return "SelectItem";
        }
    }
}

Back to the top