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 111652 Details for
Bug 235583
[table] Selecting multiple items sometimes doesn't work
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]
Preliminary bug fix
table-selection.patch.txt (text/plain), 8.25 KB, created by
RĂ¼diger Herrmann
on 2008-09-04 02:58:04 EDT
(
hide
)
Description:
Preliminary bug fix
Filename:
MIME Type:
Creator:
RĂ¼diger Herrmann
Created:
2008-09-04 02:58:04 EDT
Size:
8.25 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt.q07 >Index: js/org/eclipse/swt/widgets/Table.js >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/widgets/Table.js,v >retrieving revision 1.11 >diff -u -r1.11 Table.js >--- js/org/eclipse/swt/widgets/Table.js 16 Jul 2008 18:25:30 -0000 1.11 >+++ js/org/eclipse/swt/widgets/Table.js 3 Sep 2008 11:32:30 -0000 >@@ -375,6 +375,15 @@ > if( this._focusIndex !== -1 ) { > this.updateItem( this._focusIndex, false ); > } >+ // This function is called from server-side and from within Table.js >+ // org_eclipse_rap_rwt_EventUtil_suspend is used to distinguish the caller >+ if( org_eclipse_rap_rwt_EventUtil_suspend ) { >+ this._selectionStart = -1; >+ } else { >+ var req = org.eclipse.swt.Request.getInstance(); >+ var id = org.eclipse.swt.WidgetManager.getInstance().findIdByWidget( this ); >+ req.addParameter( id + ".focusIndex", value ); >+ } > } > }, > >Index: src/org/eclipse/swt/internal/widgets/tablekit/TableLCAUtil.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/tablekit/TableLCAUtil.java,v >retrieving revision 1.4 >diff -u -r1.4 TableLCAUtil.java >--- src/org/eclipse/swt/internal/widgets/tablekit/TableLCAUtil.java 12 Jul 2008 16:02:26 -0000 1.4 >+++ src/org/eclipse/swt/internal/widgets/tablekit/TableLCAUtil.java 3 Sep 2008 11:32:31 -0000 >@@ -28,6 +28,7 @@ > > // Constants used by alignment > private static final Integer DEFAULT_ALIGNMENT = new Integer( SWT.LEFT ); >+ private static final Integer DEFAULT_FOCUS_INDEX = new Integer( -1 ); > > > //////////////////////////// >@@ -100,7 +101,13 @@ > } > > public static boolean hasFocusIndexChanged( final Table table ) { >- return false; >+ ITableAdapter tableAdapter >+ = ( ITableAdapter )table.getAdapter( ITableAdapter.class ); >+ int focusIndex = tableAdapter.getFocusIndex(); >+ return WidgetLCAUtil.hasChanged( table, >+ PROP_FOCUS_INDEX, >+ new Integer( focusIndex ), >+ DEFAULT_FOCUS_INDEX ); > } > > ////////////////// >Index: src/org/eclipse/swt/internal/widgets/tablekit/TableLCA.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/tablekit/TableLCA.java,v >retrieving revision 1.5 >diff -u -r1.5 TableLCA.java >--- src/org/eclipse/swt/internal/widgets/tablekit/TableLCA.java 18 Aug 2008 15:43:14 -0000 1.5 >+++ src/org/eclipse/swt/internal/widgets/tablekit/TableLCA.java 3 Sep 2008 11:32:31 -0000 >@@ -83,6 +83,7 @@ > public void readData( final Widget widget ) { > Table table = ( Table )widget; > readTopIndex( table ); // topIndex MUST be read *before* processSetData >+ readFocusIndex( table ); > readSelection( table ); > readSetData( table ); > readWidgetSelected( table ); >@@ -115,6 +116,7 @@ > TableLCAUtil.writeItemMetrics( table ); > writeItemCount( table ); > writeTopIndex( table ); >+ writeFocusIndex( table ); > writeLinesVisible( table ); > writeSelectionListener( table ); > writeDefaultColumnWidth( table ); >@@ -169,7 +171,16 @@ > table.setTopIndex( Integer.parseInt( value ) ); > } > } >- >+ >+ private static void readFocusIndex( final Table table ) { >+ String value = WidgetLCAUtil.readPropertyValue( table, "focusIndex" ); >+ if( value != null ) { >+ ITableAdapter adapter >+ = ( ITableAdapter )table.getAdapter( ITableAdapter.class ); >+ adapter.setFocusIndex( Integer.parseInt( value ) ); >+ } >+ } >+ > private static void readSetData( final Table table ) { > if( WidgetLCAUtil.wasEventSent( table, JSConst.EVENT_SET_DATA ) ) { > HttpServletRequest request = ContextProvider.getRequest(); >@@ -179,38 +190,35 @@ > ITableAdapter tableAdapter = ( ITableAdapter )adapter; > for( int i = 0; i < indices.length; i++ ) { > int index = Integer.parseInt( indices[ i ] ); >- if (index >-1 && index < table.getItemCount()) { >- tableAdapter.checkData( index ); >+ if( index > -1 && index < table.getItemCount() ) { >+ tableAdapter.checkData( index ); > } > } > } > } > >- private void readWidgetSelected( final Table table ) { >+ private static void readWidgetSelected( final Table table ) { > if( WidgetLCAUtil.wasEventSent( table, JSConst.EVENT_WIDGET_SELECTED ) ) { >- // TODO [rh] do something about when index points to unresolved item! >- final int widgetSelectedIndex = getWidgetSelectedIndex(); >- // Bugfix: check if index is valid before firing event to avoid problems with fast scrolling >- if (widgetSelectedIndex > -1 && widgetSelectedIndex < table.getItemCount()) { >- TableItem item = table.getItem( widgetSelectedIndex ); >+ // TODO [rh] do something reasonable when index points to unresolved item >+ int index = getWidgetSelectedIndex(); >+ // Bugfix: check if index is valid before firing event to avoid problems >+ // with fast scrolling >+ if ( index > -1 && index < table.getItemCount() ) { >+ TableItem item = table.getItem( index ); > int detail = getWidgetSelectedDetail(); > int id = SelectionEvent.WIDGET_SELECTED; >- SelectionEvent event = new SelectionEvent( table, >- item, >- id, >- new Rectangle( 0, 0, 0, 0 ), >- "", >- true, >- detail ); >+ Rectangle bounds = new Rectangle( 0, 0, 0, 0 ); >+ SelectionEvent event >+ = new SelectionEvent( table, item, id, bounds, "", true, detail ); > event.processEvent(); > } > } > } > >- private void readWidgetDefaultSelected( final Table table ) { >+ private static void readWidgetDefaultSelected( final Table table ) { > String defaultSelectedParam = JSConst.EVENT_WIDGET_DEFAULT_SELECTED; > if( WidgetLCAUtil.wasEventSent( table, defaultSelectedParam ) ) { >- // TODO [rh] do something about when index points to unresolved item! >+ // TODO [rh] do something reasonable when index points to unresolved item > TableItem item = table.getItem( getWidgetSelectedIndex() ); > int id = SelectionEvent.WIDGET_DEFAULT_SELECTED; > SelectionEvent event = new SelectionEvent( table, item, id ); >@@ -269,6 +277,17 @@ > writer.set( PROP_TOP_INDEX, "topIndex", newValue, DEFAULT_TOP_INDEX ); > } > >+ private static void writeFocusIndex( final Table table ) throws IOException { >+ if( TableLCAUtil.hasFocusIndexChanged( table ) ) { >+ ITableAdapter adapter >+ = ( ITableAdapter )table.getAdapter( ITableAdapter.class ); >+ if( adapter.getFocusIndex() == -1 ) { >+ JSWriter writer = JSWriter.getWriterFor( table ); >+ writer.set( "focusIndex", new Object[] { new Integer( -1 ) } ); >+ } >+ } >+ } >+ > private static void writeLinesVisible( final Table table ) throws IOException > { > JSWriter writer = JSWriter.getWriterFor( table ); >Index: src/org/eclipse/swt/internal/widgets/tableitemkit/TableItemLCA.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.rap/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/tableitemkit/TableItemLCA.java,v >retrieving revision 1.4 >diff -u -r1.4 TableItemLCA.java >--- src/org/eclipse/swt/internal/widgets/tableitemkit/TableItemLCA.java 14 Jul 2008 20:17:22 -0000 1.4 >+++ src/org/eclipse/swt/internal/widgets/tableitemkit/TableItemLCA.java 3 Sep 2008 11:32:30 -0000 >@@ -269,7 +269,7 @@ > } > > // TODO [rh] check if necessary to honor focusIndex == -1, would mean to >- // call jsTable.setFocusedItem( null ) in TableLCA >+ // call jsTable.setFocusIndex( -1 ) in TableLCA > private static void writeFocused( final TableItem item ) throws IOException > { > if( TableLCAUtil.hasFocusIndexChanged( item.getParent() )
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 235583
:
103542
| 111652 |
111773