diff --git a/anno-gui-package/bin/assembly-linux-gtk32.xml b/anno-gui-package/bin/assembly-linux-gtk32.xml index 20efc9b99157d04e7b15c63ee255be9b8e6ff3e9..76510d164f3004d9704d5258cab0a487e7adcf3f 100644 --- a/anno-gui-package/bin/assembly-linux-gtk32.xml +++ b/anno-gui-package/bin/assembly-linux-gtk32.xml @@ -21,10 +21,10 @@ false runtime - org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3.2 - org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3.2 - org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3.2 + org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3 + org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3 + org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3 - \ No newline at end of file + diff --git a/anno-gui-package/bin/assembly-linux-gtk64.xml b/anno-gui-package/bin/assembly-linux-gtk64.xml index b8c923e9696feb264e2a47dbb00356510e1b5284..898e548f62cdcad82d20491864ae67d63d5d0383 100644 --- a/anno-gui-package/bin/assembly-linux-gtk64.xml +++ b/anno-gui-package/bin/assembly-linux-gtk64.xml @@ -21,10 +21,10 @@ false runtime - org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3.2 - org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3.2 - org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3.2 + org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3 + org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3 + org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3 - \ No newline at end of file + diff --git a/anno-gui-package/bin/assembly-win32.xml b/anno-gui-package/bin/assembly-win32.xml index 91ad803c213df0c8d1d1c0f717b6e09dd98f8327..f11ab53219bac21d9ced0a67bf7afbd3773a8a85 100644 --- a/anno-gui-package/bin/assembly-win32.xml +++ b/anno-gui-package/bin/assembly-win32.xml @@ -25,10 +25,10 @@ false runtime - org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3.2 - org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3.2 - org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3.2 + org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3 + org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3 + org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3 - \ No newline at end of file + diff --git a/anno-gui-package/bin/assembly-win64.xml b/anno-gui-package/bin/assembly-win64.xml index ef65751d1d8ff9b696c6fc959507c321e327656c..0b812f2775e7361f2795b5264f893491b24f777b 100644 --- a/anno-gui-package/bin/assembly-win64.xml +++ b/anno-gui-package/bin/assembly-win64.xml @@ -25,10 +25,10 @@ false runtime - org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3.2 - org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3.2 - org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3.2 + org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3 + org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3 + org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3 - \ No newline at end of file + diff --git a/anno-gui/src/main/java/org/genesys2/anno/gui/DatabaseDialog.java b/anno-gui/src/main/java/org/genesys2/anno/gui/DatabaseDialog.java index 9d1d164d1eb641736d5e4de64d6018203f3ebffc..04e58ce1183f33911ba0a7ded2332b34a2715473 100644 --- a/anno-gui/src/main/java/org/genesys2/anno/gui/DatabaseDialog.java +++ b/anno-gui/src/main/java/org/genesys2/anno/gui/DatabaseDialog.java @@ -31,6 +31,8 @@ import org.eclipse.jface.databinding.swt.WidgetProperties; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; @@ -93,10 +95,10 @@ public class DatabaseDialog extends Dialog { public DatabaseDialog(Shell parent, TreeViewer treeViewer, int style) { super(parent, style); this.treeViewer = treeViewer; - this.databaseSettings=new DatabaseSettings(); + this.databaseSettings = new DatabaseSettings(); setText("Add Database"); } - + public void setDatabaseSettings(DatabaseSettings databaseSettings) { this.databaseSettings = databaseSettings; } @@ -142,6 +144,7 @@ public class DatabaseDialog extends Dialog { /* Datasource type */ Label lblType = new Label(grpDbConfiguration, SWT.NONE); lblType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); + lblType.setAlignment(SWT.RIGHT); lblType.setText("Database type"); comboType = new Combo(grpDbConfiguration, SWT.NONE); @@ -166,6 +169,7 @@ public class DatabaseDialog extends Dialog { txtName = new Text(grpDbConfiguration, SWT.BORDER); txtName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); + /* Connection URL */ Label lblDbUrl = new Label(grpDbConfiguration, SWT.NONE); lblDbUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); @@ -174,6 +178,12 @@ public class DatabaseDialog extends Dialog { txtDbUrl = new Text(grpDbConfiguration, SWT.BORDER); txtDbUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); + txtDbUrl.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + txtDbUrl.setSelection(txtDbUrl.getText().length()); + } + }); /* User */ Label lblDbUserName = new Label(grpDbConfiguration, SWT.NONE); lblDbUserName.setAlignment(SWT.RIGHT); @@ -190,12 +200,12 @@ public class DatabaseDialog extends Dialog { txtDbPassword = new Text(grpDbConfiguration, SWT.BORDER | SWT.PASSWORD); txtDbPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); - + Label lblProperties = new Label(grpDbConfiguration, SWT.NONE); lblProperties.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1)); lblProperties.setText("Additional JDBC properties"); lblProperties.setAlignment(SWT.RIGHT); - + txtDbProperties = new Text(grpDbConfiguration, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI); GridData gd_txtDbProperties = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_txtDbProperties.heightHint = 60; @@ -261,11 +271,11 @@ public class DatabaseDialog extends Dialog { Properties props = new Properties(); props.put("user", this.txtDbUserName.getText()); props.put("password", this.txtDbPassword.getText()); - props.put("charSet", "windows-1250"); + props.put("charSet", "windows-1250"); + + try { + connection = ConnectionUtils.getConnection(databaseSettings.getDriverClassName(), this.txtDbUrl.getText(), props); - try { - connection = ConnectionUtils.getConnection(databaseSettings.getDriverClassName(), this.txtDbUrl.getText(), props); - } catch (ClassNotFoundException e) { message = "Could not load JDBC driver " + e.getMessage(); } catch (SQLException e) { @@ -299,6 +309,7 @@ public class DatabaseDialog extends Dialog { this.shell.close(); ConnectionUtils.close(connection); } + protected DataBindingContext initDataBindings() { DataBindingContext bindingContext = new DataBindingContext(); //