use of org.netxms.ui.eclipse.objectmanager.dialogs.EditClusterResourceDialog in project netxms by netxms.
the class ClusterResources method editResource.
/**
* Edit currently selected resource
*/
private void editResource() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() != 1)
return;
ClusterResource r = (ClusterResource) selection.getFirstElement();
EditClusterResourceDialog dlg = new EditClusterResourceDialog(getShell(), r);
if (dlg.open() == Window.OK) {
r.setName(dlg.getName());
r.setVirtualAddress(dlg.getAddress());
viewer.update(r, null);
isModified = true;
}
}
use of org.netxms.ui.eclipse.objectmanager.dialogs.EditClusterResourceDialog in project netxms by netxms.
the class ClusterResources method addResource.
/**
* Add new cluster resource
*/
private void addResource() {
EditClusterResourceDialog dlg = new EditClusterResourceDialog(getShell(), null);
if (dlg.open() == Window.OK) {
// Find free resource ID
long id = 1;
for (ClusterResource r : resources) {
if (r.getId() >= id)
id = r.getId() + 1;
}
ClusterResource r = new ClusterResource(id, dlg.getName(), dlg.getAddress());
resources.add(r);
viewer.setInput(resources.toArray());
viewer.setSelection(new StructuredSelection(r));
isModified = true;
}
}
Aggregations