2
0
Fork 0

[svn r271] removed small bug

This commit is contained in:
willemc 2007-08-15 22:47:38 +02:00
parent 56c4fad429
commit 48fbf1d48d
2 changed files with 26 additions and 26 deletions

View file

@ -177,7 +177,7 @@ public class SwingVascViewRenderer implements VascViewRenderer {
private Object result = null; private Object result = null;
private Object bean = 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(); super();
this.headerText = headerText; this.headerText = headerText;
this.title = title; this.title = title;
@ -230,7 +230,7 @@ public class SwingVascViewRenderer implements VascViewRenderer {
header.add(l); header.add(l);
} }
public void createBody(JPanel body) { public void createBody(JPanel body) throws Exception {
body.setLayout(new SpringLayout()); body.setLayout(new SpringLayout());
for(VascTableColumn c:table.getTableColumns()) { for(VascTableColumn c:table.getTableColumns()) {
JLabel l = new JLabel(); JLabel l = new JLabel();
@ -242,7 +242,6 @@ public class SwingVascViewRenderer implements VascViewRenderer {
} }
body.add(l); body.add(l);
try {
table.getVascTableController().initEditObjectColumn(c, bean); table.getVascTableController().initEditObjectColumn(c, bean);
if(c.getVascUIComponent()==null) { if(c.getVascUIComponent()==null) {
@ -259,9 +258,6 @@ public class SwingVascViewRenderer implements VascViewRenderer {
comp.createComponent(table, model, body); comp.createComponent(table, model, body);
c.setColumnEditor(comp); c.setColumnEditor(comp);
} }
} catch (Exception e) {
logger.log(Level.WARNING,"Error making column editor: '"+c.getVascColumnValue()+"' error: "+e.getMessage(),e);
}
} }
//JComponent, rows, cols, initX, initY ,xPad, yPad //JComponent, rows, cols, initX, initY ,xPad, yPad
SpringUtilities.makeCompactGrid(body, table.getTableColumns().size(),2, 6,6, 6,6); SpringUtilities.makeCompactGrid(body, table.getTableColumns().size(),2, 6,6, 6,6);

View file

@ -58,14 +58,18 @@ public class SwingList extends AbstractVascUIComponent {
public Object createComponent(VascTable table,final VascValueModel model,Object gui) throws Exception { public Object createComponent(VascTable table,final VascValueModel model,Object gui) throws Exception {
VascList l = (VascList)getWrapper(); VascList l = (VascList)getWrapper();
final JComboBox def = new JComboBox(l.getVascSelectItemModel().getVascSelectItems().toArray()); JComboBox def;
if (l.getVascSelectItemModel()==null) {
def = new JComboBox();
} else {
def = new JComboBox(l.getVascSelectItemModel().getVascSelectItems().toArray());
}
((JComponent)gui).add(def); ((JComponent)gui).add(def);
def.setRenderer(new MyCellRenderer()); def.setRenderer(new MyCellRenderer());
def.addActionListener(new ActionListener() { def.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
VascSelectItem i = (VascSelectItem)def.getSelectedItem(); VascSelectItem i = (VascSelectItem)((JComboBox)e.getSource()).getSelectedItem();
System.out.println("Setting value: "+i.getLabel()+" value: "+i.getValue());
model.setValue(i.getValue()); model.setValue(i.getValue());
} }
}); });