Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 251044 Details for
Bug 459517
[console] Auto-scroll lock should not affect the view state
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Auto scroll lock enabled per page
Bug 459517 - [console] Auto-scroll lock should not affect the view state.patch (text/plain), 10.45 KB, created by
Sarika Sinha
on 2015-02-24 03:23:58 EST
(
hide
)
Description:
Auto scroll lock enabled per page
Filename:
MIME Type:
Creator:
Sarika Sinha
Created:
2015-02-24 03:23:58 EST
Size:
10.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.console >diff --git src/org/eclipse/ui/console/IScrollLockStateProvider.java src/org/eclipse/ui/console/IScrollLockStateProvider.java >index 457bd15..a2af9da 100644 >--- src/org/eclipse/ui/console/IScrollLockStateProvider.java >+++ 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 >@@ -33,10 +33,26 @@ > public void setScrollLock(boolean scrollLock); > > /** >- * Returns the scroll lock state. >+ * Sets the scroll lock state for the current page. >+ * >+ * @param scrollLock <code>true</code> to turn scroll lock on, otherwise >+ * <code>false</code> >+ */ >+ public void setPageScrollLock(boolean scrollLock); >+ >+ /** >+ * Returns the scroll lock state of the current page. > * > * @return <code>true</code> if scroll lock is on, <code>false</code> > * otherwise > */ > public boolean getScrollLock(); >+ >+ /** >+ * Returns the scroll lock state of the Page. >+ * >+ * @return <code>true</code> if scroll lock is on, <code>false</code> >+ * otherwise >+ */ >+ public boolean getPageScrollLock(); > } >diff --git src/org/eclipse/ui/console/TextConsoleViewer.java src/org/eclipse/ui/console/TextConsoleViewer.java >index ce731be..dca8100 100644 >--- src/org/eclipse/ui/console/TextConsoleViewer.java >+++ 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 >@@ -15,6 +15,25 @@ > import java.util.List; > import java.util.concurrent.atomic.AtomicBoolean; > >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.jface.preference.JFacePreferences; >+import org.eclipse.jface.resource.ColorRegistry; >+import org.eclipse.jface.resource.JFaceColors; >+import org.eclipse.jface.resource.JFaceResources; >+import org.eclipse.jface.text.BadPositionCategoryException; >+import org.eclipse.jface.text.DocumentEvent; >+import org.eclipse.jface.text.IDocument; >+import org.eclipse.jface.text.IDocumentAdapter; >+import org.eclipse.jface.text.IDocumentListener; >+import org.eclipse.jface.text.IPositionUpdater; >+import org.eclipse.jface.text.IRegion; >+import org.eclipse.jface.text.JFaceTextUtil; >+import org.eclipse.jface.text.Position; >+import org.eclipse.jface.text.source.SourceViewer; >+import org.eclipse.jface.util.IPropertyChangeListener; >+import org.eclipse.jface.util.PropertyChangeEvent; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.LineBackgroundEvent; > import org.eclipse.swt.custom.LineBackgroundListener; >@@ -40,29 +59,6 @@ > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Listener; >- >-import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Status; >- >-import org.eclipse.jface.preference.JFacePreferences; >-import org.eclipse.jface.resource.ColorRegistry; >-import org.eclipse.jface.resource.JFaceColors; >-import org.eclipse.jface.resource.JFaceResources; >-import org.eclipse.jface.util.IPropertyChangeListener; >-import org.eclipse.jface.util.PropertyChangeEvent; >- >-import org.eclipse.jface.text.BadPositionCategoryException; >-import org.eclipse.jface.text.DocumentEvent; >-import org.eclipse.jface.text.IDocument; >-import org.eclipse.jface.text.IDocumentAdapter; >-import org.eclipse.jface.text.IDocumentListener; >-import org.eclipse.jface.text.IPositionUpdater; >-import org.eclipse.jface.text.IRegion; >-import org.eclipse.jface.text.JFaceTextUtil; >-import org.eclipse.jface.text.Position; >-import org.eclipse.jface.text.source.SourceViewer; >- > import org.eclipse.ui.internal.console.ConsoleDocumentAdapter; > import org.eclipse.ui.internal.console.ConsoleHyperlinkPosition; > import org.eclipse.ui.progress.WorkbenchJob; >@@ -148,8 +144,8 @@ > // 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.getPageScrollLock() != lock) { >+ scrollLockStateProvider.setPageScrollLock(lock); > } > } > >diff --git src/org/eclipse/ui/internal/console/ConsoleView.java src/org/eclipse/ui/internal/console/ConsoleView.java >index fdfc65b..d846af3 100644 >--- src/org/eclipse/ui/internal/console/ConsoleView.java >+++ src/org/eclipse/ui/internal/console/ConsoleView.java >@@ -19,7 +19,6 @@ > import org.eclipse.core.runtime.ISafeRunnable; > import org.eclipse.core.runtime.ListenerList; > import org.eclipse.core.runtime.SafeRunner; >- > import org.eclipse.jface.action.ActionContributionItem; > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.action.IToolBarManager; >@@ -29,7 +28,6 @@ > import org.eclipse.jface.util.IPropertyChangeListener; > import org.eclipse.jface.util.PropertyChangeEvent; > import org.eclipse.jface.viewers.IBasicPropertyConstants; >- > import org.eclipse.swt.custom.StyledText; > import org.eclipse.swt.events.MouseAdapter; > import org.eclipse.swt.events.MouseEvent; >@@ -39,7 +37,6 @@ > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.ToolBar; > import org.eclipse.swt.widgets.ToolItem; >- > import org.eclipse.ui.IPartListener2; > import org.eclipse.ui.IViewReference; > import org.eclipse.ui.IViewSite; >@@ -185,7 +182,6 @@ > } > IPage page = getCurrentPage(); > if (page instanceof IOConsolePage) { >- ((IOConsolePage)page).setAutoScroll(!fScrollLock); > ((IOConsolePage) page).setWordWrap(fWordWrap); > } > } >@@ -756,7 +752,7 @@ > > IPage page = getCurrentPage(); > if (page instanceof IOConsolePage) { >- ((IOConsolePage)page).setAutoScroll(!scrollLock); >+ ((IOConsolePage) page).setPageAutoScroll(!scrollLock); > } > } > >@@ -795,4 +791,22 @@ > setPinned(true); > } > } >+ >+ @Override >+ public void setPageScrollLock(boolean scrollLock) { >+ IPage page = getCurrentPage(); >+ if (page instanceof IOConsolePage) { >+ ((IOConsolePage) page).setPageAutoScroll(!scrollLock); >+ } >+ >+ } >+ >+ @Override >+ public boolean getPageScrollLock() { >+ IPage page = getCurrentPage(); >+ if (page instanceof IOConsolePage) { >+ return !((IOConsolePage) page).isPageAutoScroll(); >+ } >+ return fScrollLock; >+ } > } >diff --git src/org/eclipse/ui/internal/console/IOConsolePage.java src/org/eclipse/ui/internal/console/IOConsolePage.java >index a31c6c0..895a69a 100644 >--- src/org/eclipse/ui/internal/console/IOConsolePage.java >+++ 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 >@@ -70,13 +70,22 @@ > return new IOConsoleViewer(parent, (TextConsole) getConsole(), fView); > } > >- public void setAutoScroll(boolean scroll) { >- IOConsoleViewer viewer = (IOConsoleViewer) getViewer(); >- if (viewer != null) { >- viewer.setAutoScroll(scroll); >- fScrollLockAction.setChecked(!scroll); >- } >- } >+ public void setPageAutoScroll(boolean scroll) { >+ IOConsoleViewer viewer = (IOConsoleViewer) getViewer(); >+ if (viewer != null) { >+ viewer.setPageAutoScroll(scroll); >+ fScrollLockAction.setChecked(!scroll); >+ } >+ } >+ >+ public boolean isPageAutoScroll() { >+ IOConsoleViewer viewer = (IOConsoleViewer) getViewer(); >+ if (viewer != null) { >+ return viewer.isPageAutoScroll(); >+ >+ } >+ return false; >+ } > > public void setWordWrap(boolean wordwrap) { > IOConsoleViewer viewer = (IOConsoleViewer) getViewer(); >@@ -101,7 +110,6 @@ > protected void createActions() { > super.createActions(); > fScrollLockAction = new ScrollLockAction(getConsoleView()); >- setAutoScroll(!fScrollLockAction.isChecked()); > fWordWrapAction = new WordWrapAction(getConsoleView()); > setWordWrap(fWordWrapAction.isChecked()); > } >diff --git src/org/eclipse/ui/internal/console/IOConsoleViewer.java src/org/eclipse/ui/internal/console/IOConsoleViewer.java >index 2ede958..d624da1 100644 >--- src/org/eclipse/ui/internal/console/IOConsoleViewer.java >+++ src/org/eclipse/ui/internal/console/IOConsoleViewer.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 >@@ -33,7 +33,7 @@ > /** > * will always scroll with output if value is true. > */ >- private boolean fAutoScroll = true; >+ private boolean fPageAutoScroll = true; > > private boolean fWordWrap = false; > >@@ -55,13 +55,13 @@ > super(parent, console, scrollLockStateProvider); > } > >- public boolean isAutoScroll() { >- return fAutoScroll; >- } >+ public boolean isPageAutoScroll() { >+ return fPageAutoScroll; >+ } > >- public void setAutoScroll(boolean scroll) { >- fAutoScroll = scroll; >- } >+ public void setPageAutoScroll(boolean scroll) { >+ fPageAutoScroll = scroll; >+ } > > public boolean isWordWrap() { > return fWordWrap; >@@ -155,7 +155,7 @@ > > @Override > public void documentChanged(DocumentEvent event) { >- if (fAutoScroll) { >+ if (fPageAutoScroll) { > revealEndOfDocument(); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 459517
:
251043
| 251044 |
251391