Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 149193

Summary: [Viewers] JFace Table and Tree Viewers need to handle SWT events in an extensible way
Product: [Eclipse Project] Platform Reporter: Tod Creasey <Tod_Creasey>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, bpasero, bradleyjames, cgross, daniel_megert, eclipse, elias, gunnar, markus.kell.r, mlists, n.a.edgar, rohit_1004, thatnitind, tom.schindl, villane
Version: 3.2   
Target Milestone: 3.3 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 70800, 83200, 113713, 142655, 150618, 151377, 154123    
Attachments:
Description Flags
First pass of the new API
none
New patch
none
Patch that passes the test suites
none
Corrects problems with column-index
none
Revised patch
none
Test implementation
none
Fix NLP
none
New Patch to add Tooltip-Support
none
Example script to show tooltips usage
none
Fixing backwards compatility problems
none
Patch August 10
none
Fix Tooltip-Methods and Comments
none
Example how to use Tooltips
none
One more wrong copyright ;-) none

Description Tod Creasey CLA 2006-06-29 13:03:56 EDT
3.2

We currently do not support asynchonous events from SWT at the JFace level well. In particular we do not currently handle tooltips and owner draw.

Generally whenever there is another feature added to SWT we add some sort of new provider interface for it but this is becoming untenable (Tables for instance have
ILabelProvider, ITableLabelProvider, IColorProvider,  ITableColorProvider, IFontProvider, ITableColorProvider and IViewerLabelProvider as possible way to currently display content).

We need a solution that is extensible for future SWT features without adding yet another interface. My suggestion is to take IViewerLabelProvider and create an implementation that can handle all of the current functionality of the other providers and add the new required features as well.

I'll attach a rough pass when I get it worked out.
Comment 1 Thomas Schindl CLA 2006-06-29 13:22:42 EDT
That's a good idea because when reading mailling-list people simply have no idea about all those optional interfaces ;-)

I think it's time to clean up more JFace code there are so many duplications between TreeViewer/TableViewer most of them because we need to cast to TableItem/TreeItem in those classes but we use the same methods getBounds(), ... .

I tried in my last patches (#83200,#142655) to provide classes which can be used by both controls. I think we also need a concept how to deal with this. JFace code would get much less complicated if there would exists ITableTreeItem holding the interface definition both widgets share but because I think we SWT will never provide this interface we should think about an intelligent wrapper.

Another thing we need to correct is to make features configurable from the outside look at #142655 (configure from outside how tabbing works) and #87733 (configure activation for CellEditors)
Comment 2 Tod Creasey CLA 2006-06-29 13:36:26 EDT
Tom we might be able to talk the SWT guys into a common superclass if we can come up with a good name. Any suggestions?

Let me have a start on this and I'll post some code soon - I just want to be sure my ideas aren't half baked <grin>...
Comment 3 Thomas Schindl CLA 2006-06-29 13:53:57 EDT
(In reply to comment #2)
> Tom we might be able to talk the SWT guys into a common superclass if we can
> come up with a good name. Any suggestions?
> 

Well not at the moment but I'll think about a good name and let you know.

> Let me have a start on this and I'll post some code soon - I just want to be
> sure my ideas aren't half baked <grin>...
> 

Tell me if you need any input from me you besides this bug #142655 addresses JFace-Viewers also in a global context maybe we should sync those efforts. 
Comment 4 Thomas Schindl CLA 2006-07-07 09:18:00 EDT
(In reply to comment #2)
> Tom we might be able to talk the SWT guys into a common superclass if we can
> come up with a good name. Any suggestions?
> 
> Let me have a start on this and I'll post some code soon - I just want to be
> sure my ideas aren't half baked <grin>...
> 
What's with one of these:
- IColumnItem 
- ITableItem (because used in TreeTables)

The reasons why this would be needed:
a) Reduce amount of code duplication in JFace (see TableEditorImpl,...)
b) When implementing Viewers for Components outside of JFace e.g. Nebula's 
   grid-control (see #146945) JFace does have to have a dependency to this 
   project without that the Viewer needs to live in the nebula project which is 
   in my opion not the right place for it.
Comment 5 Tod Creasey CLA 2006-07-07 10:04:43 EDT
Is it TableTree you are talking about? We are likely not going to do anything interesting as it a deprecated Viewer.

But Boris was also keen on the concept of a column.

I assume you are suggesting that we have a abstract class like

JFaceItem 

with a subclass of ColumnItem and JFaceItem?
Comment 6 Thomas Schindl CLA 2006-07-07 12:12:21 EDT
(In reply to comment #5)
> Is it TableTree you are talking about? We are likely not going to do anything
> interesting as it a deprecated Viewer.
> 

Well not exactly I think about having TableItem and TreeItem, GridItem (nebula-grid), ... implementing an interface holding the methods both have in common.  In those cases it's always the same story that the item is split into "Columns" hence methods like item.getBounds(i) that's why I named the interface IColumnItem. 

This would make our/your job easier when dealing with Column-Widget like Table is and Tree is too. What I have already thought about is wrapping SWT-Columns like shown in bug #142655 (https://bugs.eclipse.org/bugs/attachment.cgi?id=42561) see 

- AbstractEditingColumn
- AbstractEditableTableColumn
- AbstractEditableTreeColumn

Which addresses many many things we are talking about and people requested in the past.

> But Boris was also keen on the concept of a column.
> 
> I assume you are suggesting that we have a abstract class like
> 
> JFaceItem 
> 
> with a subclass of ColumnItem and JFaceItem?
> 

I not sure I can follow you here or rather I think you got me wrong. How do you think this would work technically the items are provided by the Tree/Table/Grid/.... Do you want to wrap them when request by any Viewer-method instead of returning the original Items? That's not what I had in mind.
Comment 7 Tod Creasey CLA 2006-07-07 15:58:06 EDT
OK I think I might see where you are going with this - let me elaborate on what I was thinking about.

Basically we have two types of interfaces for viewers - those for a whole row and those for inidividual entries (i.e. IColorProvider vs. ITableColorProvider).

These are effectively both IColorProviders - the one for the table just has the column as a parameter. If instead ITableColorProvider was an IColorProvider applied to a column (i.e. we would have a method setColorProvider(IColorProvider provider, int columnIndex) that would reduce the need for parallel interfaces all of the time.

We could then express everything in terms of the base interfaces without a need for table and tree versions of them that take an index. When we add a new one (like the tooltip support)we create one provider and apply it to either the whole table or tree or just one column.

Internally we might create the idea of StructuredViewerColumn with subclasses of  TableViewerColumn and TreeViewerColumn to implement this but I will have to play around to see what I think we need.
Comment 8 Boris Bokowski CLA 2006-07-10 08:12:48 EDT
(In reply to comment #7)
> Internally we might create the idea of StructuredViewerColumn with subclasses
> of  TableViewerColumn and TreeViewerColumn to implement this but I will have to
> play around to see what I think we need.

I would like to see an abstraction like this in the API so that clients can call viewerColumn.setLabelProvider(...) and similar methods for cell editors, cell modifier etc. instead of the index-based calls.
Comment 9 Thomas Schindl CLA 2006-07-10 08:45:39 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > Internally we might create the idea of StructuredViewerColumn with subclasses
> > of  TableViewerColumn and TreeViewerColumn to implement this but I will have to
> > play around to see what I think we need.
> 
> I would like to see an abstraction like this in the API so that clients can
> call viewerColumn.setLabelProvider(...) and similar methods for cell editors,
> cell modifier etc. instead of the index-based calls.
> 

Well I'd go one step further we let the user create the ViewerColumn instead of create the TableColumn/TreeColumn at the moment. 

This would give us the possibility to remove all those ITableFontProvider, ITableColorProvider and replace them through methods in our ViewerColumn (getForegroundColor(),getFont(),getTooltip(),...). By default it would return null and users could overwrite it to get custom behaviour. As already said I've started this for CellEditors in my above mentionned concept for Viewers. 

In short at the moment we add the concept of Columns we don't need any LabelProvider, ICellModifier, ... stuff any more. My point moreover is that we only need ViewerColumn if we could convince SWT folks to provide interfaces for TableColumn/TreeColumn and TableItem/TreeItem.
Comment 10 Tod Creasey CLA 2006-07-10 09:39:24 EDT
This is the direction that I am thinking as well - I would like to deprecate ITableXProvider at the end of this work.

ColumnViewer should just be another viewer. ColumnViewer would have a TreeColumn or TableColumn as a widget just like a Viewer has a Table or a Tree. 

It is a bit of a departure as we have nowhere else where a Viewer has other Viewers in it but I think this fits our ViewerModel nicely. By making the column a first class viewer like the Table is we can implement all of the functionality you are after.

Thanks for your input Tom - I think we are going in a good direction here.
Comment 11 Chris Gross CLA 2006-07-11 17:02:18 EDT
(Just noticed this bug from the planning notes)

As the owner of the Nebula Grid, if theres some possibility to allow Grid to
reuse the standard JFace table/tree viewers that would make me extremely happy.
 I (and others) have taken to copying/modify the viewer code to support Grid
and its been difficult because of the access levels for the classes.  

Rather than requiring SWT to create a new interface shared between Tables/Trees
and potentially Grid, a proxy interface could be created in JFace.  The viewers would be refactored to act against the interface, but also
JFace would include implementations of the interface that wrapped existing
Table and Tree.  This would allow the existing API constructor to remain the
same.  The constructor code would look something like:

public TableViewer(Table table)
{
    this(new TableProxy(table));
}

public TableViewer(ITableProxy table)
{
   //...
}

But thats only if the SWT guys decide against a common interface.

I realize the focus of this bug report isn't this kind of change, but it would
be much appreciated.
Comment 12 Tod Creasey CLA 2006-07-12 15:09:17 EDT
I have been playing around with a ColumnViewer and it is not as simple as I thought at first.

First of all let me ask you what you expect in a grid. The current implementation of tables and trees assumes that the same item is used for all of the columns in a particualr row. Are you looking ofr a viewer where every element could be different (i.e. two sequential cells would have different elements behind them)? If so then I am not sure if we are looking to do quite so radical a change to how a row of a tree or table is represented.

Secondly my original idea of ColumnViewers does not make sense with the current implementation. If each row represents an element the Column can't be a viewer as we would be hacking it pretty hard to make it fit the viewer API. 
Comment 13 Tod Creasey CLA 2006-07-13 10:21:36 EDT
Created attachment 46241 [details]
First pass of the new API

Just so that you can see where I am going with this here is a patch that shows what I am suggesting.

TableColumnViewerPart (I am not attached to the name so suggestions are welcome) is the JFace representation of the TableColumn. The whole provider mechanism is simplified into the ViewerLabelProvider which can be subclassed for anyone who want to do anything custom.

TableColumnViewerPart (which can also be subclassed) is responsible for supplying the TableItem and the element when refresh is required.It asks ViewerLabelProvider to build the label and then updates the TableItem when the label is built.
Comment 14 Thomas Schindl CLA 2006-07-13 14:12:47 EDT
I've taken a look at it and form my point of view it looks good but as already said I'd more like to see that instead of creating TableColumn/TreeColumn from the outside I'd like to have a see another constructor TableColumnViewerPart(TableViewer,ViewerLabelProvider), I would not give the user the possibility any more to create a TableColumn simply by deprecating getTable()/getTree(). 

What do you for example do if the user access the getTable().setColumnOrder()? I don't think that you could recognize this, can you?

My dream would be do hide the underlying SWT-Control completely from the user. This way the user wouldn't event recognize if we would replace the underlying Table/Tree through e.g. the Grid-Control because of what ever reason (although we won't do that ever).

Another great thing would be if we could merge my replacement ICellModifier,... from bug 142655 into it.

(In reply to comment #13)
> Created an attachment (id=46241) [edit]
> First pass of the new API
> 
> Just so that you can see where I am going with this here is a patch that shows
> what I am suggesting.
> 
> TableColumnViewerPart (I am not attached to the name so suggestions are
> welcome) is the JFace representation of the TableColumn. The whole provider
> mechanism is simplified into the ViewerLabelProvider which can be subclassed
> for anyone who want to do anything custom.
> 
> TableColumnViewerPart (which can also be subclassed) is responsible for
> supplying the TableItem and the element when refresh is required.It asks
> ViewerLabelProvider to build the label and then updates the TableItem when the
> label is built.
> 

Comment 15 Tod Creasey CLA 2006-07-13 14:47:55 EDT
Created attachment 46254 [details]
New patch

Here is a patch based on what I have done since the first one today (with a lot of tidy up).

I like your idea of the constructor - I did a similar thing in TableViewer - setColumnPart(ColumnViewerPart viewerPart, int columnIndex). ColumnViewerPart has no controls associated with it.

I am reluctant to hide the SWT widget as I would like this to be extensible and so if there something you want to do that JFace does not permit you would be out of luck if we didn't give it access. Many of the people interested in this have expressed that having the widget is a requirement.

We of course want to have your work as part of the final solution for this Tom - I just want to have the groundwork done before the feature work.

Thanks again for all of your input
Comment 16 Tod Creasey CLA 2006-07-13 16:33:12 EDT
Created attachment 46263 [details]
Patch that passes the test suites

Here is a version of the previous patch that does not break the JFace suites
Comment 17 Thomas Schindl CLA 2006-07-21 04:52:49 EDT
Maybe we should also add the concept of Cells into Tables/Trees not provided my SWT. This came to my mind creating the patch for bug 151377
Comment 18 Thomas Schindl CLA 2006-07-21 05:04:59 EDT
(In reply to comment #17)
> Maybe we should also add the concept of Cells into Tables/Trees not provided my
> SWT. This came to my mind creating the patch for bug 151377
> 

The new listener added by this bug-report can be used to refactor TableEditorImpl/TreeEditorImpl who extract the column themselfs at the moment.
Comment 19 Thomas Schindl CLA 2006-07-22 14:41:49 EDT
Created attachment 46677 [details]
Corrects problems with column-index

Today I had the chance to take a closer look at your implementation and found some major problems with your approach of fixing the column-index. I think this has to stay be dynamic because if you add/remove columns you may have problems with multiple columns having the same index.

I also added a new class named TableColumnViewerPart which can be used to created new TableColumns, ...
Comment 20 Thomas Schindl CLA 2006-07-23 07:16:37 EDT
(In reply to comment #19)
> Created an attachment (id=46677) [edit]
> Corrects problems with column-index
> 
> Today I had the chance to take a closer look at your implementation and found
> some major problems with your approach of fixing the column-index. I think this
> has to stay be dynamic because if you add/remove columns you may have problems
> with multiple columns having the same index.
> 
> I also added a new class named TableColumnViewerPart which can be used to
> created new TableColumns, ... 
> 

Another problem just came to my mind is the way you call hasNewBackground(), ...  you can not reset a background to the default color if you have set it once or am I wrong here?
Comment 21 Thomas Schindl CLA 2006-07-23 10:18:07 EDT
Created attachment 46686 [details]
Revised patch

This patch does the following changes to the one Tod:
- Add new WrapperClasses for TreeColumn and TableColumn
- Renames TreeViewerPart to TreeColumnViewerPart
- Moves ColumViewerPart <=> ColumnOwner relationship to ColumnViewerPart's contructor
- Add editing support to ColumViewPart and therefore refactors TableEditor/TreeEditorImpl
Comment 22 Chris Gross CLA 2006-07-24 17:22:35 EDT
FYI - I've submitted bug 151644 seperately to investigate the possibility of a shared interface between Table and Tree.
Comment 23 Thomas Schindl CLA 2006-07-29 15:35:26 EDT
To whom it may interest today I had time and thought I it give a try and started a TableViewer from scratch.

My interest was not to provide anything that is backward compatible but rather try out some ideas I had in mind. The ideas I used came from Tod's code and some of the existing feature requests.

Interesting ideas:
- Tod's ViewerPart
- Wrapper for TableItem (should give possiblity to exchange Table) named RowPart
  maybe can be addressed from the jface side bug 151644 whether or not this
  request is fullfilled or not doesn't harm this implementation and could be 
  extented by every Grid/TableProvider
- Concept of Cells(CellPart) in conjunction with TableCursor

At the moment the following bugs can be addressed with this viewer:
- bug 151377: [Viewers] Listeners for CellSelections
- bug 151205: [Viewers] More efficient addFilter-Method
- bug  83200: [Viewers] Support to define custom tooltips for elements in viewers
- bug 143789: [EditorMgmt] Add possibility to customize table-editor activation
- bug 151295: [CellEditors] table viewer needs to provide a key combination to activate the celleditors
- bug  87733: [CellEditors] Double click behavior for tableviewer
- bug 142655: [Viewers] Rethink Viewer Concept of ICellModifier, columnProperties, CellEditor
- bug 149193: [Viewers] JFace Table and Tree Viewers need to handle SWT events in an extensible way
- bug 151644: to some extend that maybe the interfaces are not needed

The concept of Custom-Tooltips also got many new features:
- useNativeTooltip
- getTooltipTimeDisplayed
- getTooltipDisplayDelayTime
- getTooltipImage
- getTooltipFont

The most outstandings things are at the moment:
- Tab-Editing support to jump from CellEditor to CellEditor
- Support for DecorationLabelProvider

Ideas, suggestions, ... are welcome. I wanted to post this code to show you my way of thinking some parts of them can easily backported e.g. Tooltip things, ... .

(In reply to comment #22)
> FYI - I've submitted bug 151644 seperately to investigate the possibility of a
> shared interface between Table and Tree.
> 
Comment 24 Thomas Schindl CLA 2006-07-29 15:36:46 EDT
Created attachment 47008 [details]
Test implementation
Comment 25 Thomas Schindl CLA 2006-08-01 07:39:06 EDT
Tod/Boris is there anything new about what you guys think about the current implementation provided by Tod. I'm going to have time this week and if this is the way to go for future of Viewers I'd incooperate all my work into this.

What I'd like to see merged in:
- handling of editing by ColumnViewerPart
- intergration of Tooltips like in my Test-Impl
- KeyBoard-Navigation (we need to discuss how this can be done, I'm not sure
  the impl I've tried to use in my Test-Impl)
- possiblity to Track-Clicks on cell "addCellSelectionListener"
Comment 26 Tod Creasey CLA 2006-08-01 08:15:04 EDT
Sorry Tom - both of us were on vacation for the last two weeks so I haven't had a chance to look over anything yet. I'll try to get to it this week.
Comment 27 Tod Creasey CLA 2006-08-03 10:31:26 EDT
I can see the sense in dumping the column indices - we don't keep them in item mappings either so this is a consistent implementation.

I think Toms patch is on the right track so I am happy to keep working from here. I ran our suites and it doesn't appear to break anything.

I of course can't speak for Boris - he will be back on Tuesday IIRC.
Comment 28 Tod Creasey CLA 2006-08-03 12:04:40 EDT
The current patch has this exception when you import a project from a plug-in

!ENTRY org.eclipse.jface 4 2 2006-08-03 12:05:39.671
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jface.viewers.ViewerLabelProvider.getFont(ViewerLabelProvider.java:143)
	at org.eclipse.jface.viewers.ViewerLabelProvider.updateLabel(ViewerLabelProvider.java:78)
	at org.eclipse.jface.viewers.ViewerLabelProvider.updateLabel(ViewerLabelProvider.java:90)
	at org.eclipse.jface.viewers.ColumnViewerPart.refresh(ColumnViewerPart.java:87)
	at org.eclipse.jface.viewers.TreeViewer.doUpdateItem(TreeViewer.java:156)
	at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:95)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:74)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged(ProblemsLabelDecorator.java:380)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0(ProblemsLabelDecorator.java:375)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged(ProblemsLabelDecorator.java:355)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run(ProblemMarkerManager.java:177)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:322)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:60)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:74)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged(ProblemsLabelDecorator.java:380)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0(ProblemsLabelDecorator.java:375)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged(ProblemsLabelDecorator.java:355)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run(ProblemMarkerManager.java:177)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:322)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:60)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:74)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged(ProblemsLabelDecorator.java:380)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0(ProblemsLabelDecorator.java:375)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged(ProblemsLabelDecorator.java:355)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run(ProblemMarkerManager.java:177)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:322)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:60)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:74)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged(ProblemsLabelDecorator.java:380)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0(ProblemsLabelDecorator.java:375)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged(ProblemsLabelDecorator.java:355)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run(ProblemMarkerManager.java:177)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:322)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:60)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:74)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged(ProblemsLabelDecorator.java:380)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0(ProblemsLabelDecorator.java:375)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged(ProblemsLabelDecorator.java:355)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run(ProblemMarkerManager.java:177)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:322)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:60)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:74)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged(ProblemsLabelDecorator.java:380)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0(ProblemsLabelDecorator.java:375)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged(ProblemsLabelDecorator.java:355)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run(ProblemMarkerManager.java:177)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:322)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:60)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:74)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged(ProblemsLabelDecorator.java:380)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0(ProblemsLabelDecorator.java:375)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged(ProblemsLabelDecorator.java:355)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run(ProblemMarkerManager.java:177)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:322)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:60)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:74)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged(ProblemsLabelDecorator.java:380)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0(ProblemsLabelDecorator.java:375)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged(ProblemsLabelDecorator.java:355)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run(ProblemMarkerManager.java:177)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:322)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:60)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.doUpdateItem(ProblemTreeViewer.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.updateItem(ResourceToItemsMapper.java:74)
	at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemsMapper.resourceChanged(ResourceToItemsMapper.java:63)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderChanged(ProblemTreeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:74)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged(ProblemsLabelDecorator.java:380)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0(ProblemsLabelDecorator.java:375)
	at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged(ProblemsLabelDecorator.java:355)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run(ProblemMarkerManager.java:177)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:322)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:60)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:849)
	at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:465)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:1955)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:753)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createAddedElements(AbstractTreeViewer.java:313)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalAdd(AbstractTreeViewer.java:257)
	at org.eclipse.jface.viewers.TreeViewer.internalAdd(TreeViewer.java:810)
	at org.eclipse.jface.viewers.AbstractTreeViewer.add(AbstractTreeViewer.java:136)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$PackageExplorerProblemTreeViewer.add(PackageExplorerPart.java:260)
	at org.eclipse.jface.viewers.AbstractTreeViewer.add(AbstractTreeViewer.java:602)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider$4.run(PackageExplorerContentProvider.java:629)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider$7.run(PackageExplorerContentProvider.java:666)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3354)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3000)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:158)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:326)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:854)
	at org.eclipse.pde.internal.ui.wizards.imports.PluginImportWizard.performFinish(PluginImportWizard.java:90)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:683)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:355)
	at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3377)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2997)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.ui.actions.ImportResourcesAction.run(ImportResourcesAction.java:159)
	at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3377)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2997)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 29 Thomas Schindl CLA 2006-08-03 12:07:05 EDT
If you have sometime you can look at what I'm trying out by a completely custom TableViewer-Implementation from my SVN-Repository at:
http://publicsvn.bestsolution.at/repos/java/at.bestsolution.jface.custom/trunk
Comment 30 Thomas Schindl CLA 2006-08-03 13:31:46 EDT
Created attachment 47350 [details]
Fix NLP

That's strange are we self the I*Provider? This seems to be the case because the line in ViewerLabelProvider.java:78 reads like this:

77 if (fontProvider != null) {
78    label.setFont(fontProvider.getFont(element));
79 }

Because ViewerLabelProvider implements all interfaces we mimic to have a IFontProvider and without any checks whether we have a IFontProvider, ... is set. 

Checking against null before calling the viewer should cure the problem and isn't a bad idea in any case.

Could you give this patch a try or tell me exactly how I can provoke the NLP myself.
Comment 31 Tod Creasey CLA 2006-08-03 16:06:58 EDT
You can get this by loading a project from a CVS repository into an empty workspace
Comment 32 Thomas Schindl CLA 2006-08-04 14:28:21 EDT
(In reply to comment #22)
> FYI - I've submitted bug 151644 seperately to investigate the possibility of a
> shared interface between Table and Tree.
> 

Now that this feature request was refused by the SWT-Team I think we should think about a Proxy mechanism provided by JFace to make it easy for other to use JFace-Viewers without providing too much custom code.

What I think about is the following:

public abstract class RowPart {
   public abstract getBounds(int columnIndex);
   // and some more
}

public class StructuredViewer {
   // Subclasses have to implement
   public RowPart createNewRowPart() {
      return null;
   }

   // Subclasses have to implement
   public RowPart createRowPartFromItem(Item item) {
      return(RowPart)item.getData("ROWDATA");
   }
}

public class TableViewer extends StructuredViewer {
   public RowPart createNewRowPart() {
       return new TableRowPart(this,SWT.NONE);
   }
   public RowPart createRowPartFromItem(Item item) {
       RowPart part = super.createRowPartFromItem(Item item);

       if( part == null ) {
           part = new TableRowPart((TableItem)item);
       }

       return part;
   }
}

public class TableRowPart extends RowPart {
   private TableItem item;

   public TableRowPart(TableViewer viewer, int style) {
       this(new TableItem(viewer.getTable(),style));
   }

   public TableRowPart(TableItem item) {
       this.item = item;
       // should we cache the RowPart
       // this.item.setData("ROWPART",this);
   }
   
   public Rectangle getBounds(int columnIndex) {
       return item.getBounds(columnIndex);
   }
}
Comment 33 Thomas Schindl CLA 2006-08-06 15:04:22 EDT
Created attachment 47453 [details]
New Patch to add Tooltip-Support

This patch adds:
----------------
- Tooltip-Support
- Wrappers for TableItem/TreeItem => possibility for other Widget providers than 
  SWT to use Viewers with very little custom code

Because of the wrappers I was able to move some portions of the code from TableViewer/TreeViewer to StructuredViewer. I think this implementation gives us  more flexiblity and we can start to reduce code in many other places of JFace-Viewers.
Comment 34 Thomas Schindl CLA 2006-08-06 15:06:28 EDT
Created attachment 47454 [details]
Example script to show tooltips usage
Comment 35 Thomas Schindl CLA 2006-08-06 15:15:51 EDT
One more thing I want to add is that I move some of the Interfaces (likely to change in future maybe) into internal.viewers and the only possiblity from for external users is to use public abstract classes:
- ITooltipAddonsProvider      => AbstractTooltipProvider
- ITableTooltipAddonsProvider => AbstractTableTooltipProvider
- RowPart                     => DefaultRowPartImpl

For e.g. Nebula this would mean that they need to provide an implementation ontop of DefaultRowPartImpl instead of RowPart.

Another action which needs to be done by e.g. Nebula is to subclass TableViewer/TreeViewer

protected RowPart getRowPartFromItem(Widget item);
protected RowPart createNewRowPart(RowPart parent, int style, int rowIndex);
protected ColumnViewerPart createColumnViewer(Widget columnOwner, ViewerLabelProvider labelProvider);



(In reply to comment #33)
> Created an attachment (id=47453) [edit]
> New Patch to add Tooltip-Support
> 
> This patch adds:
> ----------------
> - Tooltip-Support
> - Wrappers for TableItem/TreeItem => possibility for other Widget providers
> than 
>   SWT to use Viewers with very little custom code
> 
> Because of the wrappers I was able to move some portions of the code from
> TableViewer/TreeViewer to StructuredViewer. I think this implementation gives
> us  more flexiblity and we can start to reduce code in many other places of
> JFace-Viewers.
> 

Comment 36 Thomas Schindl CLA 2006-08-06 17:36:14 EDT
Oh one more thing to add. I think we need to add new abstract classes between
StructuredViewer -> TableViewer
StructuredViewer -> AbstractTreeViewer

Who are able are not dependent on Table/Tree-Widget. What do you think is this worth the effort? 

Although I think 1st priority should be to finalize provider support and then go-on with Widget independency. Maybe another bug should be filed for this?



(In reply to comment #35)
> One more thing I want to add is that I move some of the Interfaces (likely to
> change in future maybe) into internal.viewers and the only possiblity from for
> external users is to use public abstract classes:
> - ITooltipAddonsProvider      => AbstractTooltipProvider
> - ITableTooltipAddonsProvider => AbstractTableTooltipProvider
> - RowPart                     => DefaultRowPartImpl
> 
> For e.g. Nebula this would mean that they need to provide an implementation
> ontop of DefaultRowPartImpl instead of RowPart.
> 
> Another action which needs to be done by e.g. Nebula is to subclass
> TableViewer/TreeViewer
> 
> protected RowPart getRowPartFromItem(Widget item);
> protected RowPart createNewRowPart(RowPart parent, int style, int rowIndex);
> protected ColumnViewerPart createColumnViewer(Widget columnOwner,
> ViewerLabelProvider labelProvider);
> 
> 
> 
> (In reply to comment #33)
> > Created an attachment (id=47453) [edit]
> > New Patch to add Tooltip-Support
> > 
> > This patch adds:
> > ----------------
> > - Tooltip-Support
> > - Wrappers for TableItem/TreeItem => possibility for other Widget providers
> > than 
> >   SWT to use Viewers with very little custom code
> > 
> > Because of the wrappers I was able to move some portions of the code from
> > TableViewer/TreeViewer to StructuredViewer. I think this implementation gives
> > us  more flexiblity and we can start to reduce code in many other places of
> > JFace-Viewers.
> > 
> 

Comment 37 Thomas Schindl CLA 2006-08-07 07:04:20 EDT
Created attachment 47472 [details]
Fixing backwards compatility problems

By moving methods to StructuredViewer I introduced a NLP-Exception, the same is true for EditorImpls where those bugs are also fixed now
Comment 38 Thomas Schindl CLA 2006-08-07 07:16:34 EDT
Tod one more question is there a reason why TreeColumnViewerLabelProvider extends ViewerLabelProvider and not TableColumnViewerLabelProvider?
Comment 39 Tod Creasey CLA 2006-08-08 08:02:58 EDT
Because I wanted to keep the tree and table metaphor seperate so as not to confuse developers. I would it if as much of our API as possible was Tree/Table independant.
Comment 40 Thomas Schindl CLA 2006-08-08 08:08:05 EDT
Well that doesn't make sense because the TreeColumnViewerLabelProvider doesn't has the possiblity to work with ITable*-Interfaces it can at the moment.

(In reply to comment #39)
> Because I wanted to keep the tree and table metaphor seperate so as not to
> confuse developers. I would it if as much of our API as possible was Tree/Table
> independant.
> 

Comment 41 Tod Creasey CLA 2006-08-09 09:11:02 EDT
Also TreeColumnViewerLabelProvider supports TreePaths which the TableColumnViewerLabelProvider does not. I see your point though as Trees support ITableLabelProvider we should make thier label provider support it too.

Boris and I will be going through this today and we hope to start committing it as as experimental API early next week.
Comment 42 Thomas Schindl CLA 2006-08-09 11:47:55 EDT
That's great. Then we have a starting point and continue to integrate all those very nifty things although many of the things depend on the SWT-Team providing the Base-Classes to Tree/Table TableItem/TreeItem. I think I have to hold off all my work (Tooltips,....) until its clear what way to go.

(In reply to comment #41)
> Also TreeColumnViewerLabelProvider supports TreePaths which the
> TableColumnViewerLabelProvider does not. I see your point though as Trees
> support ITableLabelProvider we should make thier label provider support it too.
> 
> Boris and I will be going through this today and we hope to start committing it
> as as experimental API early next week.
> 
Comment 43 Tod Creasey CLA 2006-08-10 16:28:50 EDT
Tom here is the patch that I am planning to submit to HEAD on Monday . Note all all new API has been marked experimental as I am sure we are all going to want changes.

The highlights to my changes are

1) Removed the new tooltip interfaces and added the methods to ViewerLabelProvider. One of the goals of this work was to reduce the proliferation of interfaces we have

2) Removed the internal package. I used package visibility where possible. JFace currently doesn't use internal packages so I would just as soon not add one unless we had a strong reason

3) Made RowPart a class and removed DefaultRowPartImpl

4) Added ColumnViewer between StructuredViewer and the Tree and Table classes and  pushed your additions there. You suggested this before and it looks like you were onto the right thing.

5) Added comments to all new API

6) Added Toms name to a bunch of classes he has touched

7) TreeColumnViewerLabelProvider extends  TableColumnViewerLabelProvider as suggested.

I am going to also suggest that we mark this fixed after I commit as we are up to comment 44 now and 10 attachments so this bug will be impossible to follow.
Comment 44 Tod Creasey CLA 2006-08-10 16:29:48 EDT
Created attachment 47722 [details]
Patch August 10
Comment 45 Thomas Schindl CLA 2006-08-10 16:55:30 EDT
(In reply to comment #43)
> Tom here is the patch that I am planning to submit to HEAD on Monday . Note all
> all new API has been marked experimental as I am sure we are all going to want
> changes.
> 

Greate news I'll look at them tomorrow its late in the evening in Europe.

Tom
Comment 46 Thomas Schindl CLA 2006-08-11 01:31:52 EDT
(In reply to comment #43)
> Tom here is the patch that I am planning to submit to HEAD on Monday . Note all
> all new API has been marked experimental as I am sure we are all going to want
> changes.
> 
> The highlights to my changes are
> 
> 1) Removed the new tooltip interfaces and added the methods to
> ViewerLabelProvider. One of the goals of this work was to reduce the
> proliferation of interfaces we have

You are right but we don't need the methods getTooltip*(Object object, int columnIndex) because users can access the columnIndex they are working for from getColumnIndex() besides that they get never called from within Viewers and user may get confused.

> 
> 2) Removed the internal package. I used package visibility where possible.
> JFace currently doesn't use internal packages so I would just as soon not add
> one unless we had a strong reason

Accepted.

> 
> 3) Made RowPart a class and removed DefaultRowPartImpl

Accepted. If SWT-Team will continue to work on common interface this could maybe be removed.

> 
> 4) Added ColumnViewer between StructuredViewer and the Tree and Table classes
> and  pushed your additions there. You suggested this before and it looks like
> you were onto the right thing.
> 

Great. But I think this is only the first part of the story. I think now that we introduced the concept of RowPart we should provided TableViewer and TreeViewer which are free from Table/Tree, TableItem/TreeItem, TableColumn/TreeColumn. But this has to be addressed in future patches.

> 5) Added comments to all new API
> 

Accepted. I hope you've corrected my language mistakes where I had provided an comment ;-)

> 6) Added Toms name to a bunch of classes he has touched
> 

Accepted ;-)

> 7) TreeColumnViewerLabelProvider extends  TableColumnViewerLabelProvider as
> suggested.

Accepted.

> 
> I am going to also suggest that we mark this fixed after I commit as we are up
> to comment 44 now and 10 attachments so this bug will be impossible to follow.
> 

Accepted.

Other things I found:
- TableViewer.createNewRowPart(RowPart parent, int style, int rowIndex) should 
  use the passed style same is true for TreeViewer.createRowPart

- TableViewer.createNewRowPart(RowPart parent, int style, int rowIndex) and 
  TreeViewer.createNewRowPart(RowPart parent, int style, int rowIndex) should 
  have different visibilities and should defined as an abstract method in
  ColumnViewer

- Rename ViewerLabelProvider.getTooltipImageStyle(Object object) => 
  getTooltipStyle(Object object)

- Cell should be renamed to CellPart to stay consitent.

The rest looks good and I'm looking forward to your submit. 

The things on my todo list for future bugs or already active ones:
- finish TooltipSupport (=> Delays not used at the moment)
- finish editor activation customization (e.g. activate on double-click)
- finish tab navigation from cell-editor to cell-editor
- provide generic TableViewer and TreeViewer Baseclasses free from Tree/Table, 
  ... . No bug report exists for this. What do you think about this? 
  It would provide Viewers "automatically" for e.g. Nebula-Widgets)
Comment 47 Thomas Schindl CLA 2006-08-11 02:27:10 EDT
And one more thing I just found:
ViewerLabel doesn't need to restore the Tooltip-Infos because they are accessed directly from the ViewerLabelProvider.

Not that I really mind but my name is missing in some of the Files:

- TableColumnViewerLabelProvider.java => use column-index
- TableColumnViewPart.java => initial API
- TreeColumnViewerPart => initial API
- TableEditorImpl.java => usage EditingSupport
- TreeEditorImpl.java => usage EditingSupport
- TableViewer.java => comment wrong because bug 8200 is addressed in 
  ColumnViewer (=> concept of RowPart)
- TreeViewer.java => concept of RowPart
- EditingSupport.java => comment in class JavaDoc?
Comment 48 Tod Creasey CLA 2006-08-15 09:01:27 EDT
Patch has been released to HEAD with updated comments. Tom if you could double check that I got you everywhere I would be grateful.

I am going to close this bug now - we can open new ones for other issues/discussions.
Comment 49 Thomas Schindl CLA 2006-08-15 13:18:29 EDT
(In reply to comment #48)
> Patch has been released to HEAD with updated comments. Tom if you could double
> check that I got you everywhere I would be grateful.
> 
> I am going to close this bug now - we can open new ones for other
> issues/discussions.
> 

(In reply to comment #48)
> Patch has been released to HEAD with updated comments. Tom if you could double
> check that I got you everywhere I would be grateful.
> 
> I am going to close this bug now - we can open new ones for other
> issues/discussions.
> 

Hi Tod I cann't help but somehow the comments are mixed up some of them are in the Javadoc of the class like e.g. TableColumnViewerPart and in some of them e.g. TreeColumnViewerLabelProvider in the copyright part. It somehow seems to be mixed up. I always thought the standard is to mentionned all contributors in the Copyright header but if I'm wrong here please correct me. 

What do you think about my comments in comment 46 e.g. 
"public Point getTooltipShift(Object object, int columnIndex)" is still part of ViewerLabelProvider-API but its not needed  and our Viewers won't call. 
I've one subclasses it an uses it as a Provider for more than one Column he/she can use getColumnIndex() to distinguish between rows.

Do you think I should open new bugs for this?
Comment 50 Thomas Schindl CLA 2006-08-15 13:21:18 EDT
> ViewerLabelProvider-API but its not needed  and our Viewers won't call. 
> I've one subclasses it an uses it as a Provider for more than one Column he/she
> can use getColumnIndex() to distinguish between rows.
> 

sorry I meant columns not rows.

> Do you think I should open new bugs for this?
> 

Comment 51 Tod Creasey CLA 2006-08-15 13:28:30 EDT
That is a mistake. It should be in the copyright as you say - I got caught out by code folding I think. Let me know if there are any others.

The tooltip work is largely being driven by you so if you think we should change the visibility of a method here and there by all means attach a patch and I'll apply it.
Comment 52 Thomas Schindl CLA 2006-08-15 14:05:12 EDT
Created attachment 47944 [details]
Fix Tooltip-Methods and Comments

This patch fixes the following things:
- ViewerLabelProvider
  - remove api-methods with column-index
  - rename getTooltipImageStyle => getTooltipStyle
- TreeViewer
  - fixed copyright comment (added myself)
  - fixed createNewRowPart to use passed style
- TreeEditorImpl
  - fixed copyright comment (added myself)
- TreeColumnViewerPart
  - fixed copyright comment (added myself)
- TooltipSupport
  - getTooltipImageStyle => getTooltipStyle
- TableViewer
  - fixed copyright comment (added myself)
  - createNewRowPart use passed style
- TableEditorImpl
  - fixed copyright comment (added myself)
- TableColumnViewerLabelProvider
  - fixed copyright comment (moved from Javadoc to header)
Comment 53 Tod Creasey CLA 2006-08-15 14:14:09 EDT
Patch released - thanks.
Comment 54 Thomas Schindl CLA 2006-08-16 12:04:04 EDT
Created attachment 48028 [details]
Example how to use Tooltips
Comment 55 Thomas Schindl CLA 2006-08-17 09:22:48 EDT
Created attachment 48089 [details]
One more wrong copyright ;-)
Comment 56 Tod Creasey CLA 2006-08-17 11:23:03 EDT
Released patch. I took the liberty of spelling your name correctly as well <grin>...
Comment 57 Chris Gross CLA 2006-08-29 08:50:28 EDT
Will the changes to the editor activation allow for an editor to activate when a user starts typing?
Comment 58 Thomas Schindl CLA 2006-08-29 09:02:13 EDT
(In reply to comment #57)
> Will the changes to the editor activation allow for an editor to activate when
> a user starts typing?
> 

This is not really defined at the moment and hasn't been my primary focus. I think editor activation is better discussed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=87733 maybe the label should be changed to "Customizeable Editor Activation". 

A problem I can think of with KeyActivation is that you don't really know which Cell in the row the user wants to edit. To provide this Table's need to provide the possibility to grab the cell under focus or we need to track it our own in jface, some where I have code that does that but it's not really usable at the moment.
Comment 59 Markus Keller CLA 2006-09-04 07:02:56 EDT
The APIs added with this bug need some cleanup:

* all new APIs (ViewerLabel, ViewerLabelProvider, etc.) needs "@since 3.3" tags

* SWT uses "ToolTip" (camel case) in APIs and "tool tip" (lowercase, two words) in javadocs. JFace should follow that convention and
  - change APIs to use camel case
    (e.g. ViewerLabel.setTooltipText(..) -> setToolTipText(..))
  - adapt text in javadocs (

* APIs in ViewerLabel are too terse, e.g.
 	/** 
	 * @return Returns the tooltipShift.
	 */
	public Point getTooltipShift() {
  - should explain what the "shift" is (or link to
    ViewerLabelProvider.getTooltipShift(..), ...)
  - terms like "tooltipShift" are inconsistently used and look like internal
    names. Should be "tool tip shift", etc.

* Javadocs should be spell- and grammar-checked, e.g. ViewerLabelProvider.getTooltipShift(..) ("This is the amount the used [..]") or ViewerLabelProvider.useNativeTooltip(..) need some polish.

Shall I open a new bug, or do you want to reopen this one?
Comment 60 Tod Creasey CLA 2006-09-19 09:09:07 EDT
Verified in 20060919-0100