use of org.netxms.client.NXCObjectCreationData 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());
}
use of org.netxms.client.NXCObjectCreationData in project netxms by netxms.
the class CreateCondition method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
final CreateObjectDialog dlg = new CreateObjectDialog(window.getShell(), Messages.get().CreateCondition_Condition);
if (dlg.open() != Window.OK)
return;
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().CreateCondition_JobTitle, part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
NXCObjectCreationData cd = new NXCObjectCreationData(AbstractObject.OBJECT_CONDITION, dlg.getObjectName(), parentId);
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format(Messages.get().CreateCondition_JobError, dlg.getObjectName());
}
}.start();
}
use of org.netxms.client.NXCObjectCreationData 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();
}
use of org.netxms.client.NXCObjectCreationData 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();
}
use of org.netxms.client.NXCObjectCreationData in project netxms by netxms.
the class CreateTemplate method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
final CreateObjectDialog dlg = new CreateObjectDialog(window.getShell(), Messages.get().CreateTemplate_Template);
if (dlg.open() != Window.OK)
return;
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().CreateTemplate_JobTitle, part, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
NXCObjectCreationData cd = new NXCObjectCreationData(AbstractObject.OBJECT_TEMPLATE, dlg.getObjectName(), parentId);
session.createObject(cd);
}
@Override
protected String getErrorMessage() {
return String.format(Messages.get().CreateTemplate_JobError, dlg.getObjectName());
}
}.start();
}
Aggregations