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 41406 Details for
Bug 141435
[Viewers] ListViewer without a selection loses scrolled state when refreshed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for AbstractListViewer and ListViewer
patch.txt (text/plain), 3.13 KB, created by
Brad Reynolds
on 2006-05-13 14:03:38 EDT
(
hide
)
Description:
Patch for AbstractListViewer and ListViewer
Filename:
MIME Type:
Creator:
Brad Reynolds
Created:
2006-05-13 14:03:38 EDT
Size:
3.13 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface >Index: src/org/eclipse/jface/viewers/ListViewer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/ListViewer.java,v >retrieving revision 1.14 >diff -u -r1.14 ListViewer.java >--- src/org/eclipse/jface/viewers/ListViewer.java 8 May 2006 20:56:56 -0000 1.14 >+++ src/org/eclipse/jface/viewers/ListViewer.java 13 May 2006 18:02:13 -0000 >@@ -188,5 +188,19 @@ > protected void listShowSelection() { > list.showSelection(); > } >- >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.AbstractListViewer#listGetTopIndex() >+ */ >+ protected int listGetTopIndex() { >+ return list.getTopIndex(); >+ } >+ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.jface.viewers.AbstractListViewer#listSetTopIndex(int) >+ */ >+ protected void listSetTopIndex(int index) { >+ list.setTopIndex(index); >+ } > } >Index: src/org/eclipse/jface/viewers/AbstractListViewer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractListViewer.java,v >retrieving revision 1.13 >diff -u -r1.13 AbstractListViewer.java >--- src/org/eclipse/jface/viewers/AbstractListViewer.java 8 May 2006 20:56:57 -0000 1.13 >+++ src/org/eclipse/jface/viewers/AbstractListViewer.java 13 May 2006 18:02:13 -0000 >@@ -318,7 +318,6 @@ > * Method declared on StructuredViewer. > */ > protected void internalRefresh(Object element) { >- > Control list = getControl(); > if (element == null || equals(element, getRoot())) { > // the parent >@@ -327,7 +326,12 @@ > } > unmapAllElements(); > List selection = getSelectionFromWidget(); >- >+ >+ int topIndex = -1; >+ if (selection == null || selection.isEmpty()) { >+ topIndex = listGetTopIndex(); >+ } >+ > list.setRedraw(false); > listRemoveAll(); > >@@ -345,13 +349,39 @@ > > listSetItems(items); > list.setRedraw(true); >- setSelectionToWidget(selection, false); >+ >+ if (topIndex == -1) { >+ setSelectionToWidget(selection, false); >+ } else { >+ listSetTopIndex(Math.min(topIndex, children.length)); >+ } > } else { > doUpdateItem(list, element, true); > } > } >+ >+ /** >+ * Returns the index of the item currently at the top of the viewable area. >+ * <p> >+ * Default implementation returns -1. >+ * </p> >+ * @return index, -1 for none >+ */ >+ protected int listGetTopIndex(){ >+ return -1; >+ } > > /** >+ * Sets the index of the item to be at the top of the viewable area. >+ * <p> >+ * Default implementation does nothing. >+ * </p> >+ * @param index, -1 for none. index will always refer to a valid index. >+ */ >+ protected void listSetTopIndex(int index) { >+ } >+ >+ /** > * Removes the given elements from this list viewer. > * > * @param elements the elements to remove
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 141435
:
41233
|
41406
|
41407
|
50920