Search in sources :

Example 31 with ObjectSelector

use of org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector 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)

Example 32 with ObjectSelector

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

the class VPNSubnets method createContents.

/* (non-Javadoc)
    * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
    */
@Override
protected Control createContents(Composite parent) {
    Composite dialogArea = new Composite(parent, SWT.NONE);
    connector = (VPNConnector) getElement().getAdapter(VPNConnector.class);
    GridLayout layout = new GridLayout();
    layout.verticalSpacing = WidgetHelper.OUTER_SPACING;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    dialogArea.setLayout(layout);
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessVerticalSpace = true;
    dialogArea.setLayoutData(gd);
    objectSelector = new ObjectSelector(dialogArea, SWT.NONE, true);
    objectSelector.setLabel(Messages.get().VPNSubnets_PeerGateway);
    objectSelector.setObjectClass(AbstractObject.class);
    objectSelector.setObjectId(connector.getPeerGatewayId());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    objectSelector.setLayoutData(gd);
    objectSelector.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            modified = true;
        }
    });
    Composite clientArea = new Composite(dialogArea, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.numColumns = 2;
    gd = new GridData();
    clientArea.setLayout(layout);
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessVerticalSpace = true;
    clientArea.setLayoutData(gd);
    // networks lists
    localNetworksElements = new ArrayList<InetAddressEx>(connector.getLocalSubnets());
    remoteNetworksElements = new ArrayList<InetAddressEx>(connector.getRemoteSubnets());
    createNetworkList(clientArea, Messages.get().VPNSubnets_LocalNetworks, localNetworksList, localNetworksElements);
    createNetworkList(clientArea, Messages.get().VPNSubnets_RemoteNetworks, remoteNetworksList, remoteNetworksElements);
    return dialogArea;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ObjectSelector(org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) InetAddressEx(org.netxms.base.InetAddressEx) GridData(org.eclipse.swt.layout.GridData)

Aggregations

Composite (org.eclipse.swt.widgets.Composite)32 ObjectSelector (org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector)32 GridLayout (org.eclipse.swt.layout.GridLayout)31 GridData (org.eclipse.swt.layout.GridData)30 LabeledText (org.netxms.ui.eclipse.widgets.LabeledText)22 Button (org.eclipse.swt.widgets.Button)16 SelectionEvent (org.eclipse.swt.events.SelectionEvent)10 SelectionListener (org.eclipse.swt.events.SelectionListener)10 Group (org.eclipse.swt.widgets.Group)10 FormAttachment (org.eclipse.swt.layout.FormAttachment)4 FormData (org.eclipse.swt.layout.FormData)4 FormLayout (org.eclipse.swt.layout.FormLayout)4 RowLayout (org.eclipse.swt.layout.RowLayout)4 Label (org.eclipse.swt.widgets.Label)4 Spinner (org.eclipse.swt.widgets.Spinner)4 LabeledSpinner (org.netxms.ui.eclipse.widgets.LabeledSpinner)4 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 FillLayout (org.eclipse.swt.layout.FillLayout)2 Combo (org.eclipse.swt.widgets.Combo)2