use of org.netxms.client.NXCObjectCreationData in project netxms by netxms.
the class CreateMapGroup method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
final CreateObjectDialog dlg = new CreateObjectDialog(window.getShell(), Messages.get().CreateMapGroup_DialogTitle);
if (dlg.open() != Window.OK)
return;
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().CreateMapGroup_JobName, part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
NXCObjectCreationData cd = new NXCObjectCreationData(AbstractObject.OBJECT_NETWORKMAPGROUP, dlg.getObjectName(), parentId);
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format(Messages.get().CreateMapGroup_JobError, dlg.getObjectName());
}
}.start();
}
use of org.netxms.client.NXCObjectCreationData in project netxms by netxms.
the class CreateServiceCheck method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
final CreateServiceCheckDialog dlg = new CreateServiceCheckDialog(window.getShell());
if (dlg.open() != Window.OK)
return;
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().CreateServiceCheck_JobTitle, part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
NXCObjectCreationData cd = new NXCObjectCreationData(AbstractObject.OBJECT_SLMCHECK, dlg.getName(), parentId);
cd.setTemplate(false);
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format(Messages.get().CreateServiceCheck_JobError, dlg.getName());
}
}.start();
}
use of org.netxms.client.NXCObjectCreationData in project netxms by netxms.
the class CreateNodeLink method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
final CreateNodeLinkDialog dlg = new CreateNodeLinkDialog(window.getShell());
if (dlg.open() != Window.OK)
return;
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().CreateNodeLink_JobTitle, part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
NXCObjectCreationData cd = new NXCObjectCreationData(AbstractObject.OBJECT_NODELINK, dlg.getName(), parentId);
cd.setLinkedNodeId(dlg.getNodeId());
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format(Messages.get().CreateNodeLink_JobError, dlg.getName());
}
}.start();
}
Aggregations