use of org.netxms.ui.eclipse.slm.dialogs.CreateServiceCheckDialog in project netxms by netxms.
the class CreateServiceCheckTemplate 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().CreateServiceCheckTemplate_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(true);
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format(Messages.get().CreateServiceCheckTemplate_JobError, dlg.getName());
}
}.start();
}
use of org.netxms.ui.eclipse.slm.dialogs.CreateServiceCheckDialog 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();
}
Aggregations