use of org.netxms.ui.eclipse.reporter.widgets.helpers.ScheduleLabelProvider in project netxms by netxms.
the class ReportExecutionForm method createSchedulesSection.
/**
* Create "Schedules" section's content
*
* @param parent
* parent composite
*/
/**
* @param section
* @return
*/
private void createSchedulesSection(Composite parent) {
GridLayout layout = new GridLayout();
parent.setLayout(layout);
final String[] names = { "Type", "Schedule", "Owner", "Comments" };
final int[] widths = { 100, 140, 100, 300 };
scheduleList = 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;
scheduleList.getControl().setLayoutData(gd);
scheduleList.setContentProvider(new ArrayContentProvider());
scheduleList.setLabelProvider(new ScheduleLabelProvider());
WidgetHelper.restoreTableViewerSettings(scheduleList, Activator.getDefault().getDialogSettings(), "ReportExecutionForm.ScheduleList");
scheduleList.getControl().addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
WidgetHelper.saveTableViewerSettings(scheduleList, Activator.getDefault().getDialogSettings(), "ReportExecutionForm.ScheduleList");
}
});
ImageHyperlink link = toolkit.createImageHyperlink(parent, SWT.WRAP);
// $NON-NLS-1$
link.setImage(imageCache.add(Activator.getImageDescriptor("icons/schedule.png")));
link.setText("Add Schedule");
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
addSchedule();
}
});
createSchedulesContextMenu();
scheduleList.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) scheduleList.getSelection();
actionDeleteSchedule.setEnabled(selection.size() > 0);
}
});
}
Aggregations