Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Need Editable TableViewer
Need Editable TableViewer [message #400138] Tue, 11 April 2006 17:33 Go to next message
Eclipse UserFriend
Originally posted by: gnilaehs.yahoo.com

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"));
Re: Need Editable TableViewer [message #400140 is a reply to message #400138] Tue, 11 April 2006 17:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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"));
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Need Editable TableViewer [message #400149 is a reply to message #400140] Tue, 11 April 2006 21:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gnilaehs.yahoo.com

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.
Re: Need Editable TableViewer [message #400150 is a reply to message #400149] Tue, 11 April 2006 21:44 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Plugin org.eclipse.emf.edit.ui not available
Next Topic:XYZEditPlugin cannot be resolved
Goto Forum:
  


Current Time: Fri Apr 26 22:56:31 GMT 2024

Powered by FUDForum. Page generated in 0.02375 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top