use of org.netxms.ui.eclipse.objectmanager.dialogs.ClusterNetworkEditDialog in project netxms by netxms.
the class ClusterNetworks method editNetwork.
/**
* Edit currently selected network
*/
private void editNetwork() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() != 1)
return;
InetAddressEx n = (InetAddressEx) selection.getFirstElement();
ClusterNetworkEditDialog dlg = new ClusterNetworkEditDialog(getShell(), n.getAddress(), n.maskFromBits());
if (dlg.open() == Window.OK) {
n.setAddress(dlg.getAddress());
n.setMask(InetAddressEx.bitsInMask(dlg.getMask()));
viewer.update(n, null);
isModified = true;
}
}
use of org.netxms.ui.eclipse.objectmanager.dialogs.ClusterNetworkEditDialog in project netxms by netxms.
the class ClusterNetworks method addNetwork.
/**
* Add new cluster network
*/
private void addNetwork() {
ClusterNetworkEditDialog dlg = new ClusterNetworkEditDialog(getShell(), null, null);
if (dlg.open() == Window.OK) {
InetAddressEx n = new InetAddressEx(dlg.getAddress(), dlg.getMask());
networks.add(n);
viewer.setInput(networks.toArray());
viewer.setSelection(new StructuredSelection(n));
isModified = true;
}
}
Aggregations