use of org.netxms.ui.eclipse.datacollection.dialogs.DciRemoveConfirmationDialog in project netxms by netxms.
the class RemoveTemplate method run.
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
public void run(IAction action) {
final ChildObjectListDialog dlg = new ChildObjectListDialog(shell, parentId, null);
if (dlg.open() == Window.OK) {
final DciRemoveConfirmationDialog dlg2 = new DciRemoveConfirmationDialog(shell);
if (dlg2.open() == Window.OK) {
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().RemoveTemplate_JobTitle, viewPart, Activator.PLUGIN_ID, null) {
@Override
protected String getErrorMessage() {
return Messages.get().RemoveTemplate_JobError;
}
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
List<AbstractObject> objects = dlg.getSelectedObjects();
for (int i = 0; i < objects.size(); i++) session.removeTemplate(parentId, objects.get(i).getObjectId(), dlg2.getRemoveFlag());
}
}.start();
}
}
}
Aggregations