Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2014-02-18 19:43:26 +0000
committerSam Davis2014-02-18 19:44:58 +0000
commit2e728e5d380a13ab769830d588ebff70a60f19b9 (patch)
tree5eadd395f4daf37d5335a8839cf80a6ffd9a87a3 /org.eclipse.mylyn.tasks.ui
parent054c23fa680f684ed215450395bc04b42a31f624 (diff)
downloadorg.eclipse.mylyn.tasks-2e728e5d380a13ab769830d588ebff70a60f19b9.tar.gz
org.eclipse.mylyn.tasks-2e728e5d380a13ab769830d588ebff70a60f19b9.tar.xz
org.eclipse.mylyn.tasks-2e728e5d380a13ab769830d588ebff70a60f19b9.zip
425926: ensure addScrollListener does not require a scroll bar
Impossible to scroll after patchset lost focus Change-Id: I9f4315794444dafacc29d75a2dbcb18c17a553f6 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=425926
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java36
1 files changed, 17 insertions, 19 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 958668dd5..da0a22f6d 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
@@ -546,28 +546,26 @@ public class EditorUtil {
}
public static void addScrollListener(final Scrollable textWidget) {
- if (textWidget.getVerticalBar() != null) {
- textWidget.addMouseWheelListener(new MouseWheelListener() {
- public void mouseScrolled(MouseEvent event) {
- ScrolledComposite form = FormUtil.getScrolledComposite(textWidget);
- if (form != null) {
- ScrollBar verticalBar = textWidget.getVerticalBar();
- if (event.count < 0) {
- // scroll form down
- if (verticalBar == null
- || verticalBar.getSelection() + verticalBar.getThumb() == verticalBar.getMaximum()) {
- EditorUtil.scroll(form, 0, form.getVerticalBar().getIncrement());
- }
- } else {
- // scroll form up
- if (verticalBar == null || verticalBar.getSelection() == verticalBar.getMinimum()) {
- EditorUtil.scroll(form, 0, -form.getVerticalBar().getIncrement());
- }
+ textWidget.addMouseWheelListener(new MouseWheelListener() {
+ public void mouseScrolled(MouseEvent event) {
+ ScrolledComposite form = FormUtil.getScrolledComposite(textWidget);
+ if (form != null) {
+ ScrollBar verticalBar = textWidget.getVerticalBar();
+ if (event.count < 0) {
+ // scroll form down
+ if (verticalBar == null
+ || verticalBar.getSelection() + verticalBar.getThumb() == verticalBar.getMaximum()) {
+ EditorUtil.scroll(form, 0, form.getVerticalBar().getIncrement());
+ }
+ } else {
+ // scroll form up
+ if (verticalBar == null || verticalBar.getSelection() == verticalBar.getMinimum()) {
+ EditorUtil.scroll(form, 0, -form.getVerticalBar().getIncrement());
}
}
}
- });
- }
+ }
+ });
}
public static void addScrollListener(final CCombo combo) {

Back to the top