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 137635 Details for
Bug 278346
[List] Javascript error when removing selected 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]
Proposed patch.
Bug-278344-278346.patch (text/plain), 2.50 KB, created by
Ivan Furnadjiev
on 2009-05-29 09:12:45 EDT
(
hide
)
Description:
Proposed patch.
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2009-05-29 09:12:45 EDT
Size:
2.50 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/internal/widgets/ListModel.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/widgets/ListModel.java,v >retrieving revision 1.1 >diff -u -r1.1 ListModel.java >--- src/org/eclipse/swt/internal/widgets/ListModel.java 17 Mar 2009 10:45:47 -0000 1.1 >+++ src/org/eclipse/swt/internal/widgets/ListModel.java 29 May 2009 13:12:10 -0000 >@@ -45,7 +45,7 @@ > System.arraycopy( selection, 0, result, 0, selection.length ); > return result; > } >- >+ > public int getSelectionCount() { > return selection.length; > } >@@ -86,7 +86,7 @@ > } > } > } >- >+ > public void setSelection( final int start, final int end ) { > deselectAll(); > if( end >= 0 && start <= end && start <= getItemCount() - 1 ) { >@@ -106,7 +106,7 @@ > } > } > } >- >+ > public void setSelection( final String[] selection ) { > if( selection == null ) { > SWT.error( SWT.ERROR_NULL_ARGUMENT ); >@@ -161,10 +161,10 @@ > public void deselectAll() { > this.selection = EMPTY_SELECTION; > } >- >+ > //////////////////////////////// > // Methods to maintain the items >- >+ > public void add( final String string ) { > if( string == null ) { > SWT.error( SWT.ERROR_NULL_ARGUMENT ); >@@ -195,7 +195,7 @@ > remove( i ); > } > } >- >+ > public void remove( final int[] indices ) { > if( indices == null ) { > SWT.error( SWT.ERROR_NULL_ARGUMENT ); >@@ -237,7 +237,7 @@ > public void setItems( final String[] items ) { > if( items == null ) { > SWT.error( SWT.ERROR_NULL_ARGUMENT ); >- } >+ } > for( int i = 0; i < items.length; i++ ) { > if( items[ i ] == null ) { > SWT.error( SWT.ERROR_INVALID_ARGUMENT ); >@@ -264,8 +264,8 @@ > } > > ////////////////// >- // Helping methods >- >+ // Helping methods >+ > /* If the given index is contained in the selection, it will be removed. */ > private void removeFromSelection( final int index ) { > boolean found = false; >@@ -281,8 +281,17 @@ > found = true; > } > } >+ adjustSelectionIdices( index ); >+ } >+ >+ private void adjustSelectionIdices( final int removedIndex ) { >+ for( int i = 0; i < selection.length; i++ ) { >+ if( selection[ i ] >= removedIndex ) { >+ selection[ i ] = selection[ i ] - 1; >+ } >+ } > } >- >+ > private int indexOf( final String string ) { > return items.indexOf( string ); > }
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 278346
:
137635
|
137652
|
137666