Quantum version 2.4.1
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / wizards / InformixURLSetupControl.java
diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InformixURLSetupControl.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InformixURLSetupControl.java
new file mode 100644 (file)
index 0000000..91e8f0b
--- /dev/null
@@ -0,0 +1,95 @@
+package com.quantum.wizards;
+
+import com.quantum.Messages;
+import com.quantum.model.JDBCDriver;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+
+/**
+ * @author BC
+ */
+public class InformixURLSetupControl extends URLSetupControl {
+       
+       public InformixURLSetupControl(Composite parent, JDBCDriver driver) {
+               super(parent, driver);
+       }
+
+       protected void createPart(Composite parent) {
+               
+               GridLayout layout = new GridLayout();
+               layout.numColumns = 2;
+               parent.setLayout(layout);
+               
+               Label label = new Label(parent, SWT.NONE);
+               label.setText(Messages.getString(URLSetupControl.class, "hostname"));
+               
+               Text hostNameText = new Text(parent, SWT.BORDER | SWT.SINGLE);
+               hostNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+               hostNameText.setText(getProperty("hostname"));
+
+               label = new Label(parent, SWT.NONE);
+               label.setText(Messages.getString(URLSetupControl.class, "port"));
+               
+               Text portText = new Text(parent, SWT.BORDER | SWT.SINGLE);
+               portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+               portText.setText(getProperty("port"));
+
+               label = new Label(parent, SWT.NONE);
+               label.setText(Messages.getString(URLSetupControl.class, "dbname"));
+               
+               Text databaseNameText = new Text(parent, SWT.BORDER | SWT.SINGLE);
+               databaseNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+               databaseNameText.setText(getProperty("dbname"));
+
+               label = new Label(parent, SWT.NONE);
+               label.setText(Messages.getString(InformixURLSetupControl.class, "informixserver"));
+               
+               Text serverText = new Text(parent, SWT.BORDER | SWT.SINGLE);
+               serverText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+               serverText.setText(getProperty("informixserver"));
+               
+               label = new Label(parent, SWT.NONE);
+               label.setText(Messages.getString(URLSetupControl.class, "url"));
+               
+               final Text urlText = new Text(parent, SWT.BORDER | SWT.SINGLE);
+               urlText.setEditable(false);
+               urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+               urlText.setText(getConnectionURL());
+
+               hostNameText.addModifyListener(new ModifyListener() {
+                       public void modifyText(ModifyEvent event) {
+                               putProperty("hostname", ((Text) event.getSource()).getText());
+                               urlText.setText(getConnectionURL());
+                       }
+               });
+
+               portText.addModifyListener(new ModifyListener() {
+                       public void modifyText(ModifyEvent event) {
+                               putProperty("port", ((Text) event.getSource()).getText());
+                               urlText.setText(getConnectionURL());
+                       }
+               });
+
+               databaseNameText.addModifyListener(new ModifyListener() {
+                       public void modifyText(ModifyEvent event) {
+                               putProperty("dbname", ((Text) event.getSource()).getText());
+                               urlText.setText(getConnectionURL());
+                       }
+               });
+
+               serverText.addModifyListener(new ModifyListener() {
+                       public void modifyText(ModifyEvent event) {
+                               putProperty("informixserver", ((Text) event.getSource()).getText());
+                               urlText.setText(getConnectionURL());
+                       }
+               });
+       }
+}