I have created EMF editors for a model. I need to customize the Table View
that will allow the user to use it as a fully functional editor. I have
searched the questions posted before and someone suggested to create a
AdapterFactoryTableEditor from AdapterFactoryTableTreeEditor and make some
modifications to it. After implementing the AdapterFactoryTableEditor, I
was able to click on the cells, but the cells are still not editable in
the table. Do I need to setCellEditors and setCellModifer? I am very new
to Eclipse, and still learning the EMF framework. Any suggestions will be
appreciated. my code looks like this:
In createPage of my xyz.editor:
..
AdapterFactoryTableContentProvider(adapterFactory)
{
public Object[] getElements(Object object) {
..
}
public void notifyChanged(Notification notification) {
switch (notification.getEventType()) {
..
}
}
tableViewer.setLabelProvider(new
AdapterFactoryLabelProvider(adapterFactory));
new AdapterFactoryTableEditor(tableViewer.getTable(), adapterFactory);
tableViewer.setColumnProperties(columnNames);
resource = ...
tableViewer.setInput(...);
createContextMenuFor(tableViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TablePage_label"));
Maybe looking in org.eclipse.emf.mapping.presentation.MappingEditor's
use of AdapterFactoryTableTreeEditor will help you understand what you
need to do next. It's been a long time since I worked on cell editors...
gnil wrote:
> I have created EMF editors for a model. I need to customize the Table
> View that will allow the user to use it as a fully functional editor.
> I have searched the questions posted before and someone suggested to
> create a AdapterFactoryTableEditor from AdapterFactoryTableTreeEditor
> and make some modifications to it. After implementing the
> AdapterFactoryTableEditor, I was able to click on the cells, but the
> cells are still not editable in the table. Do I need to
> setCellEditors and setCellModifer? I am very new to Eclipse, and still
> learning the EMF framework. Any suggestions will be appreciated. my
> code looks like this:
>
> In createPage of my xyz.editor:
> ..
> AdapterFactoryTableContentProvider(adapterFactory)
> {
> public Object[] getElements(Object object) {
> ..
> }
> public void notifyChanged(Notification notification) {
> switch (notification.getEventType()) {
> ..
> }
> }
> tableViewer.setLabelProvider(new
> AdapterFactoryLabelProvider(adapterFactory));
> new AdapterFactoryTableEditor(tableViewer.getTable(), adapterFactory);
> tableViewer.setColumnProperties(columnNames);
> resource = ...
> tableViewer.setInput(...);
> createContextMenuFor(tableViewer);
> int pageIndex = addPage(viewerPane.getControl());
> setPageText(pageIndex, getString("_UI_TablePage_label"));
>
Thanks for pointing out the MappingEditor. The DropDownEditor in it
provides me with good starting point. Do you know any other examples other
than the MappingEditor that uses tthe text editor for the cell in the
TableViewer. Thanks in advance.
No, that's the only example I could find in our code.
gnil wrote:
> Thanks for pointing out the MappingEditor. The DropDownEditor in it
> provides me with good starting point. Do you know any other examples
> other than the MappingEditor that uses tthe text editor for the cell
> in the TableViewer. Thanks in advance.
>