}
}
});*/
configurationList.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {
final PropertyInfo configuration = (PropertyInfo)configurationList.getSelectedValue();
if (configuration != null) {
String name = configuration.getName();
if (name != null)
nameLabel.setText(name);
else
nameLabel.setText("");
}
editButton.setEnabled(configuration != null);
}
});
JButton resetButton = new JButton("刷新", Images.getIcon("refresh.gif"));
resetButton.setToolTipText("刷新配置列表");
toolBar.add(resetButton);
resetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
refreshConfigurationList();
JOptionPane.showMessageDialog(ConfigurationPane.this, "刷新配置列表成功!", "刷新配置列表", JOptionPane.INFORMATION_MESSAGE);
} catch (Throwable t) {
JOptionPane.showMessageDialog(ConfigurationPane.this, "刷新配置列表失败! 原因: " + t.getMessage(), "刷新配置列表", JOptionPane.WARNING_MESSAGE);
}
}
});
try {
refreshConfigurationList();
} catch (Throwable t) {
// ignore
}
configurationListener = new ConfigurationDelegate(new PropertyAdapter() {
public void onPropertyChanged(final PropertyEvent event) {
PropertyInfo configuration = event.getPropertyInfo();
synchronized (configurationModel) {
configurationModel.removeElement(configuration);
configurationModel.addElement(configuration);
}
}