use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class RackPassiveElementEditDialog method createDialogArea.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.numColumns = 3;
dialogArea.setLayout(layout);
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
gd.horizontalSpan = 3;
gd.widthHint = 400;
name = new LabeledText(dialogArea, SWT.NONE);
name.setLabel("Name");
name.setText(element.getName());
name.setLayoutData(gd);
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
type = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY, "Type", gd);
type.setItems(TYPE);
type.setText(TYPE[element.getType().getValue()]);
position = new LabeledSpinner(dialogArea, SWT.NONE);
position.setLabel(Messages.get().RackPlacement_Position);
position.setRange(1, 50);
position.setSelection(element.getPosition());
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
position.setLayoutData(gd);
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
orientation = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY, "Orientation", gd);
orientation.setItems(ORIENTATION);
orientation.setText(ORIENTATION[element.getOrientation().getValue()]);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class CreateNodeDialog 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.verticalSpacing = WidgetHelper.DIALOG_SPACING;
layout.horizontalSpacing = WidgetHelper.DIALOG_SPACING;
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.numColumns = 2;
layout.makeColumnsEqualWidth = true;
dialogArea.setLayout(layout);
objectNameField = new LabeledText(dialogArea, SWT.NONE);
objectNameField.setLabel(Messages.get().CreateNodeDialog_Name);
objectNameField.getTextControl().setTextLimit(255);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 600;
gd.horizontalSpan = 2;
objectNameField.setLayoutData(gd);
objectNameField.setText(objectName);
final Composite ipAddrGroup = new Composite(dialogArea, SWT.NONE);
layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 2;
ipAddrGroup.setLayout(layout);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
ipAddrGroup.setLayoutData(gd);
hostNameField = new LabeledText(ipAddrGroup, SWT.NONE);
hostNameField.setLabel(Messages.get().CreateNodeDialog_PrimaryHostName);
hostNameField.getTextControl().setTextLimit(255);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
hostNameField.setLayoutData(gd);
hostNameField.setText(hostName);
agentPortField = WidgetHelper.createLabeledSpinner(dialogArea, SWT.BORDER, Messages.get().CreateNodeDialog_AgentPort, 1, 65535, WidgetHelper.DEFAULT_LAYOUT_DATA);
agentPortField.setSelection(agentPort);
snmpPortField = WidgetHelper.createLabeledSpinner(dialogArea, SWT.BORDER, Messages.get().CreateNodeDialog_SNMPPort, 1, 65535, WidgetHelper.DEFAULT_LAYOUT_DATA);
snmpPortField.setSelection(snmpPort);
sshLoginField = new LabeledText(dialogArea, SWT.NONE);
sshLoginField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
sshLoginField.setLabel("SSH Login");
sshLoginField.setText(sshLogin);
sshPasswordField = new LabeledText(dialogArea, SWT.NONE);
sshPasswordField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
sshPasswordField.setLabel("SSH Password");
sshPasswordField.setText(sshPassword);
Group optionsGroup = new Group(dialogArea, SWT.NONE);
optionsGroup.setText(Messages.get().CreateNodeDialog_Options);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
optionsGroup.setLayoutData(gd);
optionsGroup.setLayout(new RowLayout(SWT.VERTICAL));
checkUnmanaged = new Button(optionsGroup, SWT.CHECK);
checkUnmanaged.setText(Messages.get().CreateNodeDialog_CreateUnmanaged);
checkUnmanaged.setSelection((creationFlags & NXCObjectCreationData.CF_CREATE_UNMANAGED) != 0);
checkDisableAgent = new Button(optionsGroup, SWT.CHECK);
checkDisableAgent.setText(Messages.get().CreateNodeDialog_DisableAgent);
checkDisableAgent.setSelection((creationFlags & NXCObjectCreationData.CF_DISABLE_NXCP) != 0);
checkDisableSNMP = new Button(optionsGroup, SWT.CHECK);
checkDisableSNMP.setText(Messages.get().CreateNodeDialog_DisableSNMP);
checkDisableSNMP.setSelection((creationFlags & NXCObjectCreationData.CF_DISABLE_SNMP) != 0);
checkDisablePing = new Button(optionsGroup, SWT.CHECK);
checkDisablePing.setText(Messages.get().CreateNodeDialog_DisableICMP);
checkDisablePing.setSelection((creationFlags & NXCObjectCreationData.CF_DISABLE_ICMP) != 0);
agentProxySelector = new ObjectSelector(dialogArea, SWT.NONE, true);
agentProxySelector.setLabel(Messages.get().CreateNodeDialog_AgentProxy);
agentProxySelector.setObjectClass(Node.class);
agentProxySelector.setObjectId(agentProxy);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
agentProxySelector.setLayoutData(gd);
snmpProxySelector = new ObjectSelector(dialogArea, SWT.NONE, true);
snmpProxySelector.setLabel(Messages.get().CreateNodeDialog_SNMPProxy);
snmpProxySelector.setObjectClass(Node.class);
snmpProxySelector.setObjectId(snmpProxy);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
snmpProxySelector.setLayoutData(gd);
icmpProxySelector = new ObjectSelector(dialogArea, SWT.NONE, true);
icmpProxySelector.setLabel("Proxy for ICMP");
icmpProxySelector.setObjectClass(Node.class);
icmpProxySelector.setObjectId(icmpProxy);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
icmpProxySelector.setLayoutData(gd);
sshProxySelector = new ObjectSelector(dialogArea, SWT.NONE, true);
sshProxySelector.setLabel("Proxy for SSH");
sshProxySelector.setEmptySelectionName("<default>");
sshProxySelector.setObjectClass(Node.class);
sshProxySelector.setObjectId(sshProxy);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
sshProxySelector.setLayoutData(gd);
if (session.isZoningEnabled()) {
zoneSelector = new ZoneSelector(dialogArea, SWT.NONE, false);
zoneSelector.setLabel(Messages.get().CreateNodeDialog_Zone);
Zone zone = ConsoleSharedData.getSession().findZone(zoneUIN);
zoneSelector.setZoneUIN((zone != null) ? zone.getUIN() : -1);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
zoneSelector.setLayoutData(gd);
}
if (enableShowAgainFlag) {
checkCreateAnother = new Button(dialogArea, SWT.CHECK);
checkCreateAnother.setText(Messages.get().CreateNodeDialog_ShowAgain);
checkCreateAnother.setSelection(showAgain);
}
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class SSH method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
node = (AbstractNode) getElement().getAdapter(AbstractNode.class);
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout dialogLayout = new GridLayout();
dialogLayout.marginWidth = 0;
dialogLayout.marginHeight = 0;
dialogLayout.numColumns = 2;
dialogLayout.makeColumnsEqualWidth = true;
dialogArea.setLayout(dialogLayout);
sshLogin = new LabeledText(dialogArea, SWT.NONE);
sshLogin.setLabel("Login");
sshLogin.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
sshLogin.setText(node.getSshLogin());
sshPassword = new LabeledText(dialogArea, SWT.NONE);
sshPassword.setLabel("Password");
sshPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
sshPassword.setText(node.getSshPassword());
sshProxy = new ObjectSelector(dialogArea, SWT.NONE, true);
sshProxy.setLabel(Messages.get().Communication_Proxy);
sshProxy.setEmptySelectionName("<default>");
sshProxy.setObjectId(node.getSshProxyId());
sshProxy.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class ObjectToolInputDialog 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);
for (int i = 0; i < fields.length; i++) {
LabeledControl c;
switch(fields[i].getType()) {
case NUMBER:
c = new LabeledSpinner(dialogArea, SWT.NONE);
break;
case PASSWORD:
c = new LabeledText(dialogArea, SWT.NONE, SWT.PASSWORD);
break;
default:
c = new LabeledText(dialogArea, SWT.NONE);
break;
}
c.setLabel(fields[i].getDisplayName());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 300;
c.setLayoutData(gd);
controls[i] = c;
}
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class NetworkServicePolling 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);
object = (NetworkService) getElement().getAdapter(NetworkService.class);
GridLayout layout = new GridLayout();
layout.verticalSpacing = WidgetHelper.DIALOG_SPACING;
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.numColumns = 2;
dialogArea.setLayout(layout);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
serviceType = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY, Messages.get().NetworkServicePolling_ServiceType, gd);
serviceType.add(Messages.get().NetworkServicePolling_TypeUserDef);
serviceType.add(Messages.get().NetworkServicePolling_TypeSSH);
serviceType.add(Messages.get().NetworkServicePolling_TypePOP3);
serviceType.add(Messages.get().NetworkServicePolling_TypeSMTP);
serviceType.add(Messages.get().NetworkServicePolling_TypeFTP);
serviceType.add(Messages.get().NetworkServicePolling_TypeHTTP);
serviceType.add(Messages.get().NetworkServicePolling_TypeHTTPS);
serviceType.add(Messages.get().NetworkServicePolling_TypeTelnet);
serviceType.select(object.getServiceType());
port = new LabeledText(dialogArea, SWT.NONE);
port.setLabel(Messages.get().NetworkServicePolling_Port);
port.setText(Integer.toString(object.getPort()));
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
port.setLayoutData(gd);
ipAddress = new LabeledText(dialogArea, SWT.NONE);
ipAddress.setLabel("IP Address");
if (object.getIpAddress().isValidAddress())
ipAddress.setText(object.getIpAddress().getHostAddress());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
ipAddress.setLayoutData(gd);
request = new LabeledText(dialogArea, SWT.NONE);
request.setLabel(Messages.get().NetworkServicePolling_Request);
request.setText(object.getRequest());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
request.setLayoutData(gd);
response = new LabeledText(dialogArea, SWT.NONE);
response.setLabel(Messages.get().NetworkServicePolling_Response);
response.setText(object.getResponse());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
response.setLayoutData(gd);
pollerNode = new ObjectSelector(dialogArea, SWT.NONE, true);
pollerNode.setLabel(Messages.get().NetworkServicePolling_PollerNode);
pollerNode.setEmptySelectionName(Messages.get().NetworkServicePolling_SelectionDefault);
pollerNode.setObjectClass(AbstractNode.class);
pollerNode.setObjectId(object.getPollerNode());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
pollerNode.setLayoutData(gd);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = false;
pollCount = WidgetHelper.createLabeledSpinner(dialogArea, SWT.BORDER, Messages.get().NetworkServicePolling_RequiredPolls, 0, 1000, gd);
pollCount.setSelection(object.getPollCount());
return dialogArea;
}
Aggregations