final Value[] proxyNetInterfaces = getNetInterfaces(pHost.getBrowser());
/* inside ip */
if (proxyNetInterfaces == null) {
//TODO: just textfield
}
final Widget iIpWi = widgetFactory.createInstance(
Widget.Type.COMBOBOX,
Widget.NO_DEFAULT,
proxyNetInterfaces,
Widget.NO_REGEXP,
rightWidth,
Widget.NO_ABBRV,
new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
Widget.NO_BUTTON);
iIpWi.setAlwaysEditable(!pHost.isConnected());
newInsideIpComboBoxHash.put(pHost, iIpWi);
final JLabel insideIpLabel = new JLabel(Tools.getString("ResourceInfo.ProxyInsideIp"));
iIpWi.setLabel(insideIpLabel, Tools.getString("ResourceInfo.ProxyInsideIp.ToolTip"));
final JPanel panel = new JPanel();
addField(panel, insideIpLabel, iIpWi.getComponent(), leftWidth, rightWidth, 0);
panel.setBackground(AppDefaults.LIGHT_ORANGE);
panel.setLayout(new SpringLayout());
sectionPanel.add(panel);
/* outside ip */
final Widget oIpWi = widgetFactory.createInstance(
Widget.Type.COMBOBOX,
Widget.NO_DEFAULT,
proxyNetInterfaces,
Widget.NO_REGEXP,
rightWidth,
Widget.NO_ABBRV,
new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
Widget.NO_BUTTON);
oIpWi.setAlwaysEditable(!pHost.isConnected());
newOutsideIpComboBoxHash.put(pHost, oIpWi);
final JLabel outsideIpLabel = new JLabel(Tools.getString("ResourceInfo.ProxyOutsideIp"));
oIpWi.setLabel(outsideIpLabel, Tools.getString("ResourceInfo.ProxyOutsideIp.ToolTip"));
addField(panel, outsideIpLabel, oIpWi.getComponent(), leftWidth, rightWidth, 0);
SpringUtilities.makeCompactGrid(panel, 2, 2, /* rows, cols */
1, 1, /* initX, initY */
1, 1); /* xPad, yPad */
optionsPanel.add(sectionPanel);
}
for (final Host host : getHosts()) {
final HostProxy hostProxy = dxml.getHostProxy(host.getName(), getName());
Value insideIpSaved = null;
Value outsideIpSaved = null;
final Host proxyHost;
if (hostProxy != null) {
insideIpSaved = hostProxy.getInsideIp();
outsideIpSaved = hostProxy.getOutsideIp();
proxyHost = getCluster().getProxyHostByName(hostProxy.getProxyHostName());
} else {
proxyHost = host;
}
final Widget iIpWi = newInsideIpComboBoxHash.get(proxyHost);
iIpWi.setValueAndWait(insideIpSaved);
iIpWi.setToolTipText(getToolTipText(null, iIpWi));
final Widget oIpWi = newOutsideIpComboBoxHash.get(proxyHost);
oIpWi.setValueAndWait(outsideIpSaved);
oIpWi.setToolTipText(getToolTipText(null, oIpWi));
}
}