use of org.netxms.ui.eclipse.objectbrowser.dialogs.ChildObjectListDialog 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();
}
}
}
use of org.netxms.ui.eclipse.objectbrowser.dialogs.ChildObjectListDialog in project netxms by netxms.
the class RemoveClusterNode 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, clusterId, ChildObjectListDialog.createClassFilter(AbstractObject.OBJECT_NODE));
dlg.open();
if (dlg.getReturnCode() == Window.OK) {
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().RemoveClusterNode_JobTitle, viewPart, Activator.PLUGIN_ID, null) {
@Override
protected String getErrorMessage() {
return Messages.get().RemoveClusterNode_JobError;
}
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
List<AbstractObject> objects = dlg.getSelectedObjects();
for (int i = 0; i < objects.size(); i++) session.removeClusterNode(clusterId, objects.get(i).getObjectId());
}
}.start();
}
}
use of org.netxms.ui.eclipse.objectbrowser.dialogs.ChildObjectListDialog in project netxms by netxms.
the class UnbindObject 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);
dlg.open();
if (dlg.getReturnCode() == Window.OK) {
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().UnbindObject_JobTitle, viewPart, Activator.PLUGIN_ID, null) {
@Override
protected String getErrorMessage() {
return Messages.get().UnbindObject_JobError;
}
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
List<AbstractObject> objects = dlg.getSelectedObjects();
for (int i = 0; i < objects.size(); i++) session.unbindObject(parentId, objects.get(i).getObjectId());
}
}.start();
}
}
Aggregations