package com.sometrik.framework;

import android.content.Context;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class FWLayout extends LinearLayout implements NativeMessageHandler{
  
  private Context context;
  
  public FWLayout(Context context) {
    super(context);
  }

  @Override
  public void handleMessage(NativeMessage message) {
    
    switch(message.getMessage()){
    case CREATE_BUTTON:
      Button button = new Button(context);
      button.setId(message.getChildInternalId());
      this.addView(button);
      break;

    case CREATE_PICKER:
      break;

    case CREATE_LINEAR_LAYOUT:
      LinearLayout layout = new LinearLayout(context);
      layout.setId(message.getChildInternalId());
      this.addView(layout);
      break;

    case CREATE_OPENGL_VIEW:
      break;

    case CREATE_TEXTFIELD:
      TextView textView = new TextView(context);
      textView.setId(message.getChildInternalId());
      this.addView(textView);
      break;

    case CREATE_TEXTLABEL:
      break;

    case SET_ATTRIBUTE:
      break;
      
    default:
      break;
    }
  }

}

@@ -114,28 +114,93 @@
 .widget.
-LinearLayout
+EditText;%0D%0Aimport android.widget.LinearLayout;%0D%0Aimport android.widget.Spinner
 ;%0D%0Aimpor
@@ -706,16 +706,145 @@
 ICKER:%0D%0A
+      Spinner spinner = new Spinner(context);%0D%0A      spinner.setId(message.getChildInternalId());%0D%0A      this.addView(spinner);%0D%0A
       br
@@ -1109,16 +1109,194 @@
 FIELD:%0D%0A
+      EditText editText = new EditText(context);%0D%0A      editText.setId(message.getChildInternalId());%0D%0A      this.addView(editText);%0D%0A      break;%0D%0A%0D%0A    case CREATE_TEXTLABEL:%0D%0A
       Te
@@ -1441,52 +1441,8 @@
 %0D%0A%0D%0A
-    case CREATE_TEXTLABEL:%0D%0A      break;%0D%0A%0D%0A
     
@@ -1480,24 +1480,24 @@
 k;%0D%0A      %0D%0A
-
     default:
@@ -1498,16 +1498,85 @@
 fault:%0D%0A
+      System.out.println(%22Message couldn't be handled by Element%22);%0D%0A
       br

Add cases for picker, textField and textlabel creation