/** * Creates a generic panel that holds the basic bean information System Name, User Name and * Comment */ BeanItemPanel basicDetails() { BeanItemPanel basic = new BeanItemPanel(); basic.setName(Bundle.getMessage("Basic")); basic.setLayout(new BoxLayout(basic, BoxLayout.Y_AXIS)); basic.addItem( new BeanEditItem( new JLabel(bean.getSystemName()), Bundle.getMessage("ColumnSystemName"), null)); basic.addItem(new BeanEditItem(userNameField, Bundle.getMessage("ColumnUserName"), null)); basic.addItem(new BeanEditItem(commentFieldScroller, Bundle.getMessage("ColumnComment"), null)); basic.setSaveItem( new AbstractAction() { /** */ private static final long serialVersionUID = -1823311798750191527L; public void actionPerformed(ActionEvent e) { saveBasicItems(e); } }); basic.setResetItem( new AbstractAction() { /** */ private static final long serialVersionUID = 2590436299984618901L; public void actionPerformed(ActionEvent e) { resetBasicItems(e); } }); bei.add(basic); return basic; }
BeanItemPanel propertiesDetails() { BeanItemPanel properties = new BeanItemPanel(); properties.setName(Bundle.getMessage("Properties")); properties.addItem( new BeanEditItem(null, null, Bundle.getMessage("NamedBeanPropertiesTableDescription"))); properties.setLayout(new BoxLayout(properties, BoxLayout.Y_AXIS)); propertiesModel = new BeanPropertiesTableModel(); JTable jtAttributes = new JTable(); jtAttributes.setModel(propertiesModel); JScrollPane jsp = new JScrollPane(jtAttributes); Dimension tableDim = new Dimension(400, 200); jsp.setMinimumSize(tableDim); jsp.setMaximumSize(tableDim); jsp.setPreferredSize(tableDim); properties.addItem(new BeanEditItem(jsp, "", null)); properties.setSaveItem( new AbstractAction() { /** */ private static final long serialVersionUID = -5627203723098157467L; public void actionPerformed(ActionEvent e) { propertiesModel.updateModel(bean); } }); properties.setResetItem( new AbstractAction() { /** */ private static final long serialVersionUID = -956489116413677732L; public void actionPerformed(ActionEvent e) { propertiesModel.setModel(bean); } }); bei.add(properties); return properties; }