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 137304 Details for
Bug 276713
[Table] Dotted (...) rows in VIRTUAL table after disposing items
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]
Test case and solution to the problem
clipboard.txt (text/plain), 5.26 KB, created by
RĂ¼diger Herrmann
on 2009-05-27 06:58:59 EDT
(
hide
)
Description:
Test case and solution to the problem
Filename:
MIME Type:
Creator:
RĂ¼diger Herrmann
Created:
2009-05-27 06:58:59 EDT
Size:
5.26 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle.java,v >retrieving revision 1.23 >diff -u -r1.23 RWTLifeCycle.java >--- src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle.java 29 Apr 2009 13:24:52 -0000 1.23 >+++ src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle.java 27 May 2009 10:59:02 -0000 >@@ -41,9 +41,8 @@ > > private static final String ATTR_SESSION_DISPLAY > = RWTLifeCycle.class.getName() + "#sessionDisplay"; >- >- private static final String REDRAW_CONTROLS >- = RWTLifeCycle.class.getName() + ".RedrawWidgets"; >+ private static final String ATTR_REDRAW_CONTROLS >+ = RWTLifeCycle.class.getName() + "#redrawControls"; > private static final String INITIALIZED > = RWTLifeCycle.class.getName() + "Initialized"; > private static final String CURRENT_PHASE >@@ -439,10 +438,10 @@ > final boolean redraw ) > { > IServiceStateInfo stateInfo = ContextProvider.getStateInfo(); >- Set set = ( Set )stateInfo.getAttribute( REDRAW_CONTROLS ); >+ Set set = ( Set )stateInfo.getAttribute( ATTR_REDRAW_CONTROLS ); > if( set == null ) { > set = new HashSet(); >- stateInfo.setAttribute( REDRAW_CONTROLS, set ); >+ stateInfo.setAttribute( ATTR_REDRAW_CONTROLS, set ); > } > if( redraw ) { > set.add( control ); >@@ -450,10 +449,16 @@ > set.remove( control ); > } > } >+ >+ public static boolean needsFakeRedraw( final Control control ) { >+ IServiceStateInfo stateInfo = ContextProvider.getStateInfo(); >+ Set set = ( Set )stateInfo.getAttribute( ATTR_REDRAW_CONTROLS ); >+ return set != null && set.contains( control ); >+ } > >- private void doRedrawFake() { >+ private static void doRedrawFake() { > IServiceStateInfo stateInfo = ContextProvider.getStateInfo(); >- Set set = ( Set )stateInfo.getAttribute( REDRAW_CONTROLS ); >+ Set set = ( Set )stateInfo.getAttribute( ATTR_REDRAW_CONTROLS ); > if( set != null ) { > Object[] controls = set.toArray(); > for( int i = 0; i < controls.length; i++ ) { >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.66 >diff -u -r1.66 Table.java >--- src/org/eclipse/swt/widgets/Table.java 5 May 2009 09:29:14 -0000 1.66 >+++ src/org/eclipse/swt/widgets/Table.java 27 May 2009 10:59:02 -0000 >@@ -2061,6 +2061,9 @@ > adjustFocusIndex(); > } > updateScrollBars(); >+ if( ( style & SWT.VIRTUAL ) != 0 ) { >+ redraw(); >+ } > } > > //////////////// >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/widgets/Table_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/swt/widgets/Table_Test.java,v >retrieving revision 1.47 >diff -u -r1.47 Table_Test.java >--- src/org/eclipse/swt/widgets/Table_Test.java 5 May 2009 09:29:16 -0000 1.47 >+++ src/org/eclipse/swt/widgets/Table_Test.java 27 May 2009 10:59:07 -0000 >@@ -13,6 +13,7 @@ > import junit.framework.TestCase; > > import org.eclipse.rwt.graphics.Graphics; >+import org.eclipse.rwt.internal.lifecycle.RWTLifeCycle; > import org.eclipse.rwt.lifecycle.PhaseId; > import org.eclipse.swt.*; > import org.eclipse.swt.events.*; >@@ -329,16 +330,6 @@ > } > } > >- private static boolean find( final int element, final int[] array ) { >- boolean result = false; >- for( int i = 0; i < array.length; i++ ) { >- if( element == array[ i ] ) { >- result = true; >- } >- } >- return result; >- } >- > public void testReduceSetItemCountWithSelection() { > // Create a table that is populated with setItemCount with all selected > RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); >@@ -1438,6 +1429,20 @@ > assertEquals( 0, table.getColumnOrder()[ 0 ] ); > assertEquals( 1, table.getColumnOrder()[ 1 ] ); > } >+ >+ public void testRedrawAfterDisposeVirtual() { >+ RWTFixture.fakePhase( PhaseId.PROCESS_ACTION ); >+ Display display = new Display(); >+ Shell shell = new Shell( display ); >+ Table table = new Table( shell, SWT.VIRTUAL ); >+ table.setSize( 100, 100 ); >+ table.setItemCount( 150 ); >+ // dispose the first item, this must cause a "redraw" which in turn triggers >+ // a SetData event to populate the newly appeared item at the bottom of the >+ // table >+ table.getItem( 0 ).dispose(); >+ assertTrue( RWTLifeCycle.needsFakeRedraw( table ) ); >+ } > > public void testSetColumnOrderWithInvalidArguments() { > Display display = new Display(); >@@ -2190,6 +2195,16 @@ > table.remove( 5 ); > } > >+ private static boolean find( final int element, final int[] array ) { >+ boolean result = false; >+ for( int i = 0; i < array.length; i++ ) { >+ if( element == array[ i ] ) { >+ result = true; >+ } >+ } >+ return result; >+ } >+ > private static int countResolvedItems( final Table table ) { > Object adapter = table.getAdapter( ITableAdapter.class ); > ITableAdapter tableAdapter = ( ITableAdapter )adapter;
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 276713
:
137303
| 137304