Search in sources :

Example 1 with TableConditionsEditor

use of org.netxms.ui.eclipse.datacollection.widgets.TableConditionsEditor in project netxms by netxms.

the class EditTableThresholdDialog 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.DIALOG_SPACING;
    dialogArea.setLayout(layout);
    activationEvent = new EventSelector(dialogArea, SWT.NONE);
    activationEvent.setLabel(Messages.get().EditTableThresholdDialog_ActivationEvent);
    activationEvent.setEventCode(threshold.getActivationEvent());
    activationEvent.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deactivationEvent = new EventSelector(dialogArea, SWT.NONE);
    deactivationEvent.setLabel(Messages.get().EditTableThresholdDialog_DeactivationEvent);
    deactivationEvent.setEventCode(threshold.getDeactivationEvent());
    deactivationEvent.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    sampleCount = new LabeledSpinner(dialogArea, SWT.NONE);
    sampleCount.setLabel("Sample count");
    sampleCount.setRange(1, 100000);
    sampleCount.setSelection(threshold.getSampleCount());
    new Label(dialogArea, SWT.NONE).setText(Messages.get().EditTableThresholdDialog_Conditions);
    conditionsEditor = new TableConditionsEditor(dialogArea, SWT.BORDER, columnCallback);
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.widthHint = 700;
    gd.heightHint = 400;
    conditionsEditor.setLayoutData(gd);
    conditionsEditor.setConditions(threshold.getConditions());
    return dialogArea;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) EventSelector(org.netxms.ui.eclipse.eventmanager.widgets.EventSelector) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) TableConditionsEditor(org.netxms.ui.eclipse.datacollection.widgets.TableConditionsEditor) LabeledSpinner(org.netxms.ui.eclipse.widgets.LabeledSpinner)

Aggregations

GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 TableConditionsEditor (org.netxms.ui.eclipse.datacollection.widgets.TableConditionsEditor)1 EventSelector (org.netxms.ui.eclipse.eventmanager.widgets.EventSelector)1 LabeledSpinner (org.netxms.ui.eclipse.widgets.LabeledSpinner)1