use of org.netxms.ui.eclipse.objectmanager.dialogs.CreateZoneDialog in project netxms by netxms.
the class CreateZone method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
final CreateZoneDialog dlg = new CreateZoneDialog(window.getShell());
if (dlg.open() != Window.OK)
return;
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().CreateZone_JobTitle, part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
NXCObjectCreationData cd = new NXCObjectCreationData(AbstractObject.OBJECT_ZONE, dlg.getName(), parentId);
cd.setZoneUIN(dlg.getZoneUIN());
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format(Messages.get().CreateZone_JobError, dlg.getName());
}
}.start();
}
Aggregations