use of org.netxms.ui.eclipse.objectmanager.dialogs.CreateChassisDialog in project netxms by netxms.
the class CreateChassis method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
CreateChassisDialog dlg = null;
do {
dlg = new CreateChassisDialog(window.getShell(), dlg);
if (dlg.open() != Window.OK)
return;
final NXCObjectCreationData cd = new NXCObjectCreationData(AbstractObject.OBJECT_CHASSIS, dlg.getObjectName(), parentId);
cd.setControllerId(dlg.getControllerId());
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob("Creating chassis", part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format("Cannot create chassis object %s", cd.getName());
}
}.start();
} while (dlg.isShowAgain());
}
Aggregations