Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Changing Label Provider for tree viewer giving null pointer exception in MAC
Changing Label Provider for tree viewer giving null pointer exception in MAC [message #1453791] Mon, 27 October 2014 13:40 Go to next message
Rajesh Panditi is currently offline Rajesh PanditiFriend
Messages: 2
Registered: October 2014
Junior Member
Hi ,
I am facing a critical issue using cell label provider for tree viewer in MAC. In windows systems , there is no problem .
I have a scenario for changing the label provider dynamically , for this first i have created
a tree viewer using content provider and label provider(cell label provider).
After that i am trying to change the label provider of the tree viewer using set Label Provider option , But i am getting null pointer exceptions.



Exception:

java.lang.NullPointerException
at org.eclipse.jface.viewers.StyledCellLabelProvider.getViewerCell(StyledCellLabelProvider.java:230)
at org.eclipse.jface.viewers.StyledCellLabelProvider.measure(StyledCellLabelProvider.java:258)
at org.eclipse.jface.viewers.OwnerDrawLabelProvider$OwnerDrawListener.handleEvent(OwnerDrawLabelProvider.java:56)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
at org.eclipse.swt.widgets.TreeItem.calculateWidth(TreeItem.java:280)
at org.eclipse.swt.widgets.Tree.setScrollWidth(Tree.java:2972)
at org.eclipse.swt.widgets.TreeItem.setText(TreeItem.java:1473)
at org.eclipse.jface.viewers.TreeViewerRow.setText(TreeViewerRow.java:116)a
at org.eclipse.jface.viewers.ViewerCell.setText(ViewerCell.java:159)
Re: Changing Label Provider for tree viewer giving null pointer exception in MAC [message #1454847 is a reply to message #1453791] Tue, 28 October 2014 20:50 Go to previous messageGo to next message
Thibault Le Ouay is currently offline Thibault Le OuayFriend
Messages: 23
Registered: October 2014
Junior Member
Hey,

IMO the NPE comes from your code, i have adapted Snippet015CustomTooltipsForTree to dynamically change the labelprovider when i click on a button and there 's no NPE on my mac.

Best,

Thibault
Re: Changing Label Provider for tree viewer giving null pointer exception in MAC [message #1455145 is a reply to message #1454847] Wed, 29 October 2014 04:26 Go to previous messageGo to next message
Rajesh Panditi is currently offline Rajesh PanditiFriend
Messages: 2
Registered: October 2014
Junior Member
Hi Thibault,

The label provider that you set for tree viewer is "StyledCellLabelProvider" if not ,
can you please try with "StyledCellLabelProviders",

The text that is displayed using label providers should be different .

Best Regards,
Rajesh Panditi
Re: Changing Label Provider for tree viewer giving null pointer exception in MAC [message #1455276 is a reply to message #1455145] Wed, 29 October 2014 07:37 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6417
Registered: July 2009
Senior Member
As outlined in bug 449025 this indeed is a problem in the JFace code.

Tom

On 29.10.14 05:26, Rajesh Panditi wrote:
> Hi Thibault,
>
> The label provider that you set for tree viewer is
> "StyledCellLabelProvider" if not ,
> can you please try with "StyledCellLabelProviders",
>
> The text that is displayed using label providers should be different .
>
> Best Regards,
> Rajesh Panditi
Previous Topic:Select With TAB in ContentProposalAdapter
Next Topic:How to make shell display when it is hidden
Goto Forum:
  


Current Time: Sun Nov 18 08:38:24 GMT 2018

Powered by FUDForum. Page generated in 0.02406 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top