Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2014-01-31 18:04:49 +0000
committerGerrit Code Review @ Eclipse.org2014-02-12 01:29:55 +0000
commit2e0518f8b3c7ab9906528e3c4f00459851788c58 (patch)
tree0c55bf88fc05ea6f37284f5e5949634b3e18f5df
parentff4c0c3bb2acad4dd614680a7228aa4c3f3ab025 (diff)
downloadorg.eclipse.mylyn.tasks-2e0518f8b3c7ab9906528e3c4f00459851788c58.tar.gz
org.eclipse.mylyn.tasks-2e0518f8b3c7ab9906528e3c4f00459851788c58.tar.xz
org.eclipse.mylyn.tasks-2e0518f8b3c7ab9906528e3c4f00459851788c58.zip
425926: addScrollListener should not require a scroll bar
Impossible to scroll after patchset lost focus Change-Id: Ia9b48a917d437f561b6897f6c9a048ddaf56f2b6 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=425926
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java
index 4cdee7a81..958668dd5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java
@@ -549,17 +549,18 @@ public class EditorUtil {
if (textWidget.getVerticalBar() != null) {
textWidget.addMouseWheelListener(new MouseWheelListener() {
public void mouseScrolled(MouseEvent event) {
- ScrollBar verticalBar = textWidget.getVerticalBar();
ScrolledComposite form = FormUtil.getScrolledComposite(textWidget);
- if (verticalBar != null && form != null) {
+ if (form != null) {
+ ScrollBar verticalBar = textWidget.getVerticalBar();
if (event.count < 0) {
// scroll form down
- if (verticalBar.getSelection() + verticalBar.getThumb() == verticalBar.getMaximum()) {
+ if (verticalBar == null
+ || verticalBar.getSelection() + verticalBar.getThumb() == verticalBar.getMaximum()) {
EditorUtil.scroll(form, 0, form.getVerticalBar().getIncrement());
}
} else {
// scroll form up
- if (verticalBar.getSelection() == verticalBar.getMinimum()) {
+ if (verticalBar == null || verticalBar.getSelection() == verticalBar.getMinimum()) {
EditorUtil.scroll(form, 0, -form.getVerticalBar().getIncrement());
}
}

Back to the top