use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class EditClusterResourceDialog 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.OUTER_SPACING;
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
dialogArea.setLayout(layout);
nameField = new LabeledText(dialogArea, SWT.NONE);
nameField.setLabel(Messages.get().EditClusterResourceDialog_ResName);
nameField.getTextControl().setTextLimit(255);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 300;
nameField.setLayoutData(gd);
addressField = new LabeledText(dialogArea, SWT.NONE);
addressField.setLabel(Messages.get().EditClusterResourceDialog_VIP);
addressField.getTextControl().setTextLimit(32);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
addressField.setLayoutData(gd);
if (resource != null) {
nameField.setText(resource.getName());
addressField.setText(resource.getVirtualAddress().getHostAddress());
}
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class ObjectUrlEditDialog 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;
dialogArea.setLayout(layout);
textUrl = new LabeledText(dialogArea, SWT.NONE);
textUrl.setLabel("URL");
textUrl.getTextControl().setTextLimit(2000);
if (url != null)
textUrl.setText(url.toExternalForm());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textUrl.setLayoutData(gd);
textDescription = new LabeledText(dialogArea, SWT.NONE);
textDescription.setLabel("Description");
textDescription.getTextControl().setTextLimit(2000);
if (description != null)
textDescription.setText(description);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 500;
textDescription.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class Agent 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);
FormLayout dialogLayout = new FormLayout();
dialogLayout.marginWidth = 0;
dialogLayout.marginHeight = 0;
dialogLayout.spacing = WidgetHelper.DIALOG_SPACING;
dialogArea.setLayout(dialogLayout);
agentPort = new LabeledText(dialogArea, SWT.NONE);
agentPort.setLabel(Messages.get().Communication_TCPPort);
agentPort.setText(Integer.toString(node.getAgentPort()));
FormData fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.top = new FormAttachment(0, 0);
agentPort.setLayoutData(fd);
agentProxy = new ObjectSelector(dialogArea, SWT.NONE, true);
agentProxy.setLabel(Messages.get().Communication_Proxy);
agentProxy.setObjectId(node.getAgentProxyId());
fd = new FormData();
fd.left = new FormAttachment(agentPort, 0, SWT.RIGHT);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(0, 0);
agentProxy.setLayoutData(fd);
agentForceEncryption = new Button(dialogArea, SWT.CHECK);
agentForceEncryption.setText(Messages.get().Communication_ForceEncryption);
agentForceEncryption.setSelection((node.getFlags() & AbstractNode.NF_FORCE_ENCRYPTION) != 0);
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.top = new FormAttachment(agentPort, 0, SWT.BOTTOM);
agentForceEncryption.setLayoutData(fd);
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.top = new FormAttachment(agentForceEncryption, 0, SWT.BOTTOM);
agentAuthMethod = WidgetHelper.createLabeledCombo(dialogArea, SWT.BORDER | SWT.READ_ONLY, Messages.get().Communication_AuthMethod, fd);
agentAuthMethod.add(Messages.get().Communication_AuthNone);
agentAuthMethod.add(Messages.get().Communication_AuthPlain);
agentAuthMethod.add(Messages.get().Communication_AuthMD5);
agentAuthMethod.add(Messages.get().Communication_AuthSHA1);
agentAuthMethod.select(node.getAgentAuthMethod());
agentAuthMethod.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
@Override
public void widgetSelected(SelectionEvent e) {
agentSharedSecret.getTextControl().setEnabled(agentAuthMethod.getSelectionIndex() != AbstractNode.AGENT_AUTH_NONE);
}
});
agentSharedSecret = new LabeledText(dialogArea, SWT.NONE);
agentSharedSecret.setLabel(Messages.get().Communication_SharedSecret);
agentSharedSecret.setText(node.getAgentSharedSecret());
fd = new FormData();
fd.left = new FormAttachment(agentAuthMethod.getParent(), 0, SWT.RIGHT);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(agentForceEncryption, 0, SWT.BOTTOM);
agentSharedSecret.setLayoutData(fd);
agentSharedSecret.getTextControl().setEnabled(node.getAgentAuthMethod() != AbstractNode.AGENT_AUTH_NONE);
/* agent compression */
Group agentCompressionGroup = new Group(dialogArea, SWT.NONE);
agentCompressionGroup.setText("Protocol compression mode");
GridLayout layout = new GridLayout();
layout.horizontalSpacing = WidgetHelper.DIALOG_SPACING;
layout.numColumns = 3;
layout.makeColumnsEqualWidth = true;
agentCompressionGroup.setLayout(layout);
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(agentSharedSecret, 0, SWT.BOTTOM);
agentCompressionGroup.setLayoutData(fd);
radioAgentCompressionDefault = new Button(agentCompressionGroup, SWT.RADIO);
radioAgentCompressionDefault.setText("Default");
radioAgentCompressionDefault.setSelection(node.getAgentCompressionMode() == AgentCompressionMode.DEFAULT);
radioAgentCompressionEnabled = new Button(agentCompressionGroup, SWT.RADIO);
radioAgentCompressionEnabled.setText("Enabled");
radioAgentCompressionEnabled.setSelection(node.getAgentCompressionMode() == AgentCompressionMode.ENABLED);
radioAgentCompressionDisabled = new Button(agentCompressionGroup, SWT.RADIO);
radioAgentCompressionDisabled.setText("Disabled");
radioAgentCompressionDisabled.setSelection(node.getAgentCompressionMode() == AgentCompressionMode.DISABLED);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class AddSubnetDialog 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;
layout.numColumns = 2;
dialogArea.setLayout(layout);
address = new LabeledText(dialogArea, SWT.NONE);
address.setLabel(Messages.get().AddAddressListElementDialog_NetworkAddress);
// $NON-NLS-1$
address.setText("0.0.0.0");
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 300;
address.setLayoutData(gd);
mask = new LabeledSpinner(dialogArea, SWT.NONE);
mask.setLabel(Messages.get().AddAddressListElementDialog_NetworkMask);
mask.getSpinnerControl().setMinimum(0);
mask.getSpinnerControl().setMaximum(128);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
mask.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class CreateChassisDialog 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;
dialogArea.setLayout(layout);
objectNameField = new LabeledText(dialogArea, SWT.NONE);
objectNameField.setLabel("Name");
objectNameField.getTextControl().setTextLimit(255);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 300;
gd.horizontalSpan = 2;
objectNameField.setLayoutData(gd);
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);
controllerSelector = new ObjectSelector(dialogArea, SWT.NONE, true);
controllerSelector.setLabel("Controller");
controllerSelector.setObjectClass(Node.class);
controllerSelector.setObjectId(controllerId);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
controllerSelector.setLayoutData(gd);
checkCreateAnother = new Button(dialogArea, SWT.CHECK);
checkCreateAnother.setText("Show this dialog again to &create another chassis");
checkCreateAnother.setSelection(showAgain);
return dialogArea;
}
Aggregations