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;
}
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;
}
Aggregations