use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class RegionalSettingsPrefPage method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.verticalSpacing = WidgetHelper.DIALOG_SPACING;
layout.horizontalSpacing = WidgetHelper.DIALOG_SPACING;
layout.numColumns = 3;
layout.makeColumnsEqualWidth = true;
dialogArea.setLayout(layout);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 3;
// $NON-NLS-1$
dateTimeFormat = WidgetHelper.createLabeledCombo(dialogArea, SWT.BORDER | SWT.READ_ONLY, Messages.get().RegionalSettingsPrefPage_DateTimeFormat, gd);
// $NON-NLS-1$
dateTimeFormat.add(Messages.get().RegionalSettingsPrefPage_FmtServer);
// $NON-NLS-1$
dateTimeFormat.add(Messages.get().RegionalSettingsPrefPage_FmtJava);
// $NON-NLS-1$
dateTimeFormat.add(Messages.get().RegionalSettingsPrefPage_FmtCustom);
// $NON-NLS-1$
format = getPreferenceStore().getInt("DATETIME_FORMAT");
dateTimeFormat.select(format);
dateTimeFormat.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
format = dateTimeFormat.getSelectionIndex();
dateFormatString.setEnabled(format == RegionalSettings.DATETIME_FORMAT_CUSTOM);
timeFormatString.setEnabled(format == RegionalSettings.DATETIME_FORMAT_CUSTOM);
shortTimeFormatString.setEnabled(format == RegionalSettings.DATETIME_FORMAT_CUSTOM);
updateExample(null);
updateShortTimeExample(null);
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
ModifyListener listener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
updateExample((Control) e.widget);
}
};
dateFormatString = new LabeledText(dialogArea, SWT.NONE);
// $NON-NLS-1$
dateFormatString.setLabel(Messages.get().RegionalSettingsPrefPage_DateFormatString);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
dateFormatString.setLayoutData(gd);
// $NON-NLS-1$
dateFormatString.setText(getPreferenceStore().getString("DATE_FORMAT_STRING"));
dateFormatString.setEnabled(format == RegionalSettings.DATETIME_FORMAT_CUSTOM);
dateFormatString.getTextControl().addModifyListener(listener);
timeFormatString = new LabeledText(dialogArea, SWT.NONE);
// $NON-NLS-1$
timeFormatString.setLabel(Messages.get().RegionalSettingsPrefPage_TimeFormatString);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
timeFormatString.setLayoutData(gd);
// $NON-NLS-1$
timeFormatString.setText(getPreferenceStore().getString("TIME_FORMAT_STRING"));
timeFormatString.setEnabled(format == RegionalSettings.DATETIME_FORMAT_CUSTOM);
timeFormatString.getTextControl().addModifyListener(listener);
shortTimeFormatString = new LabeledText(dialogArea, SWT.NONE);
shortTimeFormatString.setLabel(Messages.get().RegionalSettingsPrefPage_ShortTimeFormatString);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
shortTimeFormatString.setLayoutData(gd);
// $NON-NLS-1$
shortTimeFormatString.setText(getPreferenceStore().getString("SHORT_TIME_FORMAT_STRING"));
shortTimeFormatString.setEnabled(format == RegionalSettings.DATETIME_FORMAT_CUSTOM);
shortTimeFormatString.getTextControl().addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
updateShortTimeExample((Control) e.widget);
}
});
dateTimeExample = new LabeledText(dialogArea, SWT.NONE, SWT.BORDER | SWT.READ_ONLY);
// $NON-NLS-1$
dateTimeExample.setLabel(Messages.get().RegionalSettingsPrefPage_Example);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
dateTimeExample.setLayoutData(gd);
shortTimeExample = new LabeledText(dialogArea, SWT.NONE, SWT.BORDER | SWT.READ_ONLY);
shortTimeExample.setLabel(Messages.get().RegionalSettingsPrefPage_ShortTimeExample);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
shortTimeExample.setLayoutData(gd);
checkServerTimeZone = new Button(dialogArea, SWT.CHECK);
checkServerTimeZone.setText(Messages.get().RegionalSettingsPrefPage_UseServerTimeZone);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = layout.numColumns;
checkServerTimeZone.setLayoutData(gd);
// $NON-NLS-1$
checkServerTimeZone.setSelection(getPreferenceStore().getBoolean("USE_SERVER_TIMEZONE"));
updateExample(null);
updateShortTimeExample(null);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class TableDataSource 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 = 1;
layout.makeColumnsEqualWidth = true;
dialogArea.setLayout(layout);
dci = new DciSelector(dialogArea, SWT.NONE, false);
dci.setLabel(Messages.get().TableDataSource_Object);
dci.setDciId(config.getNodeId(), config.getDciId());
dci.setDcObjectType(DataCollectionObject.DCO_TYPE_TABLE);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
dci.setLayoutData(gd);
instanceColumn = new LabeledText(dialogArea, SWT.NONE);
instanceColumn.setLabel(Messages.get().TableDataSource_InstanceColumn);
instanceColumn.setText(config.getInstanceColumn());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
instanceColumn.setLayoutData(gd);
dataColumn = new LabeledText(dialogArea, SWT.NONE);
dataColumn.setLabel(Messages.get().TableDataSource_DataColumn);
dataColumn.setText(config.getDataColumn());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
dataColumn.setLayoutData(gd);
checkIgnoreZeroValues = new Button(dialogArea, SWT.CHECK);
checkIgnoreZeroValues.setText(Messages.get().TableDataSource_IgnoreZero);
checkIgnoreZeroValues.setSelection(config.isIgnoreZeroValues());
checkSortOnDataColumn = new Button(dialogArea, SWT.CHECK);
checkSortOnDataColumn.setText("&Sort table on data column");
checkSortOnDataColumn.setSelection(config.isSortOnDataColumn());
checkSortDescending = new Button(dialogArea, SWT.CHECK);
checkSortDescending.setText("Sort &descending");
checkSortDescending.setSelection(config.isSortDescending());
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class EditActionDlg 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.horizontalSpacing = WidgetHelper.OUTER_SPACING;
layout.verticalSpacing = WidgetHelper.OUTER_SPACING;
dialogArea.setLayout(layout);
name = WidgetHelper.createLabeledText(dialogArea, SWT.BORDER, 300, Messages.get().EditActionDlg_Name, action.getName(), WidgetHelper.DEFAULT_LAYOUT_DATA);
/* type selection radio buttons */
Group typeGroup = new Group(dialogArea, SWT.NONE);
typeGroup.setText(Messages.get().EditActionDlg_Type);
typeGroup.setLayout(new RowLayout(SWT.VERTICAL));
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
typeGroup.setLayoutData(gd);
typeLocalExec = new Button(typeGroup, SWT.RADIO);
typeLocalExec.setText(Messages.get().EditActionDlg_ExecCommandOnServer);
typeLocalExec.setSelection(action.getType() == ServerAction.EXEC_LOCAL);
typeLocalExec.addSelectionListener(new TypeButtonSelectionListener());
typeRemoteExec = new Button(typeGroup, SWT.RADIO);
typeRemoteExec.setText(Messages.get().EditActionDlg_ExecCommandOnNode);
typeRemoteExec.setSelection(action.getType() == ServerAction.EXEC_REMOTE);
typeRemoteExec.addSelectionListener(new TypeButtonSelectionListener());
typeExecScript = new Button(typeGroup, SWT.RADIO);
typeExecScript.setText(Messages.get().EditActionDlg_ExecuteScript);
typeExecScript.setSelection(action.getType() == ServerAction.EXEC_NXSL_SCRIPT);
typeExecScript.addSelectionListener(new TypeButtonSelectionListener());
typeEMail = new Button(typeGroup, SWT.RADIO);
typeEMail.setText(Messages.get().EditActionDlg_SenMail);
typeEMail.setSelection(action.getType() == ServerAction.SEND_EMAIL);
typeEMail.addSelectionListener(new TypeButtonSelectionListener());
typeSMS = new Button(typeGroup, SWT.RADIO);
typeSMS.setText(Messages.get().EditActionDlg_SendSMS);
typeSMS.setSelection(action.getType() == ServerAction.SEND_SMS);
typeSMS.addSelectionListener(new TypeButtonSelectionListener());
typeXMPP = new Button(typeGroup, SWT.RADIO);
typeXMPP.setText(Messages.get().EditActionDlg_SendXMPPMessage);
typeXMPP.setSelection(action.getType() == ServerAction.XMPP_MESSAGE);
typeXMPP.addSelectionListener(new TypeButtonSelectionListener());
typeForward = new Button(typeGroup, SWT.RADIO);
typeForward.setText(Messages.get().EditActionDlg_ForwardEvent);
typeForward.setSelection(action.getType() == ServerAction.FORWARD_EVENT);
typeForward.addSelectionListener(new TypeButtonSelectionListener());
/* type selection radio buttons - end */
Group optionsGroup = new Group(dialogArea, SWT.NONE);
optionsGroup.setText(Messages.get().EditActionDlg_Options);
optionsGroup.setLayout(new RowLayout(SWT.VERTICAL));
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
optionsGroup.setLayoutData(gd);
markDisabled = new Button(optionsGroup, SWT.CHECK);
markDisabled.setText(Messages.get().EditActionDlg_ActionDisabled);
markDisabled.setSelection(action.isDisabled());
recipient = new LabeledText(dialogArea, SWT.NONE);
recipient.setLabel(getRcptLabel(action.getType()));
recipient.setText(action.getRecipientAddress());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
recipient.setLayoutData(gd);
subject = new LabeledText(dialogArea, SWT.NONE);
subject.setLabel(Messages.get().EditActionDlg_MailSubject);
subject.setText(action.getEmailSubject());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
subject.setLayoutData(gd);
data = new LabeledText(dialogArea, SWT.NONE);
data.setLabel(getDataLabel(action.getType()));
data.setText(action.getData());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
data.setLayoutData(gd);
onTypeChange();
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class StartClientToAgentFolderUploadDialog 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);
fileSelector = new LocalFolderSelector(dialogArea, SWT.NONE, false, SWT.OPEN);
fileSelector.setLabel(Messages.get().StartClientToServerFileUploadDialog_LocalFile);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 400;
fileSelector.setLayoutData(gd);
textRemoteFile = new LabeledText(dialogArea, SWT.NONE);
textRemoteFile.setLabel(Messages.get().StartClientToServerFileUploadDialog_RemoteFileName);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textRemoteFile.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class CreateSnmpDciDialog 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();
dialogArea.setLayout(layout);
textDescription = new LabeledText(dialogArea, SWT.NONE);
textDescription.setLabel(Messages.get().CreateSnmpDciDialog_Description);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textDescription.setLayoutData(gd);
textDescription.setText(description);
Composite optionsGroup = new Composite(dialogArea, SWT.NONE);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
optionsGroup.setLayoutData(gd);
layout = new GridLayout();
layout.numColumns = 3;
layout.makeColumnsEqualWidth = true;
layout.marginHeight = 0;
layout.marginWidth = 0;
optionsGroup.setLayout(layout);
textInterval = new LabeledText(optionsGroup, SWT.NONE);
textInterval.setLabel(Messages.get().CreateInterfaceDciDialog_PollingInterval);
// $NON-NLS-1$
textInterval.setText("60");
textInterval.getTextControl().setTextLimit(5);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textInterval.setLayoutData(gd);
textRetention = new LabeledText(optionsGroup, SWT.NONE);
textRetention.setLabel(Messages.get().CreateInterfaceDciDialog_RetentionTime);
// $NON-NLS-1$
textRetention.setText("30");
textRetention.getTextControl().setTextLimit(5);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textRetention.setLayoutData(gd);
deltaCalculationSelector = WidgetHelper.createLabeledCombo(optionsGroup, SWT.BORDER | SWT.READ_ONLY, Messages.get().CreateSnmpDciDialog_DeltaCalculation, WidgetHelper.DEFAULT_LAYOUT_DATA);
deltaCalculationSelector.add(Messages.get().Transformation_DeltaNone);
deltaCalculationSelector.add(Messages.get().Transformation_DeltaSimple);
deltaCalculationSelector.add(Messages.get().Transformation_DeltaAvgPerSec);
deltaCalculationSelector.add(Messages.get().Transformation_DeltaAvgPerMin);
deltaCalculationSelector.select(deltaCalculation);
return dialogArea;
}
Aggregations