Author: vyemialyanchyk
Date: 2008-07-02 13:30:46 -0400 (Wed, 02 Jul 2008)
New Revision: 9047
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1611 - add scrollbars
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2008-07-02
13:58:15 UTC (rev 9046)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2008-07-02
17:30:46 UTC (rev 9047)
@@ -46,6 +46,7 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -96,8 +97,12 @@
public void createControl(Composite parent) {
//initializeDialogUnits(parent);
+ final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL |
SWT.V_SCROLL);
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
- Composite container = new Composite(parent, SWT.NULL);
+ Composite container = new Composite(sc, SWT.NULL);
+ sc.setContent(container);
GridLayout layout = new GridLayout();
container.setLayout(layout);
@@ -246,8 +251,10 @@
// Hack to tell the text field to stretch!
( (GridData)controls[1].getLayoutData() ).grabExcessHorizontalSpace=true;
- dialogChanged();
- setControl(container);
+ sc.setMinSize(container.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
+ dialogChanged();
+ setControl(sc);
}
private void fillLabel(Composite container) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2008-07-02
13:58:15 UTC (rev 9046)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2008-07-02
17:30:46 UTC (rev 9047)
@@ -65,6 +65,7 @@
import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -129,10 +130,13 @@
public void createControl(Composite parent) {
selectedExporters = new HashSet();
deletedExporterIds = new HashSet();
- // ScrolledComposite scrolled = new ScrolledComposite(parent,
- // SWT.V_SCROLL | SWT.H_SCROLL);
- Composite container = new Composite( parent, SWT.NONE );
+ final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL |
SWT.V_SCROLL);
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+
+ Composite container = new Composite( sc, SWT.NONE );
+ sc.setContent(container);
GridData controlData = new GridData( GridData.FILL_BOTH );
container.setLayoutData( controlData );
@@ -148,8 +152,10 @@
createExporterProperties( container );
+ sc.setMinSize(container.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
dialogChanged();
- setControl( container );
+ setControl(sc);
}
private void createExporterProperties(Composite parent) {