Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems using/understanding TableViewer.setInput() method  RSS feed

 
J Arshad
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using TableViewer to write an editable table. The problem I'm having is that when I call TableViewer.setInput() and give it an Integer object, I get:

---------------------------
org.eclipse.core.internal.runtime.AssertionFailedException: assertion failed: The application has not been initialized.
at org.eclipse.core.internal.runtime.Assert.isTrue(Assert.java:101)
at org.eclipse.core.internal.runtime.InternalPlatform.assertInitialized(InternalPlatform.java:191)
at org.eclipse.core.internal.runtime.InternalPlatform.getPluginRegistry(InternalPlatform.java:410)
at org.eclipse.core.internal.runtime.InternalPlatform.getRuntimePlugin(InternalPlatform.java:431)
at org.eclipse.core.internal.runtime.InternalPlatform.handleException(InternalPlatform.java:442)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1008)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:1271)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:494)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:431)
at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:861)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:801)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:859)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:821)
at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:398)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:238)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:991)
at myTableViewer.createContents(myTableViewer.java:31)
at org.eclipse.jface.window.Window.create(Window.java:302)
at org.eclipse.jface.window.Window.open(Window.java:552)
at myTableViewer.main(myTableViewer.java:73)
----------------------------------------------

My understanding is that this input item should simply be passed on to the content provider's getElements() method. In my case, the content provider takes this value (a key in a database table) and returns an array of elements to be displayed.

Does anyone know where I'm going wrong. Have been going round in circles for a while with this one - suspect there's a fundamental hole in my understanding of the framework... Online tutorials don't seem to address the point in much detail.

Many thanks,

Jay
 
igor ganapolsky
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your code of myTableViewer?
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unlikely. This thread was 4.5 years old, and the poster hasn't been active since 2005.
 
igor ganapolsky
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob,
I thought I'd give it a shot. Whenever I see old posts I'm never sure whether they are still worth posting to. My opinion is 'YES' because someone on the net doing a search may still find these replies helpful.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!