summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-04-07 06:26:50 (EDT)
committerCarsten Drossel2009-04-07 06:26:50 (EDT)
commit605ec5a9db1690ae1129690e00263f4fd9294d87 (patch)
tree4e586cf79f13a2d931813ad7b53bc16c3e3456d8
parented64d1feaaa10d5704348d50505ba91a7ca98c4e (diff)
downloadorg.eclipse.riena-605ec5a9db1690ae1129690e00263f4fd9294d87.zip
org.eclipse.riena-605ec5a9db1690ae1129690e00263f4fd9294d87.tar.gz
org.eclipse.riena-605ec5a9db1690ae1129690e00263f4fd9294d87.tar.bz2
bug 270620
-rw-r--r--org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/NavigationViewPart.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/NavigationViewPart.java b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/NavigationViewPart.java
index b3119bb..2016569 100644
--- a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/NavigationViewPart.java
+++ b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/NavigationViewPart.java
@@ -17,6 +17,8 @@ import java.util.List;
import java.util.Map;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
@@ -51,6 +53,7 @@ public class NavigationViewPart extends ViewPart implements IModuleNavigationCom
private IViewFactory viewFactory;
private Composite parent;
+ private ResizeListener resizeListener;
private Composite scrolledComposite;
private ScrollingSupport scrollingSupport;
private List<ModuleGroupView> moduleGroupViews = new ArrayList<ModuleGroupView>();
@@ -100,6 +103,8 @@ public class NavigationViewPart extends ViewPart implements IModuleNavigationCom
// configure layout
parent.setLayout(new FormLayout());
parent.setBackground(LnfManager.getLnf().getColor(LnfKeyConstants.NAVIGATION_BACKGROUND));
+ resizeListener = new ResizeListener();
+ parent.addControlListener(resizeListener);
navigationMainComposite = new Composite(parent, SWT.DOUBLE_BUFFERED);
navigationMainComposite.setLayout(new FormLayout());
@@ -121,6 +126,18 @@ public class NavigationViewPart extends ViewPart implements IModuleNavigationCom
scrollingSupport.getScrollComposite().setLayoutData(formData);
}
+ /**
+ * @see org.eclipse.ui.part.WorkbenchPart#dispose()
+ */
+ @Override
+ public void dispose() {
+ super.dispose();
+
+ if (parent != null && resizeListener != null) {
+ parent.removeControlListener(resizeListener);
+ }
+ }
+
private void buildNavigationViewHierarchy() {
// get the root of the SubApplication
ISubApplicationNode subApplicationNode = getSubApplicationNode();
@@ -138,6 +155,17 @@ public class NavigationViewPart extends ViewPart implements IModuleNavigationCom
}
/**
+ * Update the size of the navigation area when the application is resized
+ * (fix for bug 270620).
+ */
+ private final class ResizeListener extends ControlAdapter {
+ public void controlResized(ControlEvent e) {
+ updateNavigationSize();
+ parent.layout();
+ }
+ }
+
+ /**
* The Listener updates the size of the navigation, if a child is added or
* removed.
*/