[jbosstools-commits] JBoss Tools SVN: r9048 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Jul 2 13:54:28 EDT 2008


Author: vyemialyanchyk
Date: 2008-07-02 13:54:28 -0400 (Wed, 02 Jul 2008)
New Revision: 9048

Modified:
   trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
   trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFilePage.java
   trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java
Log:
add scroll area functionality for wizards

Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java	2008-07-02 17:30:46 UTC (rev 9047)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java	2008-07-02 17:54:28 UTC (rev 9048)
@@ -57,6 +57,7 @@
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.osgi.util.NLS;
 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;
@@ -133,7 +134,11 @@
 	 * @see IDialogPage#createControl(Composite)
 	 */
 	public void createControl(Composite parent) {
-		TabFolder folder = new TabFolder(parent,SWT.TOP);
+		final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+		sc.setExpandHorizontal(true);
+		sc.setExpandVertical(true);
+		TabFolder folder = new TabFolder(sc, SWT.TOP);
+		sc.setContent(folder);
 
 		//Composite container = new Composite(parent, SWT.NULL);
 
@@ -168,7 +173,8 @@
 
 		initialize(selection);
 		dialogChanged();
-		setControl(folder);
+		sc.setMinSize(folder.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+		setControl(sc);
 	}
 
 	private Composite createGeneral(Composite parent, ModifyListener modifyListener) {

Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFilePage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFilePage.java	2008-07-02 17:30:46 UTC (rev 9047)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFilePage.java	2008-07-02 17:54:28 UTC (rev 9048)
@@ -38,6 +38,7 @@
 import org.eclipse.jface.window.Window;
 import org.eclipse.jface.wizard.WizardPage;
 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;
@@ -103,7 +104,12 @@
 	 * @see IDialogPage#createControl(Composite)
 	 */
 	public void createControl(Composite parent) {
-		Composite container = new Composite(parent, SWT.NULL);
+		final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+		sc.setExpandHorizontal(true);
+		sc.setExpandVertical(true);
+
+		Composite container = new Composite(sc, SWT.NULL);
+        sc.setContent(container);
 		GridLayout layout = new GridLayout();
 		container.setLayout(layout);
 		layout.numColumns = 3;
@@ -150,9 +156,11 @@
 			}
 		});
 
+		sc.setMinSize(container.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
 		initialize();
 		dialogChanged();
-		setControl(container);
+        setControl(sc);
 	}
 
 	/**

Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java	2008-07-02 17:30:46 UTC (rev 9047)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java	2008-07-02 17:54:28 UTC (rev 9048)
@@ -30,6 +30,7 @@
 import org.eclipse.jface.dialogs.IMessageProvider;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -58,7 +59,12 @@
 	public void createControl(Composite parent) {
 		initializeDialogUnits(parent);
 
-		Composite container = new Composite(parent, SWT.NULL);
+		final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+		sc.setExpandHorizontal(true);
+		sc.setExpandVertical(true);
+
+		Composite container = new Composite(sc, SWT.NULL);
+        sc.setContent(container);
 		//container.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_CYAN));
 
 		GridLayout layout = new GridLayout();
@@ -91,8 +97,10 @@
 		gd.horizontalSpan=3;
 		tfc.setLayoutData(gd);
 
-		setControl(container);
+		sc.setMinSize(container.computeSize(SWT.DEFAULT, SWT.DEFAULT));
 
+		setControl(sc);
+
 		if(selectedConfiguratonName!=null) {
 			consoleConfigurationName.setText(selectedConfiguratonName);
 		}
@@ -107,6 +115,7 @@
      * Ensures that contents is ok.
      */
     private void dialogChanged() {
+    	//updateButtons();
 
     	if (hasDuplicates()) {
         	updateWarningStatus(HibernateConsoleMessages.TableFilterWizardPage_table_filters_contains_duplicates);
@@ -116,6 +125,18 @@
     	updateWarningStatus(null);
     }
 
+    /**
+     * Updates buttons state.
+     */
+    private void updateButtons() {
+    	String strConsoleConfig = consoleConfigurationName.getText();
+    	boolean enabled = true;
+    	if (null == strConsoleConfig || 0 == strConsoleConfig.length()) {
+    		enabled = false;
+    	}
+    	tfc.setRefreshEnabled(enabled);
+    }
+
     protected boolean hasDuplicates() {
     	boolean res = false;
     	ITableFilter[] filters = getTableFilters();




More information about the jbosstools-commits mailing list