Search in sources :

Example 91 with LabeledText

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;
}
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 92 with LabeledText

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;
}
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 93 with LabeledText

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;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Group(org.eclipse.swt.widgets.Group) ObjectSelector(org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 94 with LabeledText

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;
}
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) LabeledSpinner(org.netxms.ui.eclipse.widgets.LabeledSpinner)

Example 95 with LabeledText

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;
}
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) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData)

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