[svn r271] removed small bug
This commit is contained in:
parent
56c4fad429
commit
48fbf1d48d
2 changed files with 26 additions and 26 deletions
|
|
@ -177,7 +177,7 @@ public class SwingVascViewRenderer implements VascViewRenderer {
|
|||
private Object result = null;
|
||||
private Object bean = null;
|
||||
|
||||
public SwingEditDialog(JComponent parent,VascTable table,Object bean,String title,String headerText) {
|
||||
public SwingEditDialog(JComponent parent,VascTable table,Object bean,String title,String headerText) throws Exception {
|
||||
super();
|
||||
this.headerText = headerText;
|
||||
this.title = title;
|
||||
|
|
@ -230,7 +230,7 @@ public class SwingVascViewRenderer implements VascViewRenderer {
|
|||
header.add(l);
|
||||
}
|
||||
|
||||
public void createBody(JPanel body) {
|
||||
public void createBody(JPanel body) throws Exception {
|
||||
body.setLayout(new SpringLayout());
|
||||
for(VascTableColumn c:table.getTableColumns()) {
|
||||
JLabel l = new JLabel();
|
||||
|
|
@ -242,27 +242,23 @@ public class SwingVascViewRenderer implements VascViewRenderer {
|
|||
}
|
||||
body.add(l);
|
||||
|
||||
try {
|
||||
table.getVascTableController().initEditObjectColumn(c, bean);
|
||||
|
||||
if(c.getVascUIComponent()==null) {
|
||||
JLabel valueLabel = new JLabel();
|
||||
valueLabel.setText(""+c.getVascColumnValue().getValue(c, bean));
|
||||
c.setColumnEditor(valueLabel);
|
||||
body.add(valueLabel);
|
||||
} else {
|
||||
//c.setColumnEditor(c.getVascColumnEditor().createColumnEditor(c,bean,body));
|
||||
VascUIComponent comp = c.getVascUIComponent();
|
||||
VascValueModel model = new VascValueModel();
|
||||
model.setValue(c.getVascColumnValue().getValue(c, bean));
|
||||
model.addListener(new VascColumnValueModelListener(c,bean));
|
||||
comp.createComponent(table, model, body);
|
||||
c.setColumnEditor(comp);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING,"Error making column editor: '"+c.getVascColumnValue()+"' error: "+e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
table.getVascTableController().initEditObjectColumn(c, bean);
|
||||
|
||||
if(c.getVascUIComponent()==null) {
|
||||
JLabel valueLabel = new JLabel();
|
||||
valueLabel.setText(""+c.getVascColumnValue().getValue(c, bean));
|
||||
c.setColumnEditor(valueLabel);
|
||||
body.add(valueLabel);
|
||||
} else {
|
||||
//c.setColumnEditor(c.getVascColumnEditor().createColumnEditor(c,bean,body));
|
||||
VascUIComponent comp = c.getVascUIComponent();
|
||||
VascValueModel model = new VascValueModel();
|
||||
model.setValue(c.getVascColumnValue().getValue(c, bean));
|
||||
model.addListener(new VascColumnValueModelListener(c,bean));
|
||||
comp.createComponent(table, model, body);
|
||||
c.setColumnEditor(comp);
|
||||
}
|
||||
}
|
||||
//JComponent, rows, cols, initX, initY ,xPad, yPad
|
||||
SpringUtilities.makeCompactGrid(body, table.getTableColumns().size(),2, 6,6, 6,6);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue