View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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  package org.kuali.rice.kns.question;
17  
18  import java.util.ArrayList;
19  
20  /**
21   * This class is a base class to implement questions types.
22   * 
23   * 
24   *         "confirmation questions") rather than specific questions.
25   *
26   * @deprecated Only used in KNS classes, use KRAD.
27   */
28  @Deprecated
29  public class QuestionBase implements Question {
30      String question;
31      ArrayList buttons;
32  
33      /**
34       * default constructor
35       * 
36       * @param question the question to assign to this question prompt
37       * @param buttons the buttons associated with it
38       */
39      public QuestionBase(String question, ArrayList buttons) {
40          this.question = question;
41          this.buttons = buttons;
42      }
43  
44      /**
45       * returns the index associated with a specified button
46       * 
47       * @param btnText the text of the button
48       * @return the index of this button
49       */
50      public String getButtonIndex(String btnText) {
51          return "" + buttons.indexOf(btnText);
52      }
53  
54      /**
55       * @return Returns the buttons.
56       */
57      public ArrayList getButtons() {
58          return buttons;
59      }
60  
61      /**
62       * @param buttons The buttons to set.
63       */
64      public void setButtons(ArrayList buttons) {
65          this.buttons = buttons;
66      }
67  
68      /**
69       * @return Returns the question.
70       */
71      public String getQuestion() {
72          return question;
73      }
74  
75      /**
76       * @param question The question to set.
77       */
78      public void setQuestion(String question) {
79          this.question = question;
80      }
81  }