javauis/lcdui_qt/src/javax/microedition/lcdui/ItemLayouter.java
changeset 67 63b81d807542
parent 64 0ea12c182930
equal deleted inserted replaced
64:0ea12c182930 67:63b81d807542
   165     LayoutObject getLayoutObject(Item item)
   165     LayoutObject getLayoutObject(Item item)
   166     {
   166     {
   167     	LayoutObject lo = formLayouter.getLayoutObject(item);
   167     	LayoutObject lo = formLayouter.getLayoutObject(item);
   168     	if(lo == null)
   168     	if(lo == null)
   169     	{
   169     	{
   170         	lo = new LayoutObject(item, eswtGetCaptionedControl(item));
   170         	lo = new LayoutObject(item, createItemControl(formComposite, item));
   171     	}
   171     	}
   172 		return lo;
   172 		return lo;
   173     }
   173     }
       
   174 
       
   175     /**
       
   176      * Creates eSWT Control for the given Item.
       
   177      *
       
   178      * For any Item, if it is needed to create non CaptionControl based Control
       
   179      * then this fucntion can be overrided in the derived Item Layouter.
       
   180      *
       
   181      * @param item Item to create the Control
       
   182      * @param parent formComposite as parent to create the Control
       
   183      * @return eSWT Control
       
   184      */
       
   185 	Control createItemControl(Composite parent, Item item)
       
   186 	{
       
   187 		return eswtGetCaptionedControl(parent, item);
       
   188 	}
   174 
   189 
   175     /**
   190     /**
   176      * Wraps this item's control in the necessary composites.<br>
   191      * Wraps this item's control in the necessary composites.<br>
   177      * Based on the item, the result of this method can be:
   192      * Based on the item, the result of this method can be:
   178      * <li> specific Control
   193      * <li> specific Control
   181      * The method will set the size of these using the eswtCaptionedResize
   196      * The method will set the size of these using the eswtCaptionedResize
   182      * method.
   197      * method.
   183      *
   198      *
   184      * @param item Item to be layouted
   199      * @param item Item to be layouted
   185      */
   200      */
   186     final Control eswtGetCaptionedControl(Item item)
   201     final Control eswtGetCaptionedControl(Composite parent, Item item)
   187     {
   202     {
   188         CaptionedControl captioned = new CaptionedControl(formComposite, SWT.VERTICAL);
   203         CaptionedControl captioned = new CaptionedControl(parent, SWT.VERTICAL);
   189         if(item.hasLabel())
   204         if(item.hasLabel())
   190         {
   205         {
   191 	        captioned.setText(item.getLabel());
   206 	        captioned.setText(item.getLabel());
   192 		}
   207 		}
   193         eswtGetControl(captioned, item);
   208         eswtGetControl(captioned, item);