Search in sources :

Example 1 with ZoneSelector

use of org.netxms.ui.eclipse.objectbrowser.widgets.ZoneSelector 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;
}
Also used : Group(org.eclipse.swt.widgets.Group) 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) Zone(org.netxms.client.objects.Zone) RowLayout(org.eclipse.swt.layout.RowLayout) ZoneSelector(org.netxms.ui.eclipse.objectbrowser.widgets.ZoneSelector) GridData(org.eclipse.swt.layout.GridData)

Example 2 with ZoneSelector

use of org.netxms.ui.eclipse.objectbrowser.widgets.ZoneSelector in project netxms by netxms.

the class EnterIpAddressDlg 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;
    dialogArea.setLayout(layout);
    ipAddressText = new LabeledText(dialogArea, SWT.NONE);
    ipAddressText.setLabel(Messages.get().EnterIpAddressDlg_IpAddress);
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.widthHint = 300;
    ipAddressText.setLayoutData(gd);
    if (zoningEnabled) {
        zoneSelector = new ZoneSelector(dialogArea, SWT.NONE, false);
        zoneSelector.setLabel(Messages.get().EnterIpAddressDlg_Zone);
        gd = new GridData();
        gd.horizontalAlignment = SWT.FILL;
        gd.grabExcessHorizontalSpace = true;
        gd.widthHint = 300;
        zoneSelector.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) ZoneSelector(org.netxms.ui.eclipse.objectbrowser.widgets.ZoneSelector) GridData(org.eclipse.swt.layout.GridData)

Example 3 with ZoneSelector

use of org.netxms.ui.eclipse.objectbrowser.widgets.ZoneSelector in project netxms by netxms.

the class EnterPrimaryHostnameDlg 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;
    dialogArea.setLayout(layout);
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    hostnameText = WidgetHelper.createLabeledText(dialogArea, SWT.BORDER, 300, "Enter hostname", "", gd);
    if (zoningEnabled) {
        zoneSelector = new ZoneSelector(dialogArea, SWT.NONE, false);
        zoneSelector.setLabel(Messages.get().EnterIpAddressDlg_Zone);
        gd = new GridData();
        gd.horizontalAlignment = SWT.FILL;
        gd.grabExcessHorizontalSpace = true;
        gd.widthHint = 300;
        zoneSelector.setLayoutData(gd);
    }
    return dialogArea;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ZoneSelector(org.netxms.ui.eclipse.objectbrowser.widgets.ZoneSelector) GridData(org.eclipse.swt.layout.GridData)

Example 4 with ZoneSelector

use of org.netxms.ui.eclipse.objectbrowser.widgets.ZoneSelector in project netxms by netxms.

the class SnmpCredentials method createPartControl.

/* (non-Javadoc)
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
	 */
@Override
public void createPartControl(Composite parent) {
    toolkit = new FormToolkit(getSite().getShell().getDisplay());
    form = toolkit.createScrolledForm(parent);
    form.setText("SNMP Configuration");
    TableWrapLayout layout = new TableWrapLayout();
    layout.numColumns = 2;
    form.getBody().setLayout(layout);
    if (session.isZoningEnabled()) {
        toolkit.decorateFormHeading(form.getForm());
        Composite headArea = toolkit.createComposite(form.getForm().getHead());
        headArea.setLayout(new GridLayout());
        zoneSelector = new ZoneSelector(headArea, SWT.NONE, true);
        zoneSelector.setEmptySelectionText("Global");
        zoneSelector.setLabel("Select zone");
        GridData gd = new GridData();
        gd.widthHint = 300;
        zoneSelector.setLayoutData(gd);
        form.setHeadClient(headArea);
        zoneSelector.addModifyListener(new ModifyListener() {

            @Override
            public void modifyText(ModifyEvent e) {
                zoneUIN = zoneSelector.getZoneUIN();
                loadSnmpConfig();
            }
        });
    }
    createSnmpCommunitySection();
    createSnmpUsmCredSection();
    createSnmpPortList();
    createActions();
    contributeToActionBars();
    // Load config
    loadSnmpConfig();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) TableWrapLayout(org.eclipse.ui.forms.widgets.TableWrapLayout) ZoneSelector(org.netxms.ui.eclipse.objectbrowser.widgets.ZoneSelector) GridData(org.eclipse.swt.layout.GridData)

Aggregations

GridData (org.eclipse.swt.layout.GridData)4 GridLayout (org.eclipse.swt.layout.GridLayout)4 Composite (org.eclipse.swt.widgets.Composite)4 ZoneSelector (org.netxms.ui.eclipse.objectbrowser.widgets.ZoneSelector)4 LabeledText (org.netxms.ui.eclipse.widgets.LabeledText)2 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 RowLayout (org.eclipse.swt.layout.RowLayout)1 Button (org.eclipse.swt.widgets.Button)1 Group (org.eclipse.swt.widgets.Group)1 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)1 TableWrapLayout (org.eclipse.ui.forms.widgets.TableWrapLayout)1 Zone (org.netxms.client.objects.Zone)1 ObjectSelector (org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector)1