use of org.netxms.ui.eclipse.widgets.DateTimeSelector in project netxms by netxms.
the class HistoricalDataSelectionDialog method createDialogArea.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.numColumns = 3;
dialogArea.setLayout(layout);
radioLastRecords = new Button(dialogArea, SWT.RADIO);
radioLastRecords.setText(Messages.get().HistoricalDataSelectionDialog_LastRecords);
GridData gd = new GridData();
gd.horizontalSpan = 3;
radioLastRecords.setLayoutData(gd);
radioLastRecords.setSelection(maxRecords != 0);
spinnerRecords = new Spinner(dialogArea, SWT.BORDER);
spinnerRecords.setMinimum(1);
spinnerRecords.setMaximum(65535);
spinnerRecords.setSelection(maxRecords);
gd = new GridData();
gd.horizontalSpan = 3;
spinnerRecords.setLayoutData(gd);
spinnerRecords.setEnabled(radioLastRecords.getSelection());
radioTimeFrame = new Button(dialogArea, SWT.RADIO);
radioTimeFrame.setText(Messages.get().HistoricalDataSelectionDialog_TimeFrame);
gd = new GridData();
gd.horizontalSpan = 3;
gd.verticalIndent = 5;
radioTimeFrame.setLayoutData(gd);
radioTimeFrame.setSelection(maxRecords == 0);
dtsFrom = new DateTimeSelector(dialogArea, SWT.NONE);
dtsFrom.setValue(timeFrom);
dtsFrom.setEnabled(radioTimeFrame.getSelection());
// $NON-NLS-1$
new Label(dialogArea, SWT.NONE).setText(" - ");
dtsTo = new DateTimeSelector(dialogArea, SWT.NONE);
dtsTo.setValue(timeTo);
dtsTo.setEnabled(radioTimeFrame.getSelection());
final SelectionListener listener = new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
spinnerRecords.setEnabled(radioLastRecords.getSelection());
dtsFrom.setEnabled(radioTimeFrame.getSelection());
dtsTo.setEnabled(radioTimeFrame.getSelection());
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
};
radioLastRecords.addSelectionListener(listener);
radioTimeFrame.addSelectionListener(listener);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.DateTimeSelector in project netxms by netxms.
the class RerunTimeDialog method createDialogArea.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
final Composite dialogArea = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.numColumns = 2;
dialogArea.setLayout(layout);
final WidgetFactory factory = new WidgetFactory() {
@Override
public Control createControl(Composite parent, int style) {
return new DateTimeSelector(parent, style);
}
};
dateSelector = (DateTimeSelector) WidgetHelper.createLabeledControl(dialogArea, SWT.NONE, factory, "New execution time", WidgetHelper.DEFAULT_LAYOUT_DATA);
dateSelector.setValue(new Date());
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.DateTimeSelector in project netxms by netxms.
the class MaintanenceScheduleDialog method createDialogArea.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.verticalSpacing = WidgetHelper.OUTER_SPACING;
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.numColumns = 2;
dialogArea.setLayout(layout);
labelStartDate = new Label(dialogArea, SWT.NONE);
labelStartDate.setText(Messages.get().MaintanenceScheduleDialog_StartDate);
startDateSelector = new DateTimeSelector(dialogArea, SWT.NONE);
startDateSelector.setValue(new Date());
startDateSelector.setToolTipText(Messages.get().MaintanenceScheduleDialog_StartDate);
labelEndDate = new Label(dialogArea, SWT.NONE);
labelEndDate.setText(Messages.get().MaintanenceScheduleDialog_EndDate);
endDateSelector = new DateTimeSelector(dialogArea, SWT.NONE);
endDateSelector.setValue(new Date());
startDateSelector.setToolTipText(Messages.get().MaintanenceScheduleDialog_EndDate);
return dialogArea;
}
Aggregations