Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 459517 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ui/console/IScrollLockStateProvider.java (-3 / +21 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2014 IBM Corporation and others.
2
 * Copyright (c) 2014, 2015 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 25-31 Link Here
25
public interface IScrollLockStateProvider {
25
public interface IScrollLockStateProvider {
26
26
27
	/**
27
	/**
28
	 * Sets the scroll lock state.
28
	 * Sets the scroll lock state set by user manually.
29
	 *
29
	 *
30
	 * @param scrollLock <code>true</code> to turn scroll lock on, otherwise
30
	 * @param scrollLock <code>true</code> to turn scroll lock on, otherwise
31
	 *            <code>false</code>
31
	 *            <code>false</code>
Lines 33-42 Link Here
33
	public void setScrollLock(boolean scrollLock);
33
	public void setScrollLock(boolean scrollLock);
34
34
35
	/**
35
	/**
36
	 * Returns the scroll lock state.
36
	 * Sets the scroll lock state for the current page automatically due to
37
	 * user's action on console page.
38
	 *
39
	 * @param scrollLock <code>true</code> to turn scroll lock on, otherwise
40
	 *            <code>false</code>
41
	 */
42
	public void setAutoScrollLock(boolean scrollLock);
43
44
	/**
45
	 * Returns the scroll lock state of the current page set by user manually.
37
	 *
46
	 *
38
	 * @return <code>true</code> if scroll lock is on, <code>false</code>
47
	 * @return <code>true</code> if scroll lock is on, <code>false</code>
39
	 *         otherwise
48
	 *         otherwise
40
	 */
49
	 */
41
	public boolean getScrollLock();
50
	public boolean getScrollLock();
51
52
	/**
53
	 * Returns the scroll lock state of the Page which was manually set by user
54
	 * or automatically set due to user's action on console page.
55
	 *
56
	 * @return <code>true</code> if scroll lock is on, <code>false</code>
57
	 *         otherwise
58
	 */
59
	public boolean getAutoScrollLock();
42
}
60
}
(-)src/org/eclipse/ui/console/TextConsoleViewer.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2014 IBM Corporation and others.
2
 * Copyright (c) 2000, 2015 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 148-155 Link Here
148
	// set the scroll Lock setting for Console Viewer and Console View
148
	// set the scroll Lock setting for Console Viewer and Console View
149
	private void setScrollLock(boolean lock) {
149
	private void setScrollLock(boolean lock) {
150
		userHoldsScrollLock.set(lock);
150
		userHoldsScrollLock.set(lock);
151
		if (scrollLockStateProvider != null && scrollLockStateProvider.getScrollLock() != lock) {
151
		if (scrollLockStateProvider != null && scrollLockStateProvider.getAutoScrollLock() != lock) {
152
			scrollLockStateProvider.setScrollLock(lock);
152
			scrollLockStateProvider.setAutoScrollLock(lock);
153
		}
153
		}
154
	}
154
	}
155
155
(-)src/org/eclipse/ui/internal/console/ConsoleView.java (-1 / +18 lines)
Lines 185-191 Link Here
185
	    }
185
	    }
186
	    IPage page = getCurrentPage();
186
	    IPage page = getCurrentPage();
187
	    if (page instanceof IOConsolePage) {
187
	    if (page instanceof IOConsolePage) {
188
	        ((IOConsolePage)page).setAutoScroll(!fScrollLock);
189
	        ((IOConsolePage) page).setWordWrap(fWordWrap);
188
	        ((IOConsolePage) page).setWordWrap(fWordWrap);
190
	    }
189
	    }
191
	}
190
	}
Lines 795-798 Link Here
795
            setPinned(true);
794
            setPinned(true);
796
        }
795
        }
797
    }
796
    }
797
798
	@Override
799
	public void setAutoScrollLock(boolean scrollLock) {
800
		IPage page = getCurrentPage();
801
		if (page instanceof IOConsolePage) {
802
			((IOConsolePage) page).setAutoScroll(!scrollLock);
803
		}
804
805
	}
806
807
	@Override
808
	public boolean getAutoScrollLock() {
809
		IPage page = getCurrentPage();
810
		if (page instanceof IOConsolePage) {
811
			return !((IOConsolePage) page).isAutoScroll();
812
		}
813
		return fScrollLock;
814
	}
798
}
815
}
(-)src/org/eclipse/ui/internal/console/IOConsolePage.java (-1 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2014 IBM Corporation and others.
2
 * Copyright (c) 2000, 2015 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 78-83 Link Here
78
        }
78
        }
79
    }
79
    }
80
80
81
    public boolean isAutoScroll() {
82
		IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
83
		if (viewer != null) {
84
			return viewer.isAutoScroll();
85
86
		}
87
		return false;
88
	}
81
    public void setWordWrap(boolean wordwrap) {
89
    public void setWordWrap(boolean wordwrap) {
82
        IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
90
        IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
83
        if (viewer != null) {
91
        if (viewer != null) {

Return to bug 459517