1   /*
2    * Copyright 2003 - 2013 The eFaps Team
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   * Revision:        $Rev$
17   * Last Changed:    $Date$
18   * Last Changed By: $Author$
19   */
20  
21  package org.efaps.admin.ui.field;
22  
23  import org.efaps.util.cache.CacheReloadException;
24  
25  /**
26   * @author The eFaps Team
27   * @version $Id$
28   */
29  public class FieldHeading
30      extends Field
31  {
32      /**
33       * Needed for serialization.
34       */
35      private static final long serialVersionUID = 1L;
36  
37      /**
38       * Stores the level of the heading.
39       */
40      private int level = 1;
41  
42      /**
43       *
44       * @param _id       id of the field heading
45       * @param _uuid     UUID of the field heading
46       * @param _name     name of the field heading
47       */
48      public FieldHeading(final long _id,
49                          final String _uuid,
50                          final String _name)
51      {
52          super(_id, _uuid, _name);
53      }
54  
55      /**
56       * Sets the property for this field set. This includes
57       * <ul>
58       * <li>{@link #level}</li>
59       * </ul>
60       *
61       * @param _name     name / key of the property
62       * @param _value    value of the property
63       * @throws CacheReloadException from called super property method
64       */
65      @Override
66      protected void setProperty(final String _name,
67                                 final String _value)
68          throws CacheReloadException
69      {
70          if ("Level".equals(_name)) {
71              this.level = Integer.parseInt(_value);
72          } else {
73              super.setProperty(_name, _value);
74          }
75      }
76  
77      /**
78       * This is the getter method for the instance variable {@link #level}.
79       *
80       * @return value of instance variable {@link #level}
81       */
82      public int getLevel()
83      {
84          return this.level;
85      }
86  }