protected Control createTop(final Composite parent) { Composite c0 = new Composite(parent, SWT.NONE); c0.setLayout(new FormLayout()); Label wlId = new Label(c0, SWT.RIGHT); wlId.setText(Messages.getString("PhysicalTableDialog.USER_NAME_ID")); // $NON-NLS-1$ wId = new Text(c0, SWT.SINGLE | SWT.LEFT | SWT.BORDER); FormData fdlId = new FormData(); fdlId.left = new FormAttachment(0, 0); fdlId.top = new FormAttachment(wId, 0, SWT.CENTER); wlId.setLayoutData(fdlId); Label conLabel = new Label(c0, SWT.RIGHT); conLabel.setText("Connection:"); conField = new Combo(c0, SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL); comboViewer = new ComboViewer(conField); comboViewer.setContentProvider( new IStructuredContentProvider() { public Object[] getElements(final Object inputElement) { List ul = (List) inputElement; return ul.toArray(); } public void dispose() { if (logger.isDebugEnabled()) { logger.debug("Disposing ..."); } } public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (logger.isDebugEnabled()) { logger.debug("Input changed: old=" + oldInput + ", new=" + newInput); } } }); List<Object> list2 = new ArrayList<Object>(); list2.add(dummyConInstance); list2.addAll(schemaMeta.getDatabases().getList()); comboViewer.setInput(list2); comboViewer.setLabelProvider( new LabelProvider() { public Image getImage(Object element) { return null; } public String getText(Object element) { DatabaseMeta meta = (DatabaseMeta) element; if (DUMMY_CON_NAME.equals(meta.getName())) { return ""; } else { return ((DatabaseMeta) element).getName(); } } }); BusinessModel busModel = (BusinessModel) conceptUtil; if (null != busModel.getConnection()) { comboViewer.setSelection(new StructuredSelection(busModel.getConnection())); } else { comboViewer.setSelection(new StructuredSelection(dummyConInstance)); } FormData fdId = new FormData(); fdId.left = new FormAttachment(wlId, 10); fdId.top = new FormAttachment(0, 0); fdId.right = new FormAttachment(conLabel, -10); wId.setLayoutData(fdId); FormData fdConLabel = new FormData(); fdConLabel.left = new FormAttachment(50, 0); fdConLabel.top = new FormAttachment(conField, 0, SWT.CENTER); conLabel.setLayoutData(fdConLabel); FormData fdConField = new FormData(); fdConField.left = new FormAttachment(conLabel, 10); fdConField.top = new FormAttachment(0, 0); fdConField.right = new FormAttachment(100, 0); conField.setLayoutData(fdConField); if (conceptUtil.getId() != null) { wId.setText(conceptUtil.getId()); wId.selectAll(); } return c0; }