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 196179 Details for
Bug 346576
Table loops forever in Table.setItemCount
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.
Code to reproduce bug.
TableTest.java (text/plain), 2.38 KB, created by
Andrei Neshcheret
on 2011-05-20 00:57:08 EDT
(
hide
)
Description:
Code to reproduce bug.
Filename:
MIME Type:
Creator:
Andrei Neshcheret
Created:
2011-05-20 00:57:08 EDT
Size:
2.38 KB
patch
obsolete
>package rap.snippets; > >import org.eclipse.jface.viewers.ILazyContentProvider; >import org.eclipse.jface.viewers.TableViewer; >import org.eclipse.jface.viewers.Viewer; >import org.eclipse.rwt.lifecycle.IEntryPoint; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Table; > >public class TableTest implements IEntryPoint >{ > private static class ContentProvider implements ILazyContentProvider > { > private TableViewer viewer; > private Object[] elements; > > @Override > public void dispose() > { > viewer = null; > elements = null; > } > > @Override > public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) > { > this.viewer = ( TableViewer ) viewer; > this.elements = ( Object[] ) newInput; > this.viewer.getTable().setItemCount( elements == null ? 0 : elements.length ); > } > > @Override > public void updateElement( int index ) > { > viewer.replace( elements[index], index ); > } > } > > /** > * @wbp.parser.entryPoint > */ > public int createUI() > { > final Display display = new Display(); > final Shell shell = new Shell( display ); > shell.setLayout( new GridLayout( 1, false ) ); > > { > TableViewer tableViewer = new TableViewer( shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL ); > final Table table = tableViewer.getTable(); > table.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true, 1, 1 ) ); > tableViewer.setContentProvider( new ContentProvider() ); > tableViewer.setInput( new String[] { > "One", "Second" > } ); > > { > final Button btnClose = new Button( shell, SWT.NONE ); > btnClose.addSelectionListener( new SelectionAdapter() { > @Override > public void widgetSelected( SelectionEvent e ) > { > shell.close(); > } > } ); > btnClose.setText( "Close" ); > } > > } > > shell.open(); > > while ( !shell.isDisposed() ) > { > if ( !display.readAndDispatch() ) > { > display.sleep(); > } > } > > return 0; > } >}
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 Raw
Actions:
View
Attachments on
bug 346576
: 196179 |
196290