Search in sources :

Example 11 with LabeledText

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;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) 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 12 with LabeledText

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;
}
Also used : DciSelector(org.netxms.ui.eclipse.datacollection.widgets.DciSelector) 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 13 with LabeledText

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;
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) RowLayout(org.eclipse.swt.layout.RowLayout) GridData(org.eclipse.swt.layout.GridData)

Example 14 with LabeledText

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;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) LocalFolderSelector(org.netxms.ui.eclipse.filemanager.widgets.LocalFolderSelector) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) GridData(org.eclipse.swt.layout.GridData)

Example 15 with LabeledText

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;
}
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)

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