Search in sources :

Example 61 with LabeledText

use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.

the class EditEventTemplateDialog 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 = 2;
    layout.horizontalSpacing = WidgetHelper.OUTER_SPACING * 2;
    dialogArea.setLayout(layout);
    id = new LabeledText(dialogArea, SWT.NONE);
    id.setLabel(Messages.get().EditEventTemplateDialog_EventCode);
    id.setText(Long.toString(object.getCode()));
    id.getTextControl().setEditable(false);
    GridData gd = new GridData();
    // gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    severity = WidgetHelper.createLabeledCombo(dialogArea, SWT.DROP_DOWN | SWT.READ_ONLY, Messages.get().EditEventTemplateDialog_Severity, gd);
    severity.add(StatusDisplayInfo.getStatusText(Severity.NORMAL));
    severity.add(StatusDisplayInfo.getStatusText(Severity.WARNING));
    severity.add(StatusDisplayInfo.getStatusText(Severity.MINOR));
    severity.add(StatusDisplayInfo.getStatusText(Severity.MAJOR));
    severity.add(StatusDisplayInfo.getStatusText(Severity.CRITICAL));
    severity.select(object.getSeverity().getValue());
    name = new LabeledText(dialogArea, SWT.NONE);
    name.setLabel(Messages.get().EditEventTemplateDialog_EventName);
    name.setText(object.getName());
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    name.setLayoutData(gd);
    optionLog = new Button(dialogArea, SWT.CHECK);
    optionLog.setText(Messages.get().EditEventTemplateDialog_WriteToLog);
    optionLog.setSelection((object.getFlags() & EventTemplate.FLAG_WRITE_TO_LOG) != 0);
    gd = new GridData();
    gd.grabExcessHorizontalSpace = false;
    gd.horizontalAlignment = SWT.RIGHT;
    gd.verticalAlignment = SWT.BOTTOM;
    optionLog.setLayoutData(gd);
    message = new LabeledText(dialogArea, SWT.NONE);
    message.setLabel(Messages.get().EditEventTemplateDialog_Message);
    message.setText(object.getMessage());
    gd = new GridData();
    gd.horizontalSpan = 2;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    gd.widthHint = 450;
    message.setLayoutData(gd);
    description = new LabeledText(dialogArea, SWT.NONE, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP);
    description.setLabel(Messages.get().EditEventTemplateDialog_Description);
    description.setText(object.getDescription());
    gd = new GridData();
    gd.horizontalSpan = 2;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    gd.heightHint = 200;
    gd.widthHint = 450;
    gd.verticalAlignment = SWT.FILL;
    description.setLayoutData(gd);
    return dialogArea;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData)

Example 62 with LabeledText

use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.

the class AlarmViewer method createContents.

/* (non-Javadoc)
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected Control createContents(Composite parent) {
    config = (AlarmViewerConfig) getElement().getAdapter(AlarmViewerConfig.class);
    Composite dialogArea = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    dialogArea.setLayout(layout);
    objectSelector = new ObjectSelector(dialogArea, SWT.NONE, true);
    objectSelector.setLabel(Messages.get().AlarmViewer_RootObject);
    objectSelector.setObjectClass(AbstractObject.class);
    objectSelector.setObjectId(config.getObjectId());
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    objectSelector.setLayoutData(gd);
    title = new LabeledText(dialogArea, SWT.NONE);
    title.setLabel(Messages.get().AlarmViewer_Title);
    title.setText(config.getTitle());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    title.setLayoutData(gd);
    Group severityGroup = new Group(dialogArea, SWT.NONE);
    severityGroup.setText(Messages.get().AlarmViewer_SeverityFilter);
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    severityGroup.setLayoutData(gd);
    layout = new GridLayout();
    layout.numColumns = 5;
    layout.makeColumnsEqualWidth = true;
    severityGroup.setLayout(layout);
    checkSeverity = new Button[5];
    for (int severity = 4; severity >= 0; severity--) {
        checkSeverity[severity] = new Button(severityGroup, SWT.CHECK);
        checkSeverity[severity].setText(StatusDisplayInfo.getStatusText(severity));
        checkSeverity[severity].setSelection((config.getSeverityFilter() & (1 << severity)) != 0);
    }
    return dialogArea;
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) ObjectSelector(org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector) Composite(org.eclipse.swt.widgets.Composite) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData)

Example 63 with LabeledText

use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.

the class CustomWidget method createContents.

/* (non-Javadoc)
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected Control createContents(Composite parent) {
    config = (CustomWidgetConfig) getElement().getAdapter(CustomWidgetConfig.class);
    Composite dialogArea = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    dialogArea.setLayout(layout);
    className = new LabeledText(dialogArea, SWT.NONE, SWT.BORDER | SWT.MULTI);
    className.setLabel(Messages.get().CustomWidget_ClassName);
    className.setText(config.getClassName());
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    className.setLayoutData(gd);
    return dialogArea;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) GridData(org.eclipse.swt.layout.GridData)

Example 64 with LabeledText

use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.

the class Gauge method createContents.

/* (non-Javadoc)
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected Control createContents(Composite parent) {
    config = (GaugeConfig) getElement().getAdapter(GaugeConfig.class);
    Composite dialogArea = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.makeColumnsEqualWidth = true;
    dialogArea.setLayout(layout);
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    gaugeType = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY, Messages.get().Gauge_Type, gd);
    gaugeType.add(Messages.get().Gauge_Dial);
    gaugeType.add(Messages.get().Gauge_Bar);
    gaugeType.add(Messages.get().Gauge_Text);
    gaugeType.select(config.getGaugeType());
    fontName = new LabeledText(dialogArea, SWT.NONE);
    fontName.setLabel(Messages.get().Gauge_FontName);
    fontName.setText(config.getFontName());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    fontName.setLayoutData(gd);
    minValue = new LabeledText(dialogArea, SWT.NONE);
    minValue.setLabel(Messages.get().DialChart_MinVal);
    minValue.setText(Double.toString(config.getMinValue()));
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    minValue.setLayoutData(gd);
    maxValue = new LabeledText(dialogArea, SWT.NONE);
    maxValue.setLabel(Messages.get().DialChart_MaxVal);
    maxValue.setText(Double.toString(config.getMaxValue()));
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    maxValue.setLayoutData(gd);
    leftRedZone = new LabeledText(dialogArea, SWT.NONE);
    leftRedZone.setLabel(Messages.get().DialChart_LeftRed);
    leftRedZone.setText(Double.toString(config.getLeftRedZone()));
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    leftRedZone.setLayoutData(gd);
    leftYellowZone = new LabeledText(dialogArea, SWT.NONE);
    leftYellowZone.setLabel(Messages.get().DialChart_LeftYellow);
    leftYellowZone.setText(Double.toString(config.getLeftYellowZone()));
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    leftYellowZone.setLayoutData(gd);
    rightYellowZone = new LabeledText(dialogArea, SWT.NONE);
    rightYellowZone.setLabel(Messages.get().DialChart_RightYellow);
    rightYellowZone.setText(Double.toString(config.getRightYellowZone()));
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    rightYellowZone.setLayoutData(gd);
    rightRedZone = new LabeledText(dialogArea, SWT.NONE);
    rightRedZone.setLabel(Messages.get().DialChart_RightRed);
    rightRedZone.setText(Double.toString(config.getRightRedZone()));
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    rightRedZone.setLayoutData(gd);
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    colorMode = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY, Messages.get().Gauge_ColorMode, gd);
    colorMode.add(Messages.get().Gauge_ZoneColor);
    colorMode.add(Messages.get().Gauge_FixedCustomColor);
    colorMode.add(Messages.get().Gauge_ActiveThresholdColor);
    colorMode.select(config.getColorMode());
    colorMode.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            onColorModeChange(colorMode.getSelectionIndex());
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
        }
    });
    gd = new GridData();
    gd.horizontalAlignment = SWT.LEFT;
    customColor = WidgetHelper.createLabeledColorSelector(dialogArea, Messages.get().Gauge_CustomColor, gd);
    customColor.setColorValue(ColorConverter.rgbFromInt(config.getCustomColor()));
    checkLegendInside = new Button(dialogArea, SWT.CHECK);
    checkLegendInside.setText(Messages.get().DialChart_LegendInside);
    checkLegendInside.setSelection(config.isLegendInside());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    checkLegendInside.setLayoutData(gd);
    checkVertical = new Button(dialogArea, SWT.CHECK);
    checkVertical.setText(Messages.get().Gauge_Vertical);
    checkVertical.setSelection(config.isVertical());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    checkVertical.setLayoutData(gd);
    checkElementBorders = new Button(dialogArea, SWT.CHECK);
    checkElementBorders.setText(Messages.get().Gauge_ShowBorder);
    checkElementBorders.setSelection(config.isElementBordersVisible());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    checkElementBorders.setLayoutData(gd);
    onColorModeChange(config.getColorMode());
    return dialogArea;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 65 with LabeledText

use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.

the class TableComparisonChart method createContents.

/* (non-Javadoc)
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected Control createContents(Composite parent) {
    config = (TableComparisonChartConfig) getElement().getAdapter(TableComparisonChartConfig.class);
    Composite dialogArea = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.makeColumnsEqualWidth = true;
    dialogArea.setLayout(layout);
    title = new LabeledText(dialogArea, SWT.NONE);
    title.setLabel(Messages.get().TableComparisonChart_Title);
    title.setText(config.getTitle());
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    title.setLayoutData(gd);
    legendPosition = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY, Messages.get().TableComparisonChart_LegendPosition, WidgetHelper.DEFAULT_LAYOUT_DATA);
    legendPosition.add(Messages.get().TableComparisonChart_Left);
    legendPosition.add(Messages.get().TableComparisonChart_Right);
    legendPosition.add(Messages.get().TableComparisonChart_Top);
    legendPosition.add(Messages.get().TableComparisonChart_Bottom);
    legendPosition.select(positionIndexFromValue(config.getLegendPosition()));
    Group optionsGroup = new Group(dialogArea, SWT.NONE);
    optionsGroup.setText(Messages.get().TableComparisonChart_Options);
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalSpan = 2;
    optionsGroup.setLayoutData(gd);
    GridLayout optionsLayout = new GridLayout();
    optionsGroup.setLayout(optionsLayout);
    checkShowTitle = new Button(optionsGroup, SWT.CHECK);
    checkShowTitle.setText(Messages.get().TableComparisonChart_ShowTitle);
    checkShowTitle.setSelection(config.isShowTitle());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    checkShowTitle.setLayoutData(gd);
    checkShowLegend = new Button(optionsGroup, SWT.CHECK);
    checkShowLegend.setText(Messages.get().TableComparisonChart_ShowLegend);
    checkShowLegend.setSelection(config.isShowLegend());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    checkShowLegend.setLayoutData(gd);
    checkShowIn3D = new Button(optionsGroup, SWT.CHECK);
    checkShowIn3D.setText(Messages.get().TableComparisonChart_3DView);
    checkShowIn3D.setSelection(config.isShowIn3D());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    checkShowIn3D.setLayoutData(gd);
    checkTranslucent = new Button(optionsGroup, SWT.CHECK);
    checkTranslucent.setText(Messages.get().TableComparisonChart_Translucent);
    checkTranslucent.setSelection(config.isTranslucent());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    checkTranslucent.setLayoutData(gd);
    if ((config instanceof TableBarChartConfig) || (config instanceof TableTubeChartConfig)) {
        checkTransposed = new Button(optionsGroup, SWT.CHECK);
        checkTransposed.setText(Messages.get().TableComparisonChart_Transposed);
        checkTransposed.setSelection((config instanceof TableBarChartConfig) ? ((TableBarChartConfig) config).isTransposed() : ((TableTubeChartConfig) config).isTransposed());
        gd = new GridData();
        gd.horizontalAlignment = SWT.FILL;
        gd.grabExcessHorizontalSpace = true;
        checkTransposed.setLayoutData(gd);
    }
    gd = new GridData();
    gd.verticalAlignment = SWT.TOP;
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    refreshRate = WidgetHelper.createLabeledSpinner(dialogArea, SWT.BORDER, Messages.get().TableComparisonChart_RefreshInterval, 1, 10000, gd);
    refreshRate.setSelection(config.getRefreshRate());
    if (!(config instanceof TablePieChartConfig)) {
        yAxisRange = new YAxisRangeEditor(dialogArea, SWT.NONE);
        gd = new GridData();
        gd.horizontalSpan = layout.numColumns;
        gd.horizontalAlignment = SWT.FILL;
        gd.grabExcessHorizontalSpace = true;
        yAxisRange.setLayoutData(gd);
        yAxisRange.setSelection(config.isAutoScale(), config.modifyYBase(), config.getMinYScaleValue(), config.getMaxYScaleValue());
    }
    return dialogArea;
}
Also used : TableBarChartConfig(org.netxms.ui.eclipse.dashboard.widgets.internal.TableBarChartConfig) TableTubeChartConfig(org.netxms.ui.eclipse.dashboard.widgets.internal.TableTubeChartConfig) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) YAxisRangeEditor(org.netxms.ui.eclipse.perfview.widgets.YAxisRangeEditor) TablePieChartConfig(org.netxms.ui.eclipse.dashboard.widgets.internal.TablePieChartConfig)

Aggregations

Composite (org.eclipse.swt.widgets.Composite)104 LabeledText (org.netxms.ui.eclipse.widgets.LabeledText)104 GridLayout (org.eclipse.swt.layout.GridLayout)103 GridData (org.eclipse.swt.layout.GridData)102 Button (org.eclipse.swt.widgets.Button)50 SelectionEvent (org.eclipse.swt.events.SelectionEvent)37 SelectionListener (org.eclipse.swt.events.SelectionListener)31 Group (org.eclipse.swt.widgets.Group)24 ObjectSelector (org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector)22 Label (org.eclipse.swt.widgets.Label)18 RowLayout (org.eclipse.swt.layout.RowLayout)11 Spinner (org.eclipse.swt.widgets.Spinner)11 ModifyEvent (org.eclipse.swt.events.ModifyEvent)9 ModifyListener (org.eclipse.swt.events.ModifyListener)9 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)8 LabeledSpinner (org.netxms.ui.eclipse.widgets.LabeledSpinner)8 ColorSelector (org.eclipse.jface.preference.ColorSelector)6 DisposeEvent (org.eclipse.swt.events.DisposeEvent)6 DisposeListener (org.eclipse.swt.events.DisposeListener)6 WidgetFactory (org.netxms.ui.eclipse.tools.WidgetFactory)6