View Javadoc

1   /*
2    * @(#)$Id: TextDescriptorPanel.java 760 2009-08-25 20:10:41Z kurmannu $
3    *
4    * Author   : Ueli Kurmann, igesture@uelikurmann.ch
5    *                                   
6    *                                   
7    * Purpose  : 
8    *
9    * -----------------------------------------------------------------------
10   *
11   * Revision Information:
12   *
13   * Date       Who     Reason
14   *
15   * 23.03.2008 ukurmann  Initial Release
16   *
17   * -----------------------------------------------------------------------
18   *
19   * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
20   *
21   * This software is the proprietary information of ETH Zurich.
22   * Use is subject to license terms.
23   * 
24   */
25  
26  package org.ximtec.igesture.tool.view.admin.panel;
27  
28  import java.awt.BorderLayout;
29  
30  import javax.swing.JLabel;
31  import javax.swing.JPanel;
32  import javax.swing.JTextArea;
33  
34  import org.ximtec.igesture.core.TextDescriptor;
35  import org.ximtec.igesture.tool.GestureConstants;
36  import org.ximtec.igesture.tool.binding.BindingFactory;
37  import org.ximtec.igesture.tool.core.Controller;
38  import org.ximtec.igesture.tool.util.ComponentFactory;
39  import org.ximtec.igesture.tool.util.FormBuilder;
40  
41  public class TextDescriptorPanel extends DefaultDescriptorPanel<TextDescriptor> {
42  
43    public TextDescriptorPanel(Controller controller, TextDescriptor textDescriptor) {
44      super(controller, textDescriptor);
45  
46      initTitle();
47  
48      FormBuilder formBuilder = new FormBuilder();
49  
50      JLabel labelText = getComponentFactory().createLabel(GestureConstants.TEXT_DESCRIPTOR_TEXT);
51      
52      JTextArea textArea = new JTextArea();
53      BindingFactory.createInstance(textArea, textDescriptor, TextDescriptor.PROPERTY_TEXT);
54  
55      formBuilder.addLeft(labelText);
56      formBuilder.addRight(textArea);
57      
58      JPanel basePanel = ComponentFactory.createBorderLayoutPanel();
59      basePanel.add(formBuilder.getPanel(), BorderLayout.NORTH);
60  
61      setContent(basePanel);
62  
63    }
64  
65  }