public void doLayout(DataViewer parent_viewer) {
try {
DataModel parent_model = parent_viewer.getDataModel();
// look for the associated model
Viewable model = parent_model.getViewableChild(getModelFieldName());
DataViewer viewer = null;
if (viewerCreator == null) {
viewer = parent_viewer.getFactory().createViewer(model, parent_viewer.isEditor());
} else {
viewer = parent_viewer.getFactory().createViewer(viewerCreator, model);
}
// layout the associated model
viewer.setLayout(layout);
// create a JComponent from the associated viewer
JComponent comp = viewer.getJComponent();
parent_viewer.add(comp);
if (createLabel) {
createFieldName(parent_viewer.getFactory(), model.getFieldName(), comp);
}
// move and resize the JComponent
defaultLayout(comp, parent_viewer.getFactory());