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