Forums Register Login

Problems using/understanding TableViewer.setInput() method

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Can you post your code of myTableViewer?
+Pie Number of slices to send: Send
Unlikely. This thread was 4.5 years old, and the poster hasn't been active since 2005.
+Pie Number of slices to send: Send
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.
This one time, at bandcamp, I had relations with a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3498 times.
Similar Threads
a question about eclipse and easystruts
Eclipse and weblogic
ServiceUnavailableException
Invalid thread access Exception
eclipse configration error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:30:40.