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 14195 Details for
Bug 72358
[Viewers] Support SWT.VIRTUAL style
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 for work so far
72358patch.txt (text/plain), 2.25 KB, created by
Tod Creasey
on 2004-08-26 11:57:56 EDT
(
hide
)
Description:
Patch for work so far
Filename:
MIME Type:
Creator:
Tod Creasey
Created:
2004-08-26 11:57:56 EDT
Size:
2.25 KB
patch
obsolete
>Index: src/org/eclipse/jface/viewers/TableViewer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewer.java,v >retrieving revision 1.17 >diff -u -r1.17 TableViewer.java >--- src/org/eclipse/jface/viewers/TableViewer.java 25 Aug 2004 15:47:35 -0000 1.17 >+++ src/org/eclipse/jface/viewers/TableViewer.java 26 Aug 2004 15:50:10 -0000 >@@ -25,7 +25,9 @@ > import org.eclipse.swt.graphics.Rectangle; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Item; >+import org.eclipse.swt.widgets.Listener; > import org.eclipse.swt.widgets.Table; > import org.eclipse.swt.widgets.TableItem; > import org.eclipse.swt.widgets.Widget; >@@ -46,6 +48,8 @@ > */ > public class TableViewer extends StructuredViewer { > >+ //A flag to indicate if the >+ private boolean isVirtual = false; > /** > * Internal table viewer implementation. > */ >@@ -60,7 +64,7 @@ > * This viewer's table editor. > */ > private TableEditor tableEditor; >- >+ > /** > * Creates a table viewer on a newly-created table control under the given > * parent. The table control is created using the SWT style bits >@@ -100,9 +104,21 @@ > */ > public TableViewer(Table table) { > this.table = table; >+ >+ isVirtual = (table.getStyle() | SWT.VIRTUAL) > 0; > hookControl(table); > tableEditor = new TableEditor(table); > initTableViewerImpl(); >+ >+ if(isVirtual) >+ table.addListener(SWT.SetData, new Listener() { >+ public void handleEvent(Event e) { >+ TableItem item = (TableItem)e.item; >+ Object element = item.getData(); >+ updateItem(item, element); >+ } >+ }); >+ > } > > /** >@@ -124,9 +140,15 @@ > for (int i = 0; i < filtered.length; i++) { > Object element = filtered[i]; > int index = indexForElement(element); >- updateItem(new TableItem(getTable(), SWT.NONE, index), element); >+ TableItem newItem = new TableItem(getTable(), SWT.NONE, index); >+ if(isVirtual) >+ newItem.setData(element); >+ else >+ updateItem(newItem, element); > } > } >+ >+ > > /** > * Adds the given element to this table viewer. If this viewer does not have
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 72358
:
14195
|
14991
|
14992
|
14993
|
15187
|
15205