[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Button in SWT table

dansteu wrote:
Hi.
I am working on SWT TableViewer and I am trying to insert a button in rows of a given column. I need to have a button to then obtain an event. Till now I could only insert an image thanks to getColumnImage method in LabelProvider class...
how can I insert a button instead of an icon ?

FYI, Viewers (eg, TableViewer, TreeViewer, etc) are part of JFace, not SWT. JFace is a layer above SWT; it uses SWT but provides higher-level abstractions and MVC-like APIs.


You need to use the table editing APIs; a button would qualify as a cell editor, not a label. Start by looking at the class org.eclipse.jface.viewers.EditingSupport and its friends.
The JFace snippets will probably help you because they have examples of various kinds of table cell editors, including ones that put a button in the cell.
http://wiki.eclipse.org/index.php/JFaceSnippets


Hope this helps,
	Eric