EventManager.subscribe(project, TransactionListener.TOPIC, this);
}
private void updateListModel() {
DefaultListModel model = new DefaultListModel();
ConnectionManager connectionManager = ConnectionManager.getInstance(project);
for (ConnectionBundle connectionBundle : connectionManager.getConnectionBundles()) {
for (ConnectionHandler connectionHandler : connectionBundle.getConnectionHandlers()) {
if (connectionHandler.hasUncommittedChanges()) {
connectionHandlers.add(connectionHandler);
model.addElement(connectionHandler);
}
}
}
connectionsList.setModel(model);
if (model.size() > 0) {
connectionsList.setSelectedIndex(0);
}
}