package com.sometrik.framework;

import java.util.ArrayList;

import android.content.Context;
import android.view.View;
import android.widget.TableLayout;
import android.widget.TableRow;

public class FWTable extends TableLayout implements NativeCommandHandler {
  
  Context context;
  int columnCount = 1;
  ArrayList<TableRow> rowList;
  ArrayList<View> dataList;
  
  public FWTable(Context context) {
    super(context);
    this.context = context;
    rowList = new ArrayList<TableRow>();
    rowList.add(new TableRow(context));
    dataList = new ArrayList<View>();
  }
  
  private TableRow getCurrentRow(){
    if (dataList.size() / columnCount > rowList.size()){
      TableRow row = new TableRow(context);
      rowList.add(row);
      return row;
    } else {
      TableRow row = rowList.get(rowList.size() - 1);
      return new TableRow(context);
    }
  }
  
  public void setColumnCount(int columnCount) { this.columnCount = columnCount; };



@Override
public void addChild(View view) {
  TableRow row = getCurrentRow();
  row.addView(view);
  dataList.add(view);
}

@Override
public void showView() {
  System.out.println("FWTable couldn't handle showView command");
}

@Override
public void addOption(int position, String text) {
}

@Override
public int getElementId() {
  return getId();
}

@Override
public void removeChild(int id) {
  // TODO Auto-generated method stub
  
}



}

@@ -113,16 +113,48 @@
 w.View;%0A
+import android.view.ViewParent;%0A
 import a
@@ -293,31 +293,31 @@
  %7B%0A  %0A  
-Context context
+FrameWork frame
 ;%0A  int 
@@ -455,21 +455,16 @@
 t);%0A    
-this.
 context 
@@ -465,16 +465,27 @@
 ntext = 
+(FrameWork)
 context;
@@ -734,31 +734,29 @@
 ew TableRow(
-context
+frame
 );%0A      row
@@ -881,23 +881,21 @@
 ableRow(
-context
+frame
 );%0A    %7D
@@ -987,17 +987,18 @@
 t; %7D;%0A%0A%0A
-%0A
+  
 @Overrid
@@ -991,32 +991,34 @@
 ;%0A%0A%0A  @Override%0A
+  
 public void addC
@@ -1037,16 +1037,18 @@
 ew) %7B%0A  
+ 
+ 
 TableRow
@@ -1071,16 +1071,18 @@
 tRow();%0A
+  
   row.ad
@@ -1094,16 +1094,18 @@
 (view);%0A
+  
   dataLi
@@ -1118,19 +1118,23 @@
 (view);%0A
+  
 %7D%0A%0A
+  
 @Overrid
@@ -1127,32 +1127,34 @@
  %7D%0A%0A  @Override%0A
+  
 public void show
@@ -1168,72 +1168,40 @@
 %7B%0A  
-System.out.println(%22FWTable couldn't handle showView command%22
+  frame.setCurrentView(this
 );%0A
+  
 %7D%0A%0A@

Modify context variable and add showView code