| author | mianrui | 2012-04-19 05:25:16 (EDT) |
|---|---|---|
| committer | mwu | 2012-04-19 05:25:16 (EDT) |
| commit | 42ade50c29cca48c614b0825c99faf6acd225c41 (patch) (side-by-side diff) | |
| tree | 9ef6d887295e95ad5772d6d04f65abb68f6a08ff | |
| parent | 452fbc79c0c93cea4c8aed754569a40a4c23f0d6 (diff) | |
| download | org.eclipse.birt-42ade50c29cca48c614b0825c99faf6acd225c41.zip org.eclipse.birt-42ade50c29cca48c614b0825c99faf6acd225c41.tar.gz org.eclipse.birt-42ade50c29cca48c614b0825c99faf6acd225c41.tar.bz2 | |
TED – Issue 49054
Dataset Query page display issue after maximize and restore
| -rw-r--r-- | data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/editors/SQLDataSetEditorPage.java | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/editors/SQLDataSetEditorPage.java b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/editors/SQLDataSetEditorPage.java index f0cbafc..c697600 100644 --- a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/editors/SQLDataSetEditorPage.java +++ b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/editors/SQLDataSetEditorPage.java @@ -123,6 +123,8 @@ public class SQLDataSetEditorPage extends DataSetWizardPage private Button includeSchemaCheckBox = null; private DataSetDesign dataSetDesign; private Exception prepareException = null; + private Group sqlOptionGroup = null; + private Group selectTableGroup = null; private static String DEFAULT_MESSAGE = JdbcPlugin.getResourceString( "dataset.new.query" );//$NON-NLS-1$ @@ -141,6 +143,10 @@ public class SQLDataSetEditorPage extends DataSetWizardPage String metadataBidiFormatStr = null; // bidi_hcg private boolean continueConnect = true; + + private static final int DB_OBJECT_TREE_HEIGHT_MIN = 150; + private static final int DB_OBJECT_TREE_WIDTH_MIN = 200; + /** * constructor @@ -418,10 +424,24 @@ public class SQLDataSetEditorPage extends DataSetWizardPage private void computeSize( ) { - sComposite.setMinSize( tablescomposite.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); + availableDbObjectsTree.setBounds( availableDbObjectsTree.getBounds( ).x, + availableDbObjectsTree.getBounds( ).y, + this.getShell( ).getSize( ).x / 3, + this.getShell( ).getSize( ).y / 4 ); + sComposite.setMinSize( max( this.getShell( ).getSize( ).x / 3 - 30, + DB_OBJECT_TREE_WIDTH_MIN ), + max( this.getShell( ).getSize( ).y / 4, + DB_OBJECT_TREE_HEIGHT_MIN ) + + selectTableGroup.getBounds( ).height + + sqlOptionGroup.getBounds( ).height + 30 ); tablescomposite.layout( ); } + private int max( double d, double b ) + { + return (int) Math.max( d, b ); + } + private void createDBObjectTree( Composite tablescomposite ) { // Available Items @@ -433,7 +453,7 @@ public class SQLDataSetEditorPage extends DataSetWizardPage availableDbObjectsTree = new Tree( tablescomposite, SWT.BORDER | SWT.MULTI ); GridData treeData = new GridData( GridData.FILL_BOTH ); - treeData.minimumHeight = 150; + treeData.minimumHeight = DB_OBJECT_TREE_HEIGHT_MIN; availableDbObjectsTree.setLayoutData( treeData ); availableDbObjectsTree.addMenuDetectListener( new MenuDetectListener( ) { @@ -484,7 +504,7 @@ public class SQLDataSetEditorPage extends DataSetWizardPage { // Group for selecting the Tables etc // Searching the Tables and Views - Group selectTableGroup = new Group( tablescomposite, SWT.FILL ); + selectTableGroup = new Group( tablescomposite, SWT.FILL ); GridLayout groupLayout = new GridLayout( ); groupLayout.numColumns = 3; @@ -623,7 +643,7 @@ public class SQLDataSetEditorPage extends DataSetWizardPage private void createSQLOptionGroup( Composite tablescomposite ) { - Group sqlOptionGroup = new Group( tablescomposite, SWT.FILL ); + sqlOptionGroup = new Group( tablescomposite, SWT.FILL ); sqlOptionGroup.setText( JdbcPlugin.getResourceString( "tablepage.group.title" ) ); //$NON-NLS-1$ GridLayout sqlOptionGroupLayout = new GridLayout( ); sqlOptionGroupLayout.verticalSpacing = 10; |

