Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322974 - Label not shown on Widget AdvancedTableComposition
Summary: Label not shown on Widget AdvancedTableComposition
Status: RESOLVED WORKSFORME
Alias: None
Product: EEF
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal
Target Milestone: ---   Edit
Assignee: EEF Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-18 01:41 EDT by Christophe Bouhier CLA
Modified: 2016-05-05 10:27 EDT (History)
1 user (show)

See Also:


Attachments
label not rendered (78.31 KB, image/png)
2010-08-23 09:04 EDT, Christophe Bouhier CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Bouhier CLA 2010-08-18 01:41:38 EDT
I have a feature which should render it's values in a Widget
AdvancedTableComposition.

Unfortunately, the label isn't displayed. (See attachment, in properties
view an element is selected, but no label).

I have put a breakpoint on the getText() method on xxItemProvider for
this object, which doesn't get called. I wonder if the adapterFactory is
correctly resolved by EEF in this case?

this is in my .edit plugin.xml

<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
       <factory
             uri="http://www.netxforge.com/15072010/networks"

class="com.netxforge.d.networks.provider.NetworksItemProviderAdapterFactory"
             supportedTypes=
               "org.eclipse.emf.edit.provider.IEditingDomainItemProvider

org.eclipse.emf.edit.provider.IStructuredItemContentProvider
                org.eclipse.emf.edit.provider.ITreeItemContentProvider
                org.eclipse.emf.edit.provider.IItemLabelProvider
                org.eclipse.emf.edit.provider.IItemPropertySource
                org.eclipse.emf.edit.provider.ITableItemLabelProvider"/>
    </extension>


Here is some extracts for this object:


<properties xsi:type="eef-components:PropertiesEditionElement"
xmi:id="_VSMjaJXLEd-GxtwJpoOb1Q" name="equipmentResources"
views="_VSNKqZXLEd-GxtwJpoOb1Q">
           <model xsi:type="ecore:EReference"
href="file:/Users/dzonekl/Documents/Spaces/netxstudio.gen2/com.netxforge.d/model/networks.ecore#//Equipment/equipmentResources"/>


<elements xsi:type="eef-views:ElementEditor"
xmi:id="_VSNKqZXLEd-GxtwJpoOb1Q" name="Equipment Resources">
             <representation
href="platform:/plugin/org.eclipse.emf.eef.views/std/EMFProperties.toolkits#//@widgets.7"/>
Comment 1 Bouchet Stéphane CLA 2010-08-23 05:00:48 EDT
hi,

seems you forgot to attach the screenshot.. 

BTW, in the EquipmentResourcesFormPart, you should put a breakpoint in the Widget implementation that is responsible of the table display.
Comment 2 Christophe Bouhier CLA 2010-08-23 09:04:54 EDT
Created attachment 177211 [details]
label not rendered
Comment 3 Christophe Bouhier CLA 2010-08-23 09:16:23 EDT
Hi, 

There is no specific FormPart for EquipmentResources. 
The widget you refer to, is it? (What do I need to check here? The label provider seems to be set). 

	protected void createEquipmentResourcesTableComposition(FormToolkit widgetFactory, Composite parent) {
		this.equipmentResources = new ReferencesTable<NetXResource>(NetworksMessages.EquipmentPropertiesEditionPart_EquipmentResourcesLabel, new ReferencesTableListener<NetXResource>() {			
			public void handleAdd() { addToEquipmentResources();}
			public void handleEdit(NetXResource element) { editEquipmentResources(element); }
			public void handleMove(NetXResource element, int oldIndex, int newIndex) { moveEquipmentResources(element, oldIndex, newIndex); }
			public void handleRemove(NetXResource element) { removeFromEquipmentResources(element); }
			public void navigateTo(NetXResource element) { }
		});
		this.equipmentResources.setHelpText(propertiesEditionComponent.getHelpContent(NetworksViewsRepository.Equipment.equipmentResources, NetworksViewsRepository.FORM_KIND));
		this.equipmentResources.createControls(parent, widgetFactory);
		GridData equipmentResourcesData = new GridData(GridData.FILL_HORIZONTAL);
		equipmentResourcesData.horizontalSpan = 3;
		this.equipmentResources.setLayoutData(equipmentResourcesData);
		this.equipmentResources.setLowerBound(0);
		this.equipmentResources.setUpperBound(-1);
	}
Comment 4 Bouchet Stéphane CLA 2010-08-24 05:24:56 EDT
(In reply to comment #3)

Seems it comes from the Referencestables ( which resides in the EEF runtime ).

the table use a adapterfactory that is initialized like :
	protected AdapterFactory adapterFactory = new ComposedAdapterFactory(
			ComposedAdapterFactory.Descriptor.Registry.INSTANCE);

so it will provide your adapterfactory specified in the plugin.xml.


i will look deeper.
Comment 5 Christophe Bouhier CLA 2010-08-24 05:37:57 EDT
BTW, I am going to see if this also occurs on a win32 build. (I now use MacOSX Snow leopard).
Comment 6 Bouchet Stéphane CLA 2010-08-24 06:02:26 EDT
ok, after checking the nonreg tests plugins, it goes thru the getText of the itemprovider of the element you want to display.

in your case, it must go to the getText() of the requirementItemProvider ...

does it happens only with this widget ?
Comment 7 Christophe Bouhier CLA 2010-08-24 06:06:16 EDT
BTW, I am going to see if this also occurs on a win32 build. (I now use MacOSX Snow leopard).
Comment 8 Christophe Bouhier CLA 2010-08-24 06:21:49 EDT
- Yes, it seems to happen only on this widget. 
- The item provider is in this case EquipmentItemProvider. 
- not sure what you mean with nonreg (Non regression?).
Comment 9 Bouchet Stéphane CLA 2010-08-24 08:41:39 EDT
(In reply to comment #8)
> - Yes, it seems to happen only on this widget. 
> - The item provider is in this case EquipmentItemProvider. 

this is strange that the adapterFactory does not work for this case.

could you send me your test case ? 

> - not sure what you mean with nonreg (Non regression?).

yes, in the CVS we have severals non regressions tests.
Comment 10 Christophe Bouhier CLA 2010-08-24 10:23:55 EDT
(In reply to comment #9)
> (In reply to comment #8)
> > - Yes, it seems to happen only on this widget. 
> > - The item provider is in this case EquipmentItemProvider. 
> 
> this is strange that the adapterFactory does not work for this case.
> 
> could you send me your test case ? 

I don't really have a test case, I just see this when launching the app.
Would you like the model etc.. in place?

> 
> > - not sure what you mean with nonreg (Non regression?).
> 
> yes, in the CVS we have severals non regressions tests.
Comment 11 Bouchet Stéphane CLA 2010-08-24 10:47:37 EDT
(In reply to comment #10)
> > 
> > this is strange that the adapterFactory does not work for this case.
> > 
> > could you send me your test case ? 
> 
> I don't really have a test case, I just see this when launching the app.
> Would you like the model etc.. in place?
> 

yes, the whole app would be nice ( ecore + edit + editor + eef generated )
Comment 12 Christophe Bouhier CLA 2010-08-24 16:24:08 EDT
(In reply to comment #11)
> (In reply to comment #10)
> > > 
> > > this is strange that the adapterFactory does not work for this case.
> > > 
> > > could you send me your test case ? 
> > 
> > I don't really have a test case, I just see this when launching the app.
> > Would you like the model etc.. in place?
> > 
> 
> yes, the whole app would be nice ( ecore + edit + editor + eef generated )

I have tested this with win32, and the same problem persists. 
I wonder if this could be a configuration issue like defining the correct extensions in plugin.xml?
Comment 13 Bouchet Stéphane CLA 2010-08-25 05:13:48 EDT
(In reply to comment #12)

> I have tested this with win32, and the same problem persists. 
> I wonder if this could be a configuration issue like defining the correct
> extensions in plugin.xml?


your plugin.xml seems fine, for the adapterFactory case.

please verify that all the EEF generated stuff is correct ( diff between the eef generated plugin.xml and your plugin.xml )
Comment 14 Christophe Bouhier CLA 2010-08-25 05:47:13 EDT
In order not to overload you with a non-bug, 
I intend to reproduce the problem, with the simplest possible model. 
So, I will produce this, if the bug persists, I will send you this snippet model.
Comment 15 Christophe Bouhier CLA 2010-08-26 06:23:01 EDT
Hi Stephane, 
I made a simple library, book, writer model with an EReference between book and writers. This uses the Widget AdvancedReferencesTable without any problem. The label is shown. 
So, I can't reproduce the problem with a small model. 
I propose we close this issue, as it's likely a setup issue in my case (plugin.xml?).
Comment 16 Bouchet Stéphane CLA 2010-08-26 08:46:32 EDT
(In reply to comment #15)
> Hi Stephane, 
> I made a simple library, book, writer model with an EReference between book and
> writers. This uses the Widget AdvancedReferencesTable without any problem. The
> label is shown. 
> So, I can't reproduce the problem with a small model. 
> I propose we close this issue, as it's likely a setup issue in my case
> (plugin.xml?).

Yes, we can do that, but i am still perplex about your issue...
Comment 17 Christophe Bouhier CLA 2010-08-26 08:59:17 EDT
Also, I didn't mention but my setup is slightly different from the standard generated EMF code. 

1. I use a shared editing domain. So in the various editors I have, I refer to this shared domain. 
2. I use a transactional editing domain which is declared in the workbench. 
3. Because of this shared domain, I centralize some of the stuff, like the resource problem indication. 
4. My resource, is an HibernateResource, so I use Teneo to persist my resource. 


Now, I am thinking about applying the same concept to my simplified model, and see if I reproduce. 

Cheers Christophe
Comment 18 Christophe Bouhier CLA 2010-09-07 04:08:11 EDT
Hi, 

I am not 100%, but the problem can be reproduced by using a Workspace Transactional Editing domain. 

So an editing domain created with i.e. this: 

TransactionalEditingDomain domain = TransactionalEditingDomain.Registry.INSTANCE
				.getEditingDomain(EDITING_DOMAIN_ID);

The ID, is a declared shared domain. 
In my case, I use a WorkspaceEditingDomainFactory. 


<extension point="org.eclipse.emf.transaction.editingDomains">
    <domain> id="org.eclipse.example.MyDomain"
            factory="org.eclipse.emf.workspace.WorkspaceEditingDomainFactory"/>
</extension>


I think the EEF label providers will perhaps not correctly use the : 

TransactionalAdapterFactoryContentProvider TransactionalAdapterFactoryLabelProvider

as suggested in the documentation. 
When changing my code to a regular editing domain, the problem dissapeared.