use of org.netxms.ui.eclipse.reporter.widgets.helpers.ReportResultLabelProvider in project netxms by netxms.
the class ReportExecutionForm method createResultsSection.
/**
* Create "Results" section's content
*
* @param parent
* parent composite
*/
private void createResultsSection(Composite parent) {
GridLayout layout = new GridLayout();
parent.setLayout(layout);
final String[] names = { "Execution Time", "Started by", "Status" };
final int[] widths = { 180, 140, 100 };
resultList = new SortableTableViewer(parent, names, widths, 0, SWT.DOWN, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
resultList.getControl().setLayoutData(gd);
resultList.setContentProvider(new ArrayContentProvider());
resultList.setLabelProvider(new ReportResultLabelProvider());
WidgetHelper.restoreTableViewerSettings(resultList, Activator.getDefault().getDialogSettings(), "ReportExecutionForm.ResultList");
resultList.getControl().addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
WidgetHelper.saveTableViewerSettings(resultList, Activator.getDefault().getDialogSettings(), "ReportExecutionForm.ResultList");
}
});
ImageHyperlink link = toolkit.createImageHyperlink(parent, SWT.WRAP);
link.setImage(SharedIcons.IMG_EXECUTE);
link.setText("Execute Report");
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
executeReport();
}
});
createResultsContextMenu();
resultList.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) resultList.getSelection();
actionDeleteResult.setEnabled(selection.size() > 0);
actionRenderPDF.setEnabled(selection.size() == 1);
actionRenderXLS.setEnabled(selection.size() == 1);
}
});
}
Aggregations