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 (-2 / +18 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 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.
37
	 *
38
	 * @param scrollLock <code>true</code> to turn scroll lock on, otherwise
39
	 *            <code>false</code>
40
	 */
41
	public void setPageScrollLock(boolean scrollLock);
42
43
	/**
44
	 * Returns the scroll lock state of the current page.
37
	 *
45
	 *
38
	 * @return <code>true</code> if scroll lock is on, <code>false</code>
46
	 * @return <code>true</code> if scroll lock is on, <code>false</code>
39
	 *         otherwise
47
	 *         otherwise
40
	 */
48
	 */
41
	public boolean getScrollLock();
49
	public boolean getScrollLock();
50
51
	/**
52
	 * Returns the scroll lock state of the Page.
53
	 *
54
	 * @return <code>true</code> if scroll lock is on, <code>false</code>
55
	 *         otherwise
56
	 */
57
	public boolean getPageScrollLock();
42
}
58
}
(-)src/org/eclipse/ui/console/TextConsoleViewer.java (-26 / +22 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 15-20 Link Here
15
import java.util.List;
15
import java.util.List;
16
import java.util.concurrent.atomic.AtomicBoolean;
16
import java.util.concurrent.atomic.AtomicBoolean;
17
17
18
import org.eclipse.core.runtime.IProgressMonitor;
19
import org.eclipse.core.runtime.IStatus;
20
import org.eclipse.core.runtime.Status;
21
import org.eclipse.jface.preference.JFacePreferences;
22
import org.eclipse.jface.resource.ColorRegistry;
23
import org.eclipse.jface.resource.JFaceColors;
24
import org.eclipse.jface.resource.JFaceResources;
25
import org.eclipse.jface.text.BadPositionCategoryException;
26
import org.eclipse.jface.text.DocumentEvent;
27
import org.eclipse.jface.text.IDocument;
28
import org.eclipse.jface.text.IDocumentAdapter;
29
import org.eclipse.jface.text.IDocumentListener;
30
import org.eclipse.jface.text.IPositionUpdater;
31
import org.eclipse.jface.text.IRegion;
32
import org.eclipse.jface.text.JFaceTextUtil;
33
import org.eclipse.jface.text.Position;
34
import org.eclipse.jface.text.source.SourceViewer;
35
import org.eclipse.jface.util.IPropertyChangeListener;
36
import org.eclipse.jface.util.PropertyChangeEvent;
18
import org.eclipse.swt.SWT;
37
import org.eclipse.swt.SWT;
19
import org.eclipse.swt.custom.LineBackgroundEvent;
38
import org.eclipse.swt.custom.LineBackgroundEvent;
20
import org.eclipse.swt.custom.LineBackgroundListener;
39
import org.eclipse.swt.custom.LineBackgroundListener;
Lines 40-68 Link Here
40
import org.eclipse.swt.widgets.Display;
59
import org.eclipse.swt.widgets.Display;
41
import org.eclipse.swt.widgets.Event;
60
import org.eclipse.swt.widgets.Event;
42
import org.eclipse.swt.widgets.Listener;
61
import org.eclipse.swt.widgets.Listener;
43
44
import org.eclipse.core.runtime.IProgressMonitor;
45
import org.eclipse.core.runtime.IStatus;
46
import org.eclipse.core.runtime.Status;
47
48
import org.eclipse.jface.preference.JFacePreferences;
49
import org.eclipse.jface.resource.ColorRegistry;
50
import org.eclipse.jface.resource.JFaceColors;
51
import org.eclipse.jface.resource.JFaceResources;
52
import org.eclipse.jface.util.IPropertyChangeListener;
53
import org.eclipse.jface.util.PropertyChangeEvent;
54
55
import org.eclipse.jface.text.BadPositionCategoryException;
56
import org.eclipse.jface.text.DocumentEvent;
57
import org.eclipse.jface.text.IDocument;
58
import org.eclipse.jface.text.IDocumentAdapter;
59
import org.eclipse.jface.text.IDocumentListener;
60
import org.eclipse.jface.text.IPositionUpdater;
61
import org.eclipse.jface.text.IRegion;
62
import org.eclipse.jface.text.JFaceTextUtil;
63
import org.eclipse.jface.text.Position;
64
import org.eclipse.jface.text.source.SourceViewer;
65
66
import org.eclipse.ui.internal.console.ConsoleDocumentAdapter;
62
import org.eclipse.ui.internal.console.ConsoleDocumentAdapter;
67
import org.eclipse.ui.internal.console.ConsoleHyperlinkPosition;
63
import org.eclipse.ui.internal.console.ConsoleHyperlinkPosition;
68
import org.eclipse.ui.progress.WorkbenchJob;
64
import org.eclipse.ui.progress.WorkbenchJob;
Lines 148-155 Link Here
148
	// set the scroll Lock setting for Console Viewer and Console View
144
	// set the scroll Lock setting for Console Viewer and Console View
149
	private void setScrollLock(boolean lock) {
145
	private void setScrollLock(boolean lock) {
150
		userHoldsScrollLock.set(lock);
146
		userHoldsScrollLock.set(lock);
151
		if (scrollLockStateProvider != null && scrollLockStateProvider.getScrollLock() != lock) {
147
		if (scrollLockStateProvider != null && scrollLockStateProvider.getPageScrollLock() != lock) {
152
			scrollLockStateProvider.setScrollLock(lock);
148
			scrollLockStateProvider.setPageScrollLock(lock);
153
		}
149
		}
154
	}
150
	}
155
151
(-)src/org/eclipse/ui/internal/console/ConsoleView.java (-5 / +19 lines)
Lines 19-25 Link Here
19
import org.eclipse.core.runtime.ISafeRunnable;
19
import org.eclipse.core.runtime.ISafeRunnable;
20
import org.eclipse.core.runtime.ListenerList;
20
import org.eclipse.core.runtime.ListenerList;
21
import org.eclipse.core.runtime.SafeRunner;
21
import org.eclipse.core.runtime.SafeRunner;
22
23
import org.eclipse.jface.action.ActionContributionItem;
22
import org.eclipse.jface.action.ActionContributionItem;
24
import org.eclipse.jface.action.IAction;
23
import org.eclipse.jface.action.IAction;
25
import org.eclipse.jface.action.IToolBarManager;
24
import org.eclipse.jface.action.IToolBarManager;
Lines 29-35 Link Here
29
import org.eclipse.jface.util.IPropertyChangeListener;
28
import org.eclipse.jface.util.IPropertyChangeListener;
30
import org.eclipse.jface.util.PropertyChangeEvent;
29
import org.eclipse.jface.util.PropertyChangeEvent;
31
import org.eclipse.jface.viewers.IBasicPropertyConstants;
30
import org.eclipse.jface.viewers.IBasicPropertyConstants;
32
33
import org.eclipse.swt.custom.StyledText;
31
import org.eclipse.swt.custom.StyledText;
34
import org.eclipse.swt.events.MouseAdapter;
32
import org.eclipse.swt.events.MouseAdapter;
35
import org.eclipse.swt.events.MouseEvent;
33
import org.eclipse.swt.events.MouseEvent;
Lines 39-45 Link Here
39
import org.eclipse.swt.widgets.Event;
37
import org.eclipse.swt.widgets.Event;
40
import org.eclipse.swt.widgets.ToolBar;
38
import org.eclipse.swt.widgets.ToolBar;
41
import org.eclipse.swt.widgets.ToolItem;
39
import org.eclipse.swt.widgets.ToolItem;
42
43
import org.eclipse.ui.IPartListener2;
40
import org.eclipse.ui.IPartListener2;
44
import org.eclipse.ui.IViewReference;
41
import org.eclipse.ui.IViewReference;
45
import org.eclipse.ui.IViewSite;
42
import org.eclipse.ui.IViewSite;
Lines 185-191 Link Here
185
	    }
182
	    }
186
	    IPage page = getCurrentPage();
183
	    IPage page = getCurrentPage();
187
	    if (page instanceof IOConsolePage) {
184
	    if (page instanceof IOConsolePage) {
188
	        ((IOConsolePage)page).setAutoScroll(!fScrollLock);
189
	        ((IOConsolePage) page).setWordWrap(fWordWrap);
185
	        ((IOConsolePage) page).setWordWrap(fWordWrap);
190
	    }
186
	    }
191
	}
187
	}
Lines 756-762 Link Here
756
752
757
        IPage page = getCurrentPage();
753
        IPage page = getCurrentPage();
758
        if (page instanceof IOConsolePage) {
754
        if (page instanceof IOConsolePage) {
759
            ((IOConsolePage)page).setAutoScroll(!scrollLock);
755
			((IOConsolePage) page).setPageAutoScroll(!scrollLock);
760
        }
756
        }
761
    }
757
    }
762
758
Lines 795-798 Link Here
795
            setPinned(true);
791
            setPinned(true);
796
        }
792
        }
797
    }
793
    }
794
795
	@Override
796
	public void setPageScrollLock(boolean scrollLock) {
797
		IPage page = getCurrentPage();
798
		if (page instanceof IOConsolePage) {
799
			((IOConsolePage) page).setPageAutoScroll(!scrollLock);
800
		}
801
802
	}
803
804
	@Override
805
	public boolean getPageScrollLock() {
806
		IPage page = getCurrentPage();
807
		if (page instanceof IOConsolePage) {
808
			return !((IOConsolePage) page).isPageAutoScroll();
809
		}
810
		return fScrollLock;
811
	}
798
}
812
}
(-)src/org/eclipse/ui/internal/console/IOConsolePage.java (-9 / +18 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 70-82 Link Here
70
		return new IOConsoleViewer(parent, (TextConsole) getConsole(), fView);
70
		return new IOConsoleViewer(parent, (TextConsole) getConsole(), fView);
71
    }
71
    }
72
72
73
    public void setAutoScroll(boolean scroll) {
73
	public void setPageAutoScroll(boolean scroll) {
74
        IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
74
		IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
75
        if (viewer != null) {
75
		if (viewer != null) {
76
            viewer.setAutoScroll(scroll);
76
			viewer.setPageAutoScroll(scroll);
77
            fScrollLockAction.setChecked(!scroll);
77
			fScrollLockAction.setChecked(!scroll);
78
        }
78
		}
79
    }
79
	}
80
81
	public boolean isPageAutoScroll() {
82
		IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
83
		if (viewer != null) {
84
			return viewer.isPageAutoScroll();
85
86
		}
87
		return false;
88
	}
80
89
81
    public void setWordWrap(boolean wordwrap) {
90
    public void setWordWrap(boolean wordwrap) {
82
        IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
91
        IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
Lines 101-107 Link Here
101
	protected void createActions() {
110
	protected void createActions() {
102
        super.createActions();
111
        super.createActions();
103
        fScrollLockAction = new ScrollLockAction(getConsoleView());
112
        fScrollLockAction = new ScrollLockAction(getConsoleView());
104
        setAutoScroll(!fScrollLockAction.isChecked());
113
		// setAutoScroll(!fScrollLockAction.isChecked());
105
        fWordWrapAction = new WordWrapAction(getConsoleView());
114
        fWordWrapAction = new WordWrapAction(getConsoleView());
106
        setWordWrap(fWordWrapAction.isChecked());
115
        setWordWrap(fWordWrapAction.isChecked());
107
    }
116
    }
(-)src/org/eclipse/ui/internal/console/IOConsoleViewer.java (-9 / +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 33-39 Link Here
33
    /**
33
    /**
34
     * will always scroll with output if value is true.
34
     * will always scroll with output if value is true.
35
     */
35
     */
36
    private boolean fAutoScroll = true;
36
	private boolean fPageAutoScroll = true;
37
37
38
    private boolean fWordWrap = false;
38
    private boolean fWordWrap = false;
39
39
Lines 55-67 Link Here
55
		super(parent, console, scrollLockStateProvider);
55
		super(parent, console, scrollLockStateProvider);
56
	}
56
	}
57
57
58
    public boolean isAutoScroll() {
58
	public boolean isPageAutoScroll() {
59
        return fAutoScroll;
59
		return fPageAutoScroll;
60
    }
60
	}
61
61
62
    public void setAutoScroll(boolean scroll) {
62
	public void setPageAutoScroll(boolean scroll) {
63
        fAutoScroll = scroll;
63
		fPageAutoScroll = scroll;
64
    }
64
	}
65
65
66
    public boolean isWordWrap() {
66
    public boolean isWordWrap() {
67
        return fWordWrap;
67
        return fWordWrap;
Lines 155-161 Link Here
155
155
156
                @Override
156
                @Override
157
				public void documentChanged(DocumentEvent event) {
157
				public void documentChanged(DocumentEvent event) {
158
                    if (fAutoScroll) {
158
					if (fPageAutoScroll) {
159
                        revealEndOfDocument();
159
                        revealEndOfDocument();
160
                    }
160
                    }
161
                }
161
                }

Return to bug 459517