Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2015-03-24 13:48:37 +0000
committerDani Megert2015-03-24 13:48:37 +0000
commit2bb55ad088094656f8cda170f76cab29d1811c62 (patch)
tree4ea9eeb1cfe57f29ea48bc1281b47c156d4b57de /org.eclipse.ui.console/src
parent61e345fafb3d0e905e089350709f8cdfd92846ab (diff)
downloadeclipse.platform.debug-2bb55ad088094656f8cda170f76cab29d1811c62.tar.gz
eclipse.platform.debug-2bb55ad088094656f8cda170f76cab29d1811c62.tar.xz
eclipse.platform.debug-2bb55ad088094656f8cda170f76cab29d1811c62.zip
Fixed bug 459517: [console] Auto-scroll lock should not affect the view state
Diffstat (limited to 'org.eclipse.ui.console/src')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IScrollLockStateProvider.java24
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java6
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java19
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java10
4 files changed, 51 insertions, 8 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IScrollLockStateProvider.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IScrollLockStateProvider.java
index 457bd152a..269bde45d 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IScrollLockStateProvider.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IScrollLockStateProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 IBM Corporation and others.
+ * Copyright (c) 2014, 2015 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
@@ -25,7 +25,7 @@ package org.eclipse.ui.console;
public interface IScrollLockStateProvider {
/**
- * Sets the scroll lock state.
+ * Sets the scroll lock state set by user manually.
*
* @param scrollLock <code>true</code> to turn scroll lock on, otherwise
* <code>false</code>
@@ -33,10 +33,28 @@ public interface IScrollLockStateProvider {
public void setScrollLock(boolean scrollLock);
/**
- * Returns the scroll lock state.
+ * Sets the scroll lock state for the current page automatically due to
+ * user's action on console page.
+ *
+ * @param scrollLock <code>true</code> to turn scroll lock on, otherwise
+ * <code>false</code>
+ */
+ public void setAutoScrollLock(boolean scrollLock);
+
+ /**
+ * Returns the scroll lock state of the current page set by user manually.
*
* @return <code>true</code> if scroll lock is on, <code>false</code>
* otherwise
*/
public boolean getScrollLock();
+
+ /**
+ * Returns the scroll lock state of the Page which was manually set by user
+ * or automatically set due to user's action on console page.
+ *
+ * @return <code>true</code> if scroll lock is on, <code>false</code>
+ * otherwise
+ */
+ public boolean getAutoScrollLock();
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
index ce731beee..504f0ce0a 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -148,8 +148,8 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
// set the scroll Lock setting for Console Viewer and Console View
private void setScrollLock(boolean lock) {
userHoldsScrollLock.set(lock);
- if (scrollLockStateProvider != null && scrollLockStateProvider.getScrollLock() != lock) {
- scrollLockStateProvider.setScrollLock(lock);
+ if (scrollLockStateProvider != null && scrollLockStateProvider.getAutoScrollLock() != lock) {
+ scrollLockStateProvider.setAutoScrollLock(lock);
}
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
index fdfc65b4f..714fe9de2 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
@@ -185,7 +185,6 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
}
IPage page = getCurrentPage();
if (page instanceof IOConsolePage) {
- ((IOConsolePage)page).setAutoScroll(!fScrollLock);
((IOConsolePage) page).setWordWrap(fWordWrap);
}
}
@@ -795,4 +794,22 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
setPinned(true);
}
}
+
+ @Override
+ public void setAutoScrollLock(boolean scrollLock) {
+ IPage page = getCurrentPage();
+ if (page instanceof IOConsolePage) {
+ ((IOConsolePage) page).setAutoScroll(!scrollLock);
+ }
+
+ }
+
+ @Override
+ public boolean getAutoScrollLock() {
+ IPage page = getCurrentPage();
+ if (page instanceof IOConsolePage) {
+ return !((IOConsolePage) page).isAutoScroll();
+ }
+ return fScrollLock;
+ }
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java
index a31c6c093..1b876a93e 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -78,6 +78,14 @@ public class IOConsolePage extends TextConsolePage {
}
}
+ public boolean isAutoScroll() {
+ IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
+ if (viewer != null) {
+ return viewer.isAutoScroll();
+
+ }
+ return false;
+ }
public void setWordWrap(boolean wordwrap) {
IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
if (viewer != null) {

Back to the top