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 InformixURLSetupControl extends URLSetupControl {
21 public InformixURLSetupControl(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"));
52 label = new Label(parent, SWT.NONE);
53 label.setText(Messages.getString(InformixURLSetupControl.class, "informixserver"));
55 Text serverText = new Text(parent, SWT.BORDER | SWT.SINGLE);
56 serverText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
57 serverText.setText(getProperty("informixserver"));
59 label = new Label(parent, SWT.NONE);
60 label.setText(Messages.getString(URLSetupControl.class, "url"));
62 final Text urlText = new Text(parent, SWT.BORDER | SWT.SINGLE);
63 urlText.setEditable(false);
64 urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
65 urlText.setText(getConnectionURL());
67 hostNameText.addModifyListener(new ModifyListener() {
68 public void modifyText(ModifyEvent event) {
69 putProperty("hostname", ((Text) event.getSource()).getText());
70 urlText.setText(getConnectionURL());
74 portText.addModifyListener(new ModifyListener() {
75 public void modifyText(ModifyEvent event) {
76 putProperty("port", ((Text) event.getSource()).getText());
77 urlText.setText(getConnectionURL());
81 databaseNameText.addModifyListener(new ModifyListener() {
82 public void modifyText(ModifyEvent event) {
83 putProperty("dbname", ((Text) event.getSource()).getText());
84 urlText.setText(getConnectionURL());
88 serverText.addModifyListener(new ModifyListener() {
89 public void modifyText(ModifyEvent event) {
90 putProperty("informixserver", ((Text) event.getSource()).getText());
91 urlText.setText(getConnectionURL());