summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMarkus Keller2011-02-07 10:50:29 (EST)
committer Dani Megert2011-10-06 03:51:56 (EDT)
commiteab9e01d0609234b09f6b52ef55ed1b67e4f75d9 (patch)
tree579e592a57fca52a46cd3058795801141eb4149b
parent74f04c211a0e6ad9851fd92ea3451501ddf011ff (diff)
downloadeclipse.platform.ui-eab9e01d0609234b09f6b52ef55ed1b67e4f75d9.zip
eclipse.platform.ui-eab9e01d0609234b09f6b52ef55ed1b67e4f75d9.tar.gz
eclipse.platform.ui-eab9e01d0609234b09f6b52ef55ed1b67e4f75d9.tar.bz2
Bug 334996: PageBook#showPage(Control) should set all other pages to invisible
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBook.java32
1 files changed, 13 insertions, 19 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBook.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBook.java
index 5a0d988..9c5f621 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBook.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBook.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -92,30 +92,24 @@ public class PageBook extends Composite {
* @param page the page to show
*/
public void showPage(Control page) {
-
- if (page == currentPage) {
- return;
- }
- if (page.getParent() != this) {
+ if (page.isDisposed() || page.getParent() != this) {
return;
}
- Control oldPage = currentPage;
- currentPage = page;
+ currentPage = page;
// show new page
- if (page != null) {
- if (!page.isDisposed()) {
- page.setVisible(true);
- layout(true);
- // if (fRequestFocusOnShowPage)
- // page.setFocus();
- }
- }
+ page.setVisible(true);
+ layout(true);
- // hide old *after* new page has been made visible in order to avoid flashing
- if (oldPage != null && !oldPage.isDisposed()) {
- oldPage.setVisible(false);
+ // hide old (and all others) *after* new page has been made visible in
+ // order to avoid flashing
+ Control[] children = getChildren();
+ for (int i = 0; i < children.length; i++) {
+ Control child = children[i];
+ if (child != page && !child.isDisposed()) {
+ child.setVisible(false);
+ }
}
}
}