use of org.netxms.ui.eclipse.objectmanager.dialogs.CreateNetworkServiceDialog in project netxms by netxms.
the class CreateNetworkService method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
final CreateNetworkServiceDialog dlg = new CreateNetworkServiceDialog(window.getShell());
if (dlg.open() != Window.OK)
return;
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().CreateNetworkService_JobTitle, part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
NXCObjectCreationData cd = new NXCObjectCreationData(AbstractObject.OBJECT_NETWORKSERVICE, dlg.getName(), parentId);
cd.setServiceType(dlg.getServiceType());
cd.setIpPort(dlg.getPort());
cd.setRequest(dlg.getRequest());
cd.setResponse(dlg.getResponse());
cd.setCreateStatusDci(dlg.isCreateDci());
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format(Messages.get().CreateNetworkService_JobError, dlg.getName());
}
}.start();
}
Aggregations