use of org.netxms.ui.eclipse.serverconfig.views.helpers.ScheduleTableEntryLabelProvider in project netxms by netxms.
the class ScheduledTaskView method createPartControl.
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
final int[] widths = { 50, 100, 200, 400, 150, 150, 100, 200, 250, 200 };
final String[] names = { "Id", "Schedule Type", "Object", "Parameters", "Execution time", "Last execution time", "Execution status", "Administrative status", "Owner", "Comments" };
viewer = new SortableTableViewer(parent, names, widths, SCHEDULE_ID, SWT.UP, SWT.FULL_SELECTION | SWT.MULTI);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setLabelProvider(new ScheduleTableEntryLabelProvider());
viewer.setComparator(new ScheduleTableEntryComparator());
viewer.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
actionEdit.run();
}
});
WidgetHelper.restoreTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), "ScheduledTasks");
viewer.getControl().addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
WidgetHelper.saveTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), "ScheduledTasks");
}
});
activateContext();
createActions();
contributeToActionBars();
createPopupMenu();
refresh();
final Display display = getSite().getShell().getDisplay();
listener = new SessionListener() {
@Override
public void notificationHandler(SessionNotification n) {
if (n.getCode() == SessionNotification.SCHEDULE_UPDATE) {
display.asyncExec(new Runnable() {
@Override
public void run() {
refresh();
}
});
}
}
};
session.addListener(listener);
}
Aggregations