Author: snjeza
Date: 2011-01-13 17:21:34 -0500 (Thu, 13 Jan 2011)
New Revision: 28206
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
Log:
JBIDE-8025 New Project Example wizard page is too narrow.
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2011-01-13
22:16:26 UTC (rev 28205)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2011-01-13
22:21:34 UTC (rev 28206)
@@ -75,6 +75,7 @@
*/
public class NewProjectExamplesWizardPage extends WizardPage {
+ private static final int DEFAULT_HEIGHT = 350;
private static final int DEFAULT_WIDTH = 600;
private IStructuredSelection selection;
private Button showQuickFixButton;
@@ -309,13 +310,21 @@
private void configureSizeAndLocation() {
Shell shell = getContainer().getShell();
- Point size = new Point(DEFAULT_WIDTH,shell.getSize().y);
+ Point size = new Point(DEFAULT_WIDTH, getHeight());
shell.setSize(size);
Point location = getInitialLocation(size, shell);
shell.setBounds(getConstrainedShellBounds(new Rectangle(location.x,
location.y, size.x, size.y)));
}
+ private int getHeight() {
+ GC gc = new GC(getControl());
+ int height = Dialog.convertVerticalDLUsToPixels(gc
+ .getFontMetrics(), DEFAULT_HEIGHT);
+ gc.dispose();
+ return height;
+ }
+
private Rectangle getConstrainedShellBounds(Rectangle preferredSize) {
Rectangle result = new Rectangle(preferredSize.x, preferredSize.y,
preferredSize.width, preferredSize.height);
Show replies by date