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 211876 Details for
Bug 370752
[Table][Tree] topIndex is out of sync when Table/Tree is resized
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]
Patch as described in comment 5 from Ivan
TableTreeResize.patch (text/plain), 2.48 KB, created by
Stephan Leicht Vogt
on 2012-03-01 09:08:41 EST
(
hide
)
Description:
Patch as described in comment 5 from Ivan
Filename:
MIME Type:
Creator:
Stephan Leicht Vogt
Created:
2012-03-01 09:08:41 EST
Size:
2.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/widgets/Table.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Table.java,v >retrieving revision 1.123 >diff -u -r1.123 Table.java >--- src/org/eclipse/swt/widgets/Table.java 16 Feb 2012 14:20:16 -0000 1.123 >+++ src/org/eclipse/swt/widgets/Table.java 1 Mar 2012 13:56:22 -0000 >@@ -252,6 +252,8 @@ > } > clearItemsTextWidths(); > updateScrollBars(); >+ adjustTopIndex(); >+ showSelection(); > } > } > >Index: src/org/eclipse/swt/widgets/Tree.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Tree.java,v >retrieving revision 1.108 >diff -u -r1.108 Tree.java >--- src/org/eclipse/swt/widgets/Tree.java 17 Feb 2012 09:51:38 -0000 1.108 >+++ src/org/eclipse/swt/widgets/Tree.java 1 Mar 2012 13:56:23 -0000 >@@ -541,6 +541,19 @@ > return topItemIndex; > } > >+ final int getVisibleItemCount( boolean includePartlyVisible ) { >+ int clientHeight = getBounds().height - getHeaderHeight() - getHScrollBarHeight(); >+ int result = 0; >+ if( clientHeight >= 0 ) { >+ int itemHeight = getItemHeight(); >+ result = clientHeight / itemHeight; >+ if( includePartlyVisible && clientHeight % itemHeight != 0 ) { >+ result++; >+ } >+ } >+ return result; >+ } >+ > /** > * Shows the column. If the column is already showing in the receiver, > * this method simply returns. Otherwise, the columns are scrolled until >@@ -2200,6 +2213,13 @@ > } > } > >+ private void adjustTopIndex() { >+ int visibleItemCount = getVisibleItemCount( false ); >+ if( topItemIndex > itemCount - visibleItemCount - 1 ) { >+ topItemIndex = Math.max( 0, itemCount - visibleItemCount - 1 ); >+ } >+ } >+ > /////////////////// > // Skinning support > >@@ -2361,12 +2381,13 @@ > > } > >- private static final class ResizeListener extends ControlAdapter { >+ private final class ResizeListener extends ControlAdapter { > @Override > public void controlResized( ControlEvent event ) { >- Tree tree = ( Tree )event.widget; >- tree.updateAllItems(); >- tree.updateScrollBars(); >+ updateAllItems(); >+ updateScrollBars(); >+ adjustTopIndex(); >+ showSelection(); > } > } >
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 370752
: 211876