1   /*
2    * Copyright 2004-2008 the Seasar Foundation and the Others.
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, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.uruma.binding.value.binder;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import org.eclipse.swt.widgets.Text;
22  import org.seasar.uruma.annotation.EventListener;
23  import org.seasar.uruma.annotation.ExportSelection;
24  import org.seasar.uruma.annotation.ExportValue;
25  import org.seasar.uruma.annotation.Form;
26  import org.seasar.uruma.annotation.ImportSelection;
27  import org.seasar.uruma.annotation.ImportValue;
28  import org.seasar.uruma.annotation.InitializeMethod;
29  import org.seasar.uruma.renderer.impl.AbstractGUITest;
30  
31  /**
32   * {@link ComboViewerValueBinder} のためのテストクラスです。<br />
33   * 
34   * @author y-komori
35   */
36  public class ComboViewerValueBinderGUITest extends AbstractGUITest {
37      @ExportValue
38      public List<String> combo1 = new ArrayList<String>();
39  
40      @ImportValue(id = "combo1")
41      public String combo1value;
42  
43      @ImportSelection(id = "combo1")
44      public String combo1Selection;
45  
46      @ExportValue
47      public String[] combo2 = new String[] { "111", "222", "333" };
48  
49      @ExportSelection(id = "combo2")
50      public String combo2selection = "222";
51  
52      @ExportValue
53      public String combo3 = "Hello";
54  
55      public Text text;
56  
57      @InitializeMethod
58      public void initialize() {
59          combo1.add("AAA");
60          combo1.add("BBB");
61          combo1.add("CCC");
62      }
63  
64      @EventListener(id = "select")
65      public void selectAction() {
66          text.setText("Combo1Value=" + combo1value + "\n" + "Combo1Selection="
67                  + combo1Selection);
68      }
69  }