[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: TableViewer, empty table and cell selection
|
Paul Neyman schrieb:
Hello,
I am using a TableViewer example provided in the Articles.
(http://www.eclipse.org/articles/Article-Table-viewer/table_viewer.html).
Is there any way to initialize TableViewer on an empty Table? Currently,
doing so causes an AssertionFailedException in the
StucturedViewerException, because an array of elements returned by my
IStructuredContentProvider is null (the table is empty!)
Please provide code snippet we can run without modification to reproduce
because this should not be a problem.
However, removing all elements from a table later does not cause any
trouble for TableViewer. So my current hack is to insert one dummy
element into the Table, do tableViewer.setInput() and remove the element
afterwards. Is there a more elegant way?
My second question: the example implementation in the article lets you
select a row by clicking on the first cell in the row only. After that I
can edit any cell in the selected row. How can I enable arbitrary cell
selection and immediate activation of that cell's editor?
You need to pass SWT.FULL_SELECTION.
Tom
--
B e s t S o l u t i o n . at
--------------------------------------------------------------------
Tom Schindl JFace-Committer
--------------------------------------------------------------------