use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class EditEventGroupDialog 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.horizontalSpacing = WidgetHelper.OUTER_SPACING * 2;
dialogArea.setLayout(layout);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
name = new LabeledText(dialogArea, SWT.NONE);
name.setLabel("Name");
name.setText(group.getName());
name.getTextControl().setTextLimit(63);
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
name.setLayoutData(gd);
description = new LabeledText(dialogArea, SWT.NONE, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP);
description.setLabel("Description");
description.setText(group.getDescription());
description.getTextControl().setTextLimit(254);
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
gd.heightHint = 200;
gd.widthHint = 450;
gd.verticalAlignment = SWT.FILL;
description.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class ExportFileBuilder method createFileSection.
/**
* Create "File" section
*/
private void createFileSection() {
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(Messages.get().ExportFileBuilder_SectionFile);
TableWrapData td = new TableWrapData();
td.align = TableWrapData.FILL;
td.grabHorizontal = true;
td.colspan = 2;
section.setLayoutData(td);
Composite clientArea = toolkit.createComposite(section);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
clientArea.setLayout(layout);
section.setClient(clientArea);
description = new LabeledText(clientArea, SWT.NONE, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
toolkit.adapt(description);
description.setLabel(Messages.get().ExportFileBuilder_Description);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.heightHint = 200;
description.setLayoutData(gd);
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class AddAddressListElementDialog 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.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.verticalSpacing = WidgetHelper.DIALOG_SPACING;
dialogArea.setLayout(layout);
radioSubnet = new Button(dialogArea, SWT.RADIO);
radioSubnet.setText(Messages.get().AddAddressListElementDialog_Subnet);
radioSubnet.setSelection(true);
radioSubnet.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
textAddr1.setLabel(Messages.get().AddAddressListElementDialog_NetAddr);
textAddr2.setLabel(Messages.get().AddAddressListElementDialog_NetMask);
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
radioRange = new Button(dialogArea, SWT.RADIO);
radioRange.setText(Messages.get().AddAddressListElementDialog_AddrRange);
radioRange.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
textAddr1.setLabel(Messages.get().AddAddressListElementDialog_StartAddr);
textAddr2.setLabel(Messages.get().AddAddressListElementDialog_EndAddr);
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
textAddr1 = new LabeledText(dialogArea, SWT.NONE);
textAddr1.setLabel(Messages.get().AddAddressListElementDialog_NetAddr);
// $NON-NLS-1$
textAddr1.setText("0.0.0.0");
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 300;
textAddr1.setLayoutData(gd);
textAddr2 = new LabeledText(dialogArea, SWT.NONE);
textAddr2.setLabel(Messages.get().AddAddressListElementDialog_NetMask);
// $NON-NLS-1$
textAddr2.setText("0");
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textAddr2.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class AbstractChart method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
config = (AbstractChartConfig) getElement().getAdapter(AbstractChartConfig.class);
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.makeColumnsEqualWidth = false;
dialogArea.setLayout(layout);
title = new LabeledText(dialogArea, SWT.NONE);
title.setLabel(Messages.get().AbstractChart_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().AbstractChart_LegendPosition, WidgetHelper.DEFAULT_LAYOUT_DATA);
legendPosition.add(Messages.get().AbstractChart_Left);
legendPosition.add(Messages.get().AbstractChart_Right);
legendPosition.add(Messages.get().AbstractChart_Top);
legendPosition.add(Messages.get().AbstractChart_Bottom);
legendPosition.select(positionIndexFromValue(config.getLegendPosition()));
Group optionsGroup = new Group(dialogArea, SWT.NONE);
optionsGroup.setText(Messages.get().AbstractChart_Options);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalSpan = (config instanceof LineChartConfig) ? 3 : 2;
optionsGroup.setLayoutData(gd);
GridLayout optionsLayout = new GridLayout();
optionsGroup.setLayout(optionsLayout);
checkShowTitle = new Button(optionsGroup, SWT.CHECK);
checkShowTitle.setText(Messages.get().AbstractChart_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().AbstractChart_ShowLegend);
checkShowLegend.setSelection(config.isShowLegend());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
checkShowLegend.setLayoutData(gd);
if (config instanceof LineChartConfig) {
checkExtendedLegend = new Button(optionsGroup, SWT.CHECK);
checkExtendedLegend.setText(Messages.get().AbstractChart_ExtendedLegend);
checkExtendedLegend.setSelection(((LineChartConfig) config).isExtendedLegend());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
checkExtendedLegend.setLayoutData(gd);
checkLogScale = new Button(optionsGroup, SWT.CHECK);
checkLogScale.setText(Messages.get().AbstractChart_LogartithmicScale);
checkLogScale.setSelection(((LineChartConfig) config).isLogScaleEnabled());
gd = new GridData();
gd.horizontalSpan = layout.numColumns;
checkLogScale.setLayoutData(gd);
checkStacked = new Button(optionsGroup, SWT.CHECK);
checkStacked.setText(Messages.get().AbstractChart_Stacked);
checkStacked.setSelection(((LineChartConfig) config).isStacked());
gd = new GridData();
gd.horizontalSpan = layout.numColumns;
checkStacked.setLayoutData(gd);
checkAreaChart = new Button(optionsGroup, SWT.CHECK);
checkAreaChart.setText("&Area chart");
checkAreaChart.setSelection(((LineChartConfig) config).isArea());
gd = new GridData();
gd.horizontalSpan = layout.numColumns;
checkAreaChart.setLayoutData(gd);
}
checkTranslucent = new Button(optionsGroup, SWT.CHECK);
checkTranslucent.setText(Messages.get().AbstractChart_Translucent);
checkTranslucent.setSelection(config.isTranslucent());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
checkTranslucent.setLayoutData(gd);
if (config instanceof ComparisonChartConfig) {
checkShowIn3D = new Button(optionsGroup, SWT.CHECK);
checkShowIn3D.setText(Messages.get().AbstractChart_3DView);
checkShowIn3D.setSelection(((ComparisonChartConfig) config).isShowIn3D());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
checkShowIn3D.setLayoutData(gd);
if ((config instanceof BarChartConfig) || (config instanceof TubeChartConfig)) {
checkTransposed = new Button(optionsGroup, SWT.CHECK);
checkTransposed.setText(Messages.get().AbstractChart_Transposed);
checkTransposed.setSelection((config instanceof BarChartConfig) ? ((BarChartConfig) config).isTransposed() : ((TubeChartConfig) config).isTransposed());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
checkTransposed.setLayoutData(gd);
}
}
if (config instanceof LineChartConfig) {
checkShowGrid = new Button(optionsGroup, SWT.CHECK);
checkShowGrid.setText(Messages.get().AbstractChart_ShowGrid);
checkShowGrid.setSelection(((LineChartConfig) config).isShowGrid());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
checkShowGrid.setLayoutData(gd);
checkInteractive = new Button(optionsGroup, SWT.CHECK);
checkInteractive.setText("&Interactive");
checkInteractive.setSelection(((LineChartConfig) config).isInteractive());
gd = new GridData();
gd.horizontalSpan = layout.numColumns;
checkInteractive.setLayoutData(gd);
Composite timeRangeArea = new Composite(dialogArea, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.horizontalSpacing = WidgetHelper.DIALOG_SPACING;
timeRangeArea.setLayout(layout);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
timeRangeArea.setLayoutData(gd);
timeRange = WidgetHelper.createLabeledSpinner(timeRangeArea, SWT.BORDER, Messages.get().AbstractChart_TimeInterval, 1, 10000, WidgetHelper.DEFAULT_LAYOUT_DATA);
timeRange.setSelection(((LineChartConfig) config).getTimeRange());
timeUnits = WidgetHelper.createLabeledCombo(timeRangeArea, SWT.READ_ONLY, Messages.get().AbstractChart_TimeUnits, WidgetHelper.DEFAULT_LAYOUT_DATA);
timeUnits.add(Messages.get().AbstractChart_Minutes);
timeUnits.add(Messages.get().AbstractChart_Hours);
timeUnits.add(Messages.get().AbstractChart_Days);
timeUnits.select(((LineChartConfig) config).getTimeUnits());
}
Composite rateAndWidthArea = new Composite(dialogArea, SWT.NONE);
layout = new GridLayout();
layout.numColumns = (config instanceof LineChartConfig) ? 2 : 1;
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.horizontalSpacing = WidgetHelper.DIALOG_SPACING;
layout.makeColumnsEqualWidth = true;
rateAndWidthArea.setLayout(layout);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
rateAndWidthArea.setLayoutData(gd);
refreshRate = new LabeledSpinner(rateAndWidthArea, SWT.NONE);
refreshRate.setLabel(Messages.get().AbstractChart_RefreshInterval);
refreshRate.setRange(1, 10000);
refreshRate.setSelection(config.getRefreshRate());
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
refreshRate.setLayoutData(gd);
if (config instanceof LineChartConfig) {
lineWidth = new LabeledSpinner(rateAndWidthArea, SWT.NONE);
lineWidth.setLabel(Messages.get().AbstractChart_LineWidth);
lineWidth.setRange(1, 32);
lineWidth.setSelection(((LineChartConfig) config).getLineWidth());
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
lineWidth.setLayoutData(gd);
}
if (!(config instanceof PieChartConfig)) {
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;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class AvailabilityChart method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
config = (AvailabilityChartConfig) getElement().getAdapter(AvailabilityChartConfig.class);
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
dialogArea.setLayout(layout);
objectSelector = new ObjectSelector(dialogArea, SWT.NONE, false);
objectSelector.setLabel(Messages.get().AvailabilityChart_Object);
objectSelector.setObjectClass(ServiceContainer.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().AvailabilityChart_Title);
title.setText(config.getTitle());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
title.setLayoutData(gd);
checkShowTitle = new Button(dialogArea, SWT.CHECK);
checkShowTitle.setText(Messages.get().AvailabilityChart_ShowTitle);
checkShowTitle.setSelection(config.isShowTitle());
checkShowLegend = new Button(dialogArea, SWT.CHECK);
checkShowLegend.setText(Messages.get().AvailabilityChart_ShowLegend);
checkShowLegend.setSelection(config.isShowLegend());
checkShow3D = new Button(dialogArea, SWT.CHECK);
checkShow3D.setText(Messages.get().AvailabilityChart_3DView);
checkShow3D.setSelection(config.isShowIn3D());
checkTranslucent = new Button(dialogArea, SWT.CHECK);
checkTranslucent.setText(Messages.get().AvailabilityChart_Translucent);
checkTranslucent.setSelection(config.isTranslucent());
return dialogArea;
}
Aggregations