@Override
protected JComponent getInputPane() {
/* Hosts */
final ScrollableFlowPanel p1 = new ScrollableFlowPanel(new FlowLayout(FlowLayout.LEADING, 1, 1));
final Hosts hosts = allHosts;
final ItemListener chListener = new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
checkCheckBoxes();
}
};
Host lastHost1 = null;
Host lastHost2 = null;
if (getCluster().getHosts().isEmpty()) {
/* mark last two available hosts */
for (final Host host : hosts.getHostsArray()) {
if (!getCluster().getHosts().contains(host)
&& !host.isInCluster()) {
if (lastHost2 != null
&& lastHost2.getIpAddress() != null
&& lastHost2.getIpAddress().equals(host.getIpAddress())) {
lastHost2 = host;
} else {
lastHost1 = lastHost2;
lastHost2 = host;
}
}
}
}
final JScrollPane sp = new JScrollPane(p1,
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
for (final Host host : hosts.getHostsArray()) {
final JCheckBox button = new JCheckBox(host.getName(), HOST_UNCHECKED_ICON);
button.setBackground(Tools.getDefaultColor("ConfigDialog.Background.Light"));
button.setSelectedIcon(HOST_CHECKED_ICON);
if (getCluster().getBrowser() != null && getCluster() == host.getCluster()) {
/* once we have browser the cluster members cannot be removed.