Search in sources :

Example 56 with LabeledText

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

the class HttpProxyPrefs 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 = 2;
    dialogArea.setLayout(layout);
    checkUseProxy = new Button(dialogArea, SWT.CHECK);
    // $NON-NLS-1$
    checkUseProxy.setText(Messages.get().HttpProxyPrefs_UserProxyMessage);
    // $NON-NLS-1$
    checkUseProxy.setSelection(getPreferenceStore().getBoolean("HTTP_PROXY_ENABLED"));
    GridData gd = new GridData();
    gd.horizontalSpan = 2;
    checkUseProxy.setLayoutData(gd);
    checkUseProxy.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean enabled = checkUseProxy.getSelection();
            editProxyServer.setEnabled(enabled);
            editProxyPort.setEnabled(enabled);
            editExclusions.setEnabled(enabled);
            checkRequireAuth.setEnabled(enabled);
            editLogin.setEnabled(enabled && checkRequireAuth.getEnabled());
            editPassword.setEnabled(enabled && checkRequireAuth.getEnabled());
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
        }
    });
    editProxyServer = new LabeledText(dialogArea, SWT.NONE);
    // $NON-NLS-1$
    editProxyServer.setLabel(Messages.get().HttpProxyPrefs_ProxyServer);
    // $NON-NLS-1$
    editProxyServer.setText(getPreferenceStore().getString("HTTP_PROXY_SERVER"));
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    editProxyServer.setLayoutData(gd);
    editProxyPort = new LabeledText(dialogArea, SWT.NONE);
    // $NON-NLS-1$
    editProxyPort.setLabel(Messages.get().HttpProxyPrefs_Port);
    // $NON-NLS-1$
    editProxyPort.setText(getPreferenceStore().getString("HTTP_PROXY_PORT"));
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.widthHint = 100;
    editProxyPort.setLayoutData(gd);
    editExclusions = new LabeledText(dialogArea, SWT.NONE);
    // $NON-NLS-1$
    editExclusions.setLabel(Messages.get().HttpProxyPrefs_ExcludedAddresses);
    // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    editExclusions.setText(getPreferenceStore().getString("HTTP_PROXY_EXCLUSIONS").replaceAll("\\|", ","));
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    gd.horizontalSpan = 2;
    editExclusions.setLayoutData(gd);
    editProxyServer.setEnabled(checkUseProxy.getSelection());
    editProxyPort.setEnabled(checkUseProxy.getSelection());
    editExclusions.setEnabled(checkUseProxy.getSelection());
    checkRequireAuth = new Button(dialogArea, SWT.CHECK);
    // $NON-NLS-1$
    checkRequireAuth.setText(Messages.get().HttpProxyPrefs_ProxyRequireAuth);
    // $NON-NLS-1$
    checkRequireAuth.setSelection(getPreferenceStore().getBoolean("HTTP_PROXY_AUTH"));
    gd = new GridData();
    gd.horizontalSpan = 2;
    // additional spacing before auth block
    gd.verticalIndent = WidgetHelper.DIALOG_SPACING;
    checkRequireAuth.setLayoutData(gd);
    checkRequireAuth.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean enabled = checkUseProxy.getSelection() && checkRequireAuth.getSelection();
            editLogin.setEnabled(enabled);
            editPassword.setEnabled(enabled);
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
        }
    });
    editLogin = new LabeledText(dialogArea, SWT.NONE);
    // $NON-NLS-1$
    editLogin.setLabel(Messages.get().HttpProxyPrefs_Login);
    // $NON-NLS-1$
    editLogin.setText(getPreferenceStore().getString("HTTP_PROXY_LOGIN"));
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    gd.horizontalSpan = 2;
    editLogin.setLayoutData(gd);
    editPassword = new LabeledText(dialogArea, SWT.NONE, SWT.BORDER | SWT.PASSWORD);
    // $NON-NLS-1$
    editPassword.setLabel(Messages.get().HttpProxyPrefs_Password);
    // $NON-NLS-1$
    editPassword.setText(getPreferenceStore().getString("HTTP_PROXY_PASSWORD"));
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    gd.horizontalSpan = 2;
    editPassword.setLayoutData(gd);
    boolean enabled = checkUseProxy.getSelection() && checkRequireAuth.getSelection();
    editLogin.setEnabled(enabled);
    editPassword.setEnabled(enabled);
    return dialogArea;
}
Also used : 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) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 57 with LabeledText

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

the class RepositoryPropertiesDlg 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);
    textUrl = new LabeledText(dialogArea, SWT.NONE);
    textUrl.setLabel("URL");
    textUrl.setText(url);
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.widthHint = 400;
    textUrl.setLayoutData(gd);
    textToken = new LabeledText(dialogArea, SWT.NONE);
    textToken.setLabel("Authentication token");
    textToken.setText(token);
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    textToken.setLayoutData(gd);
    textDescription = new LabeledText(dialogArea, SWT.NONE);
    textDescription.setLabel("Description");
    textDescription.setText(description);
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    textDescription.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 58 with LabeledText

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

the class GeoMap method createContents.

/* (non-Javadoc)
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected Control createContents(Composite parent) {
    config = (GeoMapConfig) getElement().getAdapter(GeoMapConfig.class);
    Composite dialogArea = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    dialogArea.setLayout(layout);
    title = new LabeledText(dialogArea, SWT.NONE, SWT.BORDER | SWT.MULTI);
    title.setLabel(Messages.get().GeoMap_Title);
    title.setText(config.getTitle());
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 3;
    title.setLayoutData(gd);
    latitude = new LabeledText(dialogArea, SWT.NONE);
    latitude.setLabel(Messages.get().GeoMap_Latitude);
    latitude.setText(GeoLocation.latitudeToString(config.getLatitude()));
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    latitude.setLayoutData(gd);
    longitude = new LabeledText(dialogArea, SWT.NONE);
    longitude.setLabel(Messages.get().GeoMap_Longitude);
    longitude.setText(GeoLocation.longitudeToString(config.getLongitude()));
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    longitude.setLayoutData(gd);
    zoom = WidgetHelper.createLabeledSpinner(dialogArea, SWT.BORDER, Messages.get().GeoMap_Zoom, 0, 18, WidgetHelper.DEFAULT_LAYOUT_DATA);
    zoom.setSelection(config.getZoom());
    objectSelector = new ObjectSelector(dialogArea, SWT.NONE, true);
    objectSelector.setLabel(Messages.get().AlarmViewer_RootObject);
    objectSelector.setObjectClass(AbstractObject.class);
    objectSelector.setObjectId(config.getRootObjectId());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 3;
    objectSelector.setLayoutData(gd);
    return dialogArea;
}
Also used : 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) GridData(org.eclipse.swt.layout.GridData)

Example 59 with LabeledText

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

the class WebPage method createContents.

/* (non-Javadoc)
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected Control createContents(Composite parent) {
    config = (WebPageConfig) getElement().getAdapter(WebPageConfig.class);
    Composite dialogArea = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    dialogArea.setLayout(layout);
    url = new LabeledText(dialogArea, SWT.NONE);
    url.setLabel(Messages.get().WebPage_URL);
    url.setText(config.getUrl());
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    url.setLayoutData(gd);
    title = new LabeledText(dialogArea, SWT.NONE);
    title.setLabel(Messages.get().WebPage_Title);
    title.setText(config.getTitle());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    title.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 60 with LabeledText

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

the class TestTransformationDlg method createDialogArea.

/* (non-Javadoc)
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected Control createDialogArea(Composite parent) {
    // $NON-NLS-1$
    imageWaiting = Activator.getImageDescriptor("icons/waiting.png").createImage();
    parent.addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            imageWaiting.dispose();
        }
    });
    final Composite dialogArea = (Composite) super.createDialogArea(parent);
    GridLayout layout = new GridLayout();
    dialogArea.setLayout(layout);
    inputValue = new LabeledText(dialogArea, SWT.NONE);
    inputValue.setLabel(Messages.get().TestTransformationDlg_Input);
    GridData gd = new GridData();
    gd.widthHint = 300;
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    inputValue.setLayoutData(gd);
    status = new CLabel(dialogArea, SWT.BORDER);
    status.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    status.setText(Messages.get().TestTransformationDlg_Idle);
    status.setImage(StatusDisplayInfo.getStatusImage(ObjectStatus.UNKNOWN));
    result = new LabeledText(dialogArea, SWT.NONE);
    result.setLabel(Messages.get().TestTransformationDlg_Result);
    result.getTextControl().setEditable(false);
    result.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    return dialogArea;
}
Also used : CLabel(org.eclipse.swt.custom.CLabel) DisposeListener(org.eclipse.swt.events.DisposeListener) 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) DisposeEvent(org.eclipse.swt.events.DisposeEvent)

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