item.setLayout(new FlowLayout());
JLabel label = new JLabel(nodeLabel.getTextContent());
label.setPreferredSize(new Dimension(100, 22));
Input input = new Input();
input.setPreferredSize(new Dimension(255, 22));
JButton button = new JButton(nodeRef.getTextContent());
button.setPreferredSize(new Dimension(40, 22));
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
try
{
JButton source = (JButton) e.getSource();
String key = source.getText();
if(referenceFields.containsKey(key))
{
ReferenceItem item = referenceFields.get(key);
SearchPanel panel = item.getPanel();
if(panel == null)
{
panel = new SearchPanel(item);
item.setPanel(panel);
}
panel.setVisible(true);
panel.toFront();
}
}
catch(Exception ex)
{
logger.warning(ex.getMessage());
}
}
});
if(nodeValue != null)
{
input.setText(nodeValue.getTextContent());
}
if(nodeDisabled != null && nodeDisabled.getTextContent().equals("true"))
{
input.setEnabled(false);
}
item.add(label);
item.add(input);
item.add(button);