1   /*
2    * Created on Feb 17, 2008
3    * 
4    * Copyright 2005 CafeSip.org 
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License"); 
7    * you may not use this file except in compliance with the License. 
8    * 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, software 
13   * distributed under the License is distributed on an "AS IS" BASIS, 
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
15   * See the License for the specific language governing permissions and 
16   * limitations under the License.
17   *
18   */
19  package org.cafesip.gwtcomp.examples.client;
20  
21  import java.util.ArrayList;
22  
23  import org.cafesip.gwtcomp.client.ui.EditableList;
24  import org.cafesip.gwtcomp.client.ui.MessageBar;
25  import org.cafesip.gwtcomp.client.ui.TitleBar;
26  
27  import com.google.gwt.user.client.ui.FlowPanel;
28  
29  /**
30   * @author Becky McElroy
31   * 
32   */
33  public class EditableListSample extends FlowPanel
34  {
35      /**
36       * A constructor for this class.
37       * 
38       * 
39       */
40      public EditableListSample()
41      {
42          super();
43          setWidth("100%");
44          init();
45      }
46  
47      protected void init()
48      {
49          TitleBar titleBar = new TitleBar("Editable List", null, 1);
50          add(titleBar);
51          titleBar.setWidth("100%");
52  
53          MessageBar msgbar = new MessageBar();
54          add(msgbar);
55          msgbar.setWidth("100%");
56  
57          final EditableList list = new EditableList();
58          add(list);
59          list.setWidth("70%");
60          list.setMessageBar(msgbar);
61  
62          ArrayList<String> elements = new ArrayList<String>();
63          elements.add("amit@cafesip.org");
64          elements.add("becky@cafesip.org");
65          elements.add("joe@cafesip.org");
66          elements.add("lilly@quik-j.com");
67  
68          list.setList(elements);
69      }
70  
71  }