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 BasicThreePartURLSetupControl extends URLSetupControl {
21 public BasicThreePartURLSetupControl(Composite parent, JDBCDriver driver) {
22 super(parent, driver);
25 protected void createPart(Composite parent) {
27 GridLayout layout = new GridLayout();
28 layout.numColumns = 2;
29 parent.setLayout(layout);
31 Label label = new Label(parent, SWT.NONE);
32 label.setText(Messages.getString(URLSetupControl.class, "hostname"));
34 Text hostNameText = new Text(parent, SWT.BORDER | SWT.SINGLE);
35 hostNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
36 hostNameText.setText(getProperty("hostname"));
38 label = new Label(parent, SWT.NONE);
39 label.setText(Messages.getString(URLSetupControl.class, "port"));
41 Text portText = new Text(parent, SWT.BORDER | SWT.SINGLE);
42 portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
43 portText.setText(getProperty("port"));
45 label = new Label(parent, SWT.NONE);
46 label.setText(Messages.getString(URLSetupControl.class, "dbname"));
48 Text databaseNameText = new Text(parent, SWT.BORDER | SWT.SINGLE);
49 databaseNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
50 databaseNameText.setText(getProperty("dbname"));
51 label = new Label(parent, SWT.NONE);
52 label.setText(Messages.getString(URLSetupControl.class, "url"));
54 final Text urlText = new Text(parent, SWT.BORDER | SWT.SINGLE);
55 urlText.setEditable(false);
56 urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
57 urlText.setText(getConnectionURL());
59 hostNameText.addModifyListener(new ModifyListener() {
60 public void modifyText(ModifyEvent event) {
61 putProperty("hostname", ((Text) event.getSource()).getText());
62 urlText.setText(getConnectionURL());
66 portText.addModifyListener(new ModifyListener() {
67 public void modifyText(ModifyEvent event) {
68 putProperty("port", ((Text) event.getSource()).getText());
69 urlText.setText(getConnectionURL());
73 databaseNameText.addModifyListener(new ModifyListener() {
74 public void modifyText(ModifyEvent event) {
75 putProperty("dbname", ((Text) event.getSource()).getText());
76 urlText.setText(getConnectionURL());