final StringBuilder vgNamesString = new StringBuilder();
final Map<Host, Set<String>> vgNames = getVGNames();
for (final Map.Entry<Host, Set<String>> entry : vgNames.entrySet()) {
final Host h = entry.getKey();
vgNamesString.append(h.getName()).append(": ");
final Set<String> vgs = entry.getValue();
vgNamesString.append(Tools.join(", ", vgs)).append(' ');
}
inputPane.add(new JLabel(vgNamesString.toString()));
removeButton.addActionListener(new RemoveActionListener());
inputPane.add(removeButton);
SpringUtilities.makeCompactGrid(inputPane, 1, 3, /* rows, cols */
1, 1, /* initX, initY */
1, 1); /* xPad, yPad */
pane.add(inputPane);
final JPanel bdPane = new JPanel(new FlowLayout(FlowLayout.LEADING));
bdPane.add(new JLabel("Block Devices: "));
final Collection<String> bds = new HashSet<String>();
final Collection<Host> selectedHosts = new HashSet<Host>();
for (final BlockDevInfo bdi : blockDevInfos) {
for (final BlockDevice bd : bdi.getHost().getBlockDevices()) {
final String thisVG = bd.getVgOnPhysicalVolume();
if (vgNames.get(bdi.getHost()).contains(thisVG)) {
bds.add(bd.getName());
}
}
if (bdi.getBlockDevice().isDrbd()) {
for (final BlockDevice bd : bdi.getHost().getDrbdBlockDevices()) {
final String thisVG = bd.getVgOnPhysicalVolume();
if (vgNames.get(bdi.getHost()).contains(thisVG)) {
bds.add(bd.getName());
}
}
}
selectedHosts.add(bdi.getHost());
}
bdPane.add(new JLabel(Tools.join(", ", bds)));
pane.add(bdPane);
final JPanel hostsPane = new JPanel(new FlowLayout(FlowLayout.LEADING));
final Host host = blockDevInfos.get(0).getHost();
final Cluster cluster = host.getCluster();
hostCheckBoxes = Tools.getHostCheckBoxes(cluster);
hostsPane.add(new JLabel("Select Hosts: "));
for (final Map.Entry<Host, JCheckBox> hostEntry : hostCheckBoxes.entrySet()) {
hostEntry.getValue().addItemListener(new ItemChangeListener(true));
if (host == hostEntry.getKey()) {