1 package com.quantum.wizards;
3 import com.quantum.Messages;
4 import com.quantum.model.JDBCDriver;
6 import org.eclipse.swt.SWT;
7 import org.eclipse.swt.events.ModifyEvent;
8 import org.eclipse.swt.events.ModifyListener;
9 import org.eclipse.swt.layout.GridData;
10 import org.eclipse.swt.layout.GridLayout;
11 import org.eclipse.swt.widgets.Composite;
12 import org.eclipse.swt.widgets.Label;
13 import org.eclipse.swt.widgets.Text;
19 public class BasicOnePartURLSetupControl extends URLSetupControl {
21 private final String propertyName;
23 public BasicOnePartURLSetupControl(Composite parent, JDBCDriver driver, String propertyName) {
24 super(parent, driver);
25 this.propertyName = propertyName;
28 protected void createPart(Composite parent) {
30 GridLayout layout = new GridLayout();
31 layout.numColumns = 2;
32 parent.setLayout(layout);
34 Label label = new Label(parent, SWT.NONE);
35 label.setText(Messages.getString(URLSetupControl.class, this.propertyName));
37 Text databaseNameText = new Text(parent, SWT.BORDER | SWT.SINGLE);
38 databaseNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
39 databaseNameText.setText(getProperty(this.propertyName));
40 label = new Label(parent, SWT.NONE);
41 label.setText(Messages.getString(URLSetupControl.class, "url"));
43 final Text urlText = new Text(parent, SWT.BORDER | SWT.SINGLE);
44 urlText.setEditable(false);
45 urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
46 urlText.setText(getConnectionURL());
48 databaseNameText.addModifyListener(new ModifyListener() {
49 public void modifyText(ModifyEvent event) {
51 BasicOnePartURLSetupControl.this.propertyName,
52 ((Text) event.getSource()).getText());
53 urlText.setText(getConnectionURL());