private void addActualUnitField(GridLayout innerLayout, int index, Field field) {
   GridLayout actualLayout = (GridLayout) innerLayout.getComponent(2, 0);
   if (actualLayout != null) {
     if (actualLayout.getComponent(1, index) == null) {
       actualLayout.addComponent(field, 1, index, 1, index);
     }
   }
 }
 private void addCaptionLabel(GridLayout innerLayout, int index, Label label) {
   GridLayout captionLayout = (GridLayout) innerLayout.getComponent(0, 0);
   if (captionLayout != null) {
     if (captionLayout.getComponent(0, index) == null) {
       captionLayout.addComponent(label, 0, index, 0, index);
     }
   }
 }
 private void addExpectedUnitField(GridLayout innerLayout, int index, Field field) {
   GridLayout expectedLayout = (GridLayout) innerLayout.getComponent(1, 0);
   if (expectedLayout != null) {
     if (expectedLayout.getComponent(1, index) == null) {
       expectedLayout.addComponent(field, 1, index, 1, index);
     }
   }
 }
 private void allocateIndex(GridLayout innerLayout, int index) {
   GridLayout captionLayout = (GridLayout) innerLayout.getComponent(0, 0);
   GridLayout expectedLayout = (GridLayout) innerLayout.getComponent(1, 0);
   GridLayout actualLayout = (GridLayout) innerLayout.getComponent(2, 0);
   if (captionLayout != null && expectedLayout != null && actualLayout != null) {
     if (captionLayout.getRows() <= index) {
       captionLayout.setRows(index + 1);
     }
     if (expectedLayout.getRows() <= index) {
       expectedLayout.setRows(index + 1);
     }
     if (actualLayout.getRows() <= index) {
       actualLayout.setRows(index + 1);
     }
   }
 }
 private int getNextIndex(GridLayout innerLayout) {
   GridLayout expectedLayout = (GridLayout) innerLayout.getComponent(1, 0);
   if (expectedLayout != null) {
     return expectedLayout.getRows();
   } else {
     return -1;
   }
 }