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