Search in sources :

Example 16 with InetAddressEx

use of org.netxms.base.InetAddressEx 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

InetAddressEx (org.netxms.base.InetAddressEx)16 AbstractObject (org.netxms.client.objects.AbstractObject)4 InetAddress (java.net.InetAddress)3 UnknownHostException (java.net.UnknownHostException)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 GridData (org.eclipse.swt.layout.GridData)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 Composite (org.eclipse.swt.widgets.Composite)3 AccessPoint (org.netxms.client.objects.AccessPoint)3 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)2 Interface (org.netxms.client.objects.Interface)2 IOException (java.io.IOException)1 Inet4Address (java.net.Inet4Address)1 HashSet (java.util.HashSet)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 ITableLabelProvider (org.eclipse.jface.viewers.ITableLabelProvider)1