use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class ObjectStatusChart method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
config = (ObjectStatusChartConfig) getElement().getAdapter(ObjectStatusChartConfig.class);
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
dialogArea.setLayout(layout);
objectSelector = new ObjectSelector(dialogArea, SWT.NONE, false);
objectSelector.setLabel(Messages.get().ObjectStatusChart_RootObject);
objectSelector.setObjectClass(AbstractObject.class);
objectSelector.setObjectId(config.getRootObject());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
objectSelector.setLayoutData(gd);
title = new LabeledText(dialogArea, SWT.NONE);
title.setLabel(Messages.get().ObjectStatusChart_Title);
title.setText(config.getTitle());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
title.setLayoutData(gd);
Group optionsGroup = new Group(dialogArea, SWT.NONE);
optionsGroup.setText(Messages.get().ObjectStatusChart_Options);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
optionsGroup.setLayoutData(gd);
GridLayout optionsLayout = new GridLayout();
optionsGroup.setLayout(optionsLayout);
checkShowLegend = new Button(optionsGroup, SWT.CHECK);
checkShowLegend.setText(Messages.get().ObjectStatusChart_ShowLegend);
checkShowLegend.setSelection(config.isShowLegend());
checkShow3D = new Button(optionsGroup, SWT.CHECK);
checkShow3D.setText(Messages.get().ObjectStatusChart_3DView);
checkShow3D.setSelection(config.isShowIn3D());
checkTransposed = new Button(optionsGroup, SWT.CHECK);
checkTransposed.setText(Messages.get().ObjectStatusChart_Transposed);
checkTransposed.setSelection(config.isTransposed());
checkTranslucent = new Button(optionsGroup, SWT.CHECK);
checkTranslucent.setText(Messages.get().ObjectStatusChart_Translucent);
checkTranslucent.setSelection(config.isTranslucent());
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
refreshRate = WidgetHelper.createLabeledSpinner(dialogArea, SWT.BORDER, Messages.get().ObjectStatusChart_RefreshInterval, 1, 10000, gd);
refreshRate.setSelection(config.getRefreshRate());
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class SnmpTrapMonitor method createContents.
@Override
protected Control createContents(Composite parent) {
config = (SnmpTrapMonitorConfig) getElement().getAdapter(SnmpTrapMonitorConfig.class);
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
dialogArea.setLayout(layout);
objectSelector = new ObjectSelector(dialogArea, SWT.NONE, true);
objectSelector.setLabel("Root object");
objectSelector.setObjectClass(AbstractObject.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("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 StatusMap method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
config = (StatusMapConfig) getElement().getAdapter(StatusMapConfig.class);
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
dialogArea.setLayout(layout);
objectSelector = new ObjectSelector(dialogArea, SWT.NONE, true);
objectSelector.setLabel(Messages.get().AlarmViewer_RootObject);
objectSelector.setObjectClass(AbstractObject.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().AlarmViewer_Title);
title.setText(config.getTitle());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
title.setLayoutData(gd);
Group severityGroup = new Group(dialogArea, SWT.NONE);
severityGroup.setText(Messages.get().StatusMap_SeverityFilter);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
severityGroup.setLayoutData(gd);
layout = new GridLayout();
layout.numColumns = 4;
layout.makeColumnsEqualWidth = true;
severityGroup.setLayout(layout);
checkSeverity = new Button[7];
for (int severity = 6; severity >= 0; severity--) {
checkSeverity[severity] = new Button(severityGroup, SWT.CHECK);
checkSeverity[severity].setText(StatusDisplayInfo.getStatusText(severity));
checkSeverity[severity].setSelection((config.getSeverityFilter() & (1 << severity)) != 0);
}
Group optionsGroup = new Group(dialogArea, SWT.NONE);
optionsGroup.setText(Messages.get().StatusMap_Options);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
optionsGroup.setLayoutData(gd);
layout = new GridLayout();
layout.numColumns = 1;
layout.makeColumnsEqualWidth = true;
optionsGroup.setLayout(layout);
checkGroupObjects = new Button(optionsGroup, SWT.CHECK);
checkGroupObjects.setText(Messages.get().StatusMap_Group);
checkGroupObjects.setSelection(config.isGroupObjects());
checkShowFilter = new Button(optionsGroup, SWT.CHECK);
checkShowFilter.setText(Messages.get().StatusMap_ShowFilter);
checkShowFilter.setSelection(config.isShowTextFilter());
checkRadial = new Button(optionsGroup, SWT.CHECK);
checkRadial.setText("Show in radial form");
checkRadial.setSelection(config.isShowRadial());
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class DefaultMobileLoginForm method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
colors = new ColorCache(parent);
Rectangle displayBounds = parent.getDisplay().getPrimaryMonitor().getBounds();
boolean isLandscape = displayBounds.width > displayBounds.height;
System.out.println(">>>> " + displayBounds.width + " x " + displayBounds.height + " DPI=" + parent.getDisplay().getDPI());
// $NON-NLS-1$
final Font headerFont = new Font(parent.getDisplay(), "Verdana", 18, SWT.BOLD);
parent.setBackground(colors.create(255, 255, 255));
// SWT.NO_FOCUS is a workaround for Eclipse/RAP bug 321274
final Canvas content = new Canvas(parent, SWT.NO_FOCUS);
GridLayout layout = new GridLayout();
layout.numColumns = isLandscape ? 2 : 1;
layout.marginWidth = 10;
layout.marginHeight = 10;
layout.horizontalSpacing = 10;
layout.verticalSpacing = 10;
content.setLayout(layout);
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.horizontalAlignment = SWT.CENTER;
gd.verticalAlignment = SWT.CENTER;
content.setLayoutData(gd);
content.setBackground(parent.getBackground());
Label title = new Label(content, SWT.CENTER);
final String customTitle = BrandingManager.getInstance().getLoginTitle();
title.setText((customTitle != null) ? customTitle : Messages.get().LoginForm_Title);
title.setFont(headerFont);
title.setForeground(colors.create(57, 33, 89));
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = layout.numColumns;
title.setLayoutData(gd);
Image userImage = null;
try {
// $NON-NLS-1$
ImageDescriptor d = ImageDescriptor.createFromURL(new URL("http://127.0.0.1/netxms_login.dat"));
if (d != null)
userImage = d.createImage(false);
} catch (Exception e) {
Activator.logError("Exception while reading custom image", e);
userImage = null;
}
final ImageDescriptor customImage = BrandingManager.getInstance().getLoginTitleImage();
// $NON-NLS-1$
final Image loginImage = (userImage != null) ? userImage : ((customImage != null) ? customImage.createImage() : Activator.getImageDescriptor("icons/login.png").createImage());
Label logo = new Label(content, SWT.NONE);
logo.setImage(loginImage);
logo.setLayoutData(isLandscape ? new GridData(SWT.LEFT, SWT.TOP, false, true) : new GridData(SWT.CENTER, SWT.TOP, true, false));
Composite loginArea = new Composite(content, SWT.NONE);
layout = new GridLayout();
loginArea.setLayout(layout);
gd = new GridData();
gd.widthHint = 300;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
loginArea.setLayoutData(gd);
textLogin = new LabeledText(loginArea, SWT.NONE);
textLogin.setLabel(Messages.get().LoginForm_UserName);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textLogin.setLayoutData(gd);
textPassword = new LabeledText(loginArea, SWT.NONE, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD);
textPassword.setLabel(Messages.get().LoginForm_Password);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textPassword.setLayoutData(gd);
Button okButton = new Button(loginArea, SWT.PUSH);
okButton.setText(Messages.get().LoginForm_LoginButton);
okButton.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
okPressed();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
gd = new GridData();
gd.horizontalAlignment = SWT.RIGHT;
gd.widthHint = WidgetHelper.BUTTON_WIDTH_HINT;
gd.verticalIndent = 5;
okButton.setLayoutData(gd);
content.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent event) {
loginImage.dispose();
headerFont.dispose();
}
});
Label version = new Label(parent, SWT.NONE);
version.setText(String.format(Messages.get().LoginForm_Version, NXCommon.VERSION + " (" + BuildNumber.TEXT + ")"));
version.setBackground(parent.getBackground());
version.setForeground(colors.create(32, 32, 32));
gd = new GridData();
gd.horizontalAlignment = SWT.RIGHT;
gd.verticalAlignment = SWT.BOTTOM;
version.setLayoutData(gd);
getShell().setDefaultButton(okButton);
textLogin.getTextControl().setFocus();
return content;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class SetEntryEditDialog 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.verticalSpacing = WidgetHelper.DIALOG_SPACING;
dialogArea.setLayout(layout);
textName = new LabeledText(dialogArea, SWT.NONE);
textName.setLabel("Key");
textName.getTextControl().setTextLimit(256);
if (pStorageKey != null) {
textName.setText(pStorageKey);
}
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 300;
textName.setLayoutData(gd);
textName.setEditable(!isSet || isNew);
if (isSet) {
textValue = new LabeledText(dialogArea, SWT.NONE);
textValue.setLabel("Value");
if (pStorageValue != null)
textValue.setText(pStorageValue);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textValue.setLayoutData(gd);
if (pStorageKey != null)
textValue.setFocus();
}
return dialogArea;
}
Aggregations