Author: snjeza
Date: 2011-11-10 06:02:27 -0500 (Thu, 10 Nov 2011)
New Revision: 36272
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBIDE-9977 JBoss Central resize issue
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-11-10
10:50:03 UTC (rev 36271)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-11-10
11:02:27 UTC (rev 36272)
@@ -872,8 +872,9 @@
}
tutorialPageBook.showPage(tutorialsComposite);
+ tutorialPageBook.layout(true, true);
form.reflow(true);
- form.redraw();
+ //form.redraw();
resize();
//recomputeScrollComposite(tutorialScrollComposite, tutorialPageBook);
}
@@ -959,8 +960,8 @@
FormText formText = toolkit.createFormText(composite, true);
TableWrapData td = new TableWrapData();
td.indent = 2;
- Point size = newsScrollComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- td.maxWidth = size.x - 2;
+ //Point size = scrollable.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ //td.maxWidth = size.x - 2;
formText.setLayoutData(td);
try {
// to avoid illegal argumentexception on formtext fields.
@@ -1009,10 +1010,11 @@
}
pageBook.showPage(composite);
- composite.layout(true, true);
+ pageBook.layout(true, true);
form.reflow(true);
- form.redraw();
+ //form.redraw();
recomputeScrollComposite(scrollable, pageBook);
+ resize();
}
private void resize() {
@@ -1021,20 +1023,18 @@
protected void resize(boolean force) {
Point size;
- if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ //if (Platform.OS_MACOSX.equals(Platform.getOS())) {
size = form.getSize();
size.y = form.getBody().getSize().y;
- } else {
- size = form.getBody().getSize();
- }
+ //} else {
+ // size = form.getBody().getSize();
+ //}
if (!force && size.equals(oldSize)) {
return;
}
oldSize = size;
GridData gd;
- //Point computedSize;
int widthHint = size.x/2 - 40;
- //computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
gd = (GridData) newsSection.getLayoutData();
if (newsSection.isExpanded()) {
if (blogsSection.isExpanded()) {
@@ -1047,11 +1047,8 @@
}
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- //computedSize = newsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- //newsSection.setSize(widthHint, computedSize.y);
-
+
gd = (GridData) blogsSection.getLayoutData();
- //computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
if (blogsSection.isExpanded()) {
if (newsSection.isExpanded()) {
gd.heightHint = size.y/2 - 20;
@@ -1064,8 +1061,6 @@
gd.widthHint = widthHint;
gd.grabExcessVerticalSpace = false;
- //computedSize = blogsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- //blogsSection.setSize(widthHint, computedSize.y);
gd = (GridData) tutorialsSection.getLayoutData();
//gridData.heightHint = size.y - 40;
@@ -1095,8 +1090,6 @@
//computedSize = projectsSection.computeSize(SWT.DEFAULT, SWT.DEFAULT);
//projectsSection.setSize(widthHint, computedSize.y);
- form.reflow(true);
- form.redraw();
blogsScrollComposite.setMinSize(widthHint, size.y - 55);
newsScrollComposite.setMinSize(widthHint, size.y - 55);
@@ -1105,11 +1098,16 @@
if (y > 200) {
y = 200;
}
- tutorialScrollComposite.setMinSize(widthHint, y);
- //refreshNews();
- //refreshBlogs();
+ tutorialScrollComposite.setMinSize(widthHint, y);
+ //newsPageBook.layout(true, true);
+ //blogsPageBook.layout(true, true);
+ recomputeScrollComposite(blogsScrollComposite, blogsPageBook);
+ recomputeScrollComposite(newsScrollComposite, newsPageBook);
+ //form.redraw();
form.layout(true, true);
+ form.reflow(true);
+
}
private class RefreshBlogsJobChangeListener implements IJobChangeListener {
Show replies by date