use of org.netxms.ui.eclipse.objectmanager.wizards.CreateSensorWizard in project netxms by netxms.
the class CreateSensor method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
// Create wizard - first page with overall information and communication type, second page with communication details
final CreateSensorWizard creationWizard = new CreateSensorWizard(parentId);
WizardDialog dlg = new WizardDialog(window.getShell(), creationWizard);
if (dlg.open() != Window.OK)
return;
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob("Create Sensor", part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
session.createObject(creationWizard.getCreationData());
}
@Override
protected String getErrorMessage() {
return String.format("Create sensor %s", creationWizard.getCreationData().getName());
}
}.start();
}
Aggregations