Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF.Edit - Problem with ITableItemLabelProvider
EMF.Edit - Problem with ITableItemLabelProvider [message #621504] Wed, 21 October 2009 13:45 Go to next message
Florian  is currently offline Florian Friend
Messages: 16
Registered: July 2009
Junior Member
Hi,

i am working on a gmf-based editor and i want to display data of a model object in a table. Therefore i implemented the interfaces IStructuredItemContentProvider & ITableItemLabelProvider in my edit provider.

The code in the setInput method of the property section looks like this:

AdapterFactory af = getAdapterFactory(inputElement);
if (af != null)
{
afContentProvider.setAdapterFactory(af);
afLabelProvider.setAdapterFactory(af);

inputTableViewer.setContentProvider(afContentProvider);
inputTableViewer.setLabelProvider(afLabelProvider);
inputTableViewer.setInput(getEObject());
inputTableViewer.refresh(true);
}

The problem is now, that the methods getColumnImage & getColumnText are never called; instead the default toString is exectued; although my provider does implement the corresponding methods. I dont know why this in not working because for the Content Provider it is working. This means that getElements from IStructuredItemContentProvider is called.
Does anybody have a clue why this in not working for my ITableItemLabelProvider?

Any kind of feedback would be highly appreciated.

Greetings,
Florian
Re: EMF.Edit - Problem with ITableItemLabelProvider [message #621505 is a reply to message #621504] Wed, 21 October 2009 14:18 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31907
Registered: July 2009
Senior Member
Florian,

If you used the GenModel property "Table Providers" it should generate
something that works. Did you update the factory to indicate it's a
supported type?

public LibraryItemProviderAdapterFactory()
{
supportedTypes.add(IEditingDomainItemProvider.class);
supportedTypes.add(IStructuredItemContentProvider.class);
supportedTypes.add(ITreeItemContentProvider.class);
supportedTypes.add(IItemLabelProvider.class);
supportedTypes.add(IItemPropertySource.class);
}


Florian wrote:
> Hi,
>
> i am working on a gmf-based editor and i want to display data of a
> model object in a table. Therefore i implemented the interfaces
> IStructuredItemContentProvider & ITableItemLabelProvider in my edit
> provider.
>
> The code in the setInput method of the property section looks like this:
>
> AdapterFactory af = getAdapterFactory(inputElement);
> if (af != null)
> {
> afContentProvider.setAdapterFactory(af);
> afLabelProvider.setAdapterFactory(af);
>
> inputTableViewer.setContentProvider(afContentProvider);
> inputTableViewer.setLabelProvider(afLabelProvider);
> inputTableViewer.setInput(getEObject());
> inputTableViewer.refresh(true);
> }
>
> The problem is now, that the methods getColumnImage & getColumnText
> are never called; instead the default toString is exectued; although
> my provider does implement the corresponding methods. I dont know why
> this in not working because for the Content Provider it is working.
> This means that getElements from IStructuredItemContentProvider is
> called.
> Does anybody have a clue why this in not working for my
> ITableItemLabelProvider?
>
> Any kind of feedback would be highly appreciated.
>
> Greetings,
> Florian
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EEF + XSD.ecore
Next Topic:[EcoreTools] Refresh problem
Goto Forum:
  


Current Time: Fri Jun 18 00:56:57 GMT 2021

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

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

Back to the top