View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.myfaces.tobago.model;
21  
22  import org.apache.myfaces.tobago.component.SupportsMarkup;
23  import org.apache.myfaces.tobago.context.Markup;
24  
25  public class SelectItem extends javax.faces.model.SelectItem implements SupportsMarkup {
26  
27    private static final long serialVersionUID = 2582455665060354639L;
28  
29    private String image;
30    private Markup markup = Markup.NULL;
31    private Markup currentMarkup = null;
32  
33    public SelectItem() {
34      super();
35    }
36    
37    public SelectItem(Object value) {
38      super(value);
39    }
40  
41    public SelectItem(Object value, String label) {
42      super(value, label);
43    }
44  
45    public SelectItem(Object value, String label, String description) {
46      super(value, label, description);
47    }
48  
49    public SelectItem(Object value, String label, String description, String image) {
50      this(value, label, description, false, image);
51    }
52  
53    /** @deprecated since 1.5.0 */
54    @Deprecated
55    public SelectItem(Object value, String label, String description, String image, String[] markup) {
56      this(value, label, description, false, image, markup);
57    }
58  
59    public SelectItem(Object value, String label, String description, String image, Markup markup) {
60      this(value, label, description, false, image, markup);
61    }
62  
63    public SelectItem(Object value, String label, String description, boolean disabled, String image) {
64      this(value, label, description, disabled, image, Markup.NULL);
65    }
66  
67    /** @deprecated since 1.5.0 */
68    public SelectItem(Object value, String label, String description, boolean disabled, String image, String[] markup) {
69      this(value, label, description, disabled, image, Markup.valueOf(markup));
70    }
71  
72    public SelectItem(Object value, String label, String description, boolean disabled, String image, Markup markup) {
73      super(value, label, description, disabled);
74      this.image = image;
75      this.markup = markup;
76    }
77  
78    public String getImage() {
79      return image;
80    }
81  
82    public void setImage(String image) {
83      this.image = image;
84    }
85  
86    public Markup getMarkup() {
87      return markup;
88    }
89  
90    public void setMarkup(Markup markup) {
91      this.markup = markup;
92    }
93  
94    public Markup getCurrentMarkup() {
95      return currentMarkup;
96    }
97  
98    public void setCurrentMarkup(Markup currentMarkup) {
99      this.currentMarkup = currentMarkup;
100   }
101 }