use of org.netxms.ui.eclipse.datacollection.views.SummaryTable in project netxms by netxms.
the class SummaryTablesDynamicMenu method queryTable.
/**
* Query table using selected base object
*
* @param baseObjectId
* @param tableId
*/
private void queryTable(final long baseObjectId, final int tableId) {
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
new ConsoleJob(Messages.get().SummaryTablesDynamicMenu_QueryTableJob, null, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
final Table results = session.queryDciSummaryTable(tableId, baseObjectId);
runInUIThread(new Runnable() {
@Override
public void run() {
// $NON-NLS-1$
String secondaryId = Integer.toString(tableId) + "&" + Long.toString(baseObjectId);
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
try {
SummaryTable view = (SummaryTable) window.getActivePage().showView(SummaryTable.ID, secondaryId, IWorkbenchPage.VIEW_ACTIVATE);
view.setTable(results);
} catch (PartInitException e) {
MessageDialogHelper.openError(window.getShell(), Messages.get().SummaryTablesDynamicMenu_Error, String.format(Messages.get().SummaryTablesDynamicMenu_CannotOpenView, e.getLocalizedMessage()));
}
}
});
}
@Override
protected String getErrorMessage() {
return Messages.get().SummaryTablesDynamicMenu_CannotReadData;
}
}.start();
}
Aggregations