use of org.netxms.ui.eclipse.objectmanager.dialogs.CreateInterfaceDialog in project netxms by netxms.
the class CreateInterface method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
final CreateInterfaceDialog dlg = new CreateInterfaceDialog(window.getShell());
if (dlg.open() != Window.OK)
return;
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().CreateInterface_JobTitle, part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
NXCObjectCreationData cd = new NXCObjectCreationData(AbstractObject.OBJECT_INTERFACE, dlg.getName(), parentId);
cd.setMacAddress(dlg.getMacAddress());
cd.setIpAddress(dlg.getIpAddress());
cd.setPhysicalPort(dlg.isPhysicalPort());
cd.setSlot(dlg.getSlot());
cd.setPort(dlg.getPort());
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format(Messages.get().CreateInterface_JobError, dlg.getName());
}
}.start();
}
Aggregations