Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337442

Summary: [NatTableWidget] CreateNewElement action is not available
Product: z_Archived Reporter: Nicolas Guyomar <nicolas.guyomar>
Component: EMF-FacetAssignee: Gregoire Dupe <gdupe>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: emft.facet-inbox, gdupe
Version: unspecifiedFlags: gdupe: indigo+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
org.eclipse.emf.facet.widgets.nattable.examples.ecore
gdupe: iplog+
Patch to set the command visible
gdupe: iplog+
stacktrace of a "create new element" error
none
org.eclipse.emf.facet.widgets.nattable.examples.ecore gdupe: iplog+

Description Nicolas Guyomar CLA 2011-02-17 09:31:15 EST
Hi,

The action "Create new element" which allow the user to create new elements based on queries referenced in a TableConfiguration model is not visible in the toolbar menu.

Regards,
Nicolas Guyomar
Comment 1 Nicolas Guyomar CLA 2011-02-17 09:46:10 EST
Created attachment 189190 [details]
org.eclipse.emf.facet.widgets.nattable.examples.ecore

Hi,

Here is a new example plugin to reproduce the error (and test further code modifications)

Authors are Gregoire Dupe (commiter) and myself : 

(a) I, Nicolas Guyomar, wrote 100% of the code I've provided.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.


Regards,
Nicolas Guyomar
Comment 2 Nicolas Guyomar CLA 2011-02-17 09:48:02 EST
Created attachment 189191 [details]
Patch to set the command visible

Hi,

Please find attached a patch which change the visibility test for the "Create new element" command.
Concerned projects are 
-org.eclipse.emf.facet.widgets.nattable
-org.eclipse.emf.facet.widgets.nattable.workbench

(a) I, Nicolas Guyomar, wrote 100% of the code I've provided.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.

Regards,
Nicolas Guyomar
Comment 3 Gregoire Dupe CLA 2011-02-17 10:38:41 EST
Comment on attachment 189190 [details]
org.eclipse.emf.facet.widgets.nattable.examples.ecore

Here are a contribution from one employee of Mia-Software, targeting future
Indigo release. The company has signed a Member Commiter Agreement. The
contribution does not need a CQ (see bug 322327).

I've committed this contribution.

Committed revision 323.
Comment 4 Gregoire Dupe CLA 2011-02-17 10:47:52 EST
Comment on attachment 189191 [details]
Patch to set the command visible

Here are a contribution from one employee of Mia-Software, targeting future
Indigo release. The company has signed a Member Commiter Agreement. The
contribution does not need a CQ (see bug 322327).

I've committed this contribution.

Committed revision 324.
Comment 5 Gregoire Dupe CLA 2011-02-17 10:59:31 EST
Created attachment 189199 [details]
stacktrace of a "create new element" error

When I try to create a new element with the nattable wigdet action, I get this error.
Comment 6 Gregoire Dupe CLA 2011-02-17 11:05:04 EST
(In reply to comment #5)
> Created attachment 189199 [details]
> stacktrace of a "create new element" error
> 
> When I try to create a new element with the nattable wigdet action, I get this
> error.

I fixed this problem by modifying org.eclipse.emf.facet.infra.common.core.internal.builder.AbstractEmfFacetCatalog.getBundle(EObject).

Committed revision 325.
Comment 7 Gregoire Dupe CLA 2011-02-17 11:14:56 EST
I've added org.eclipse.emf.facet.widgets.nattable.examples.ecore in the releng.

Committed revision 326.
Comment 8 Nicolas Guyomar CLA 2011-02-17 11:20:18 EST
Created attachment 189200 [details]
org.eclipse.emf.facet.widgets.nattable.examples.ecore

Hi,

There is a small modification to make to the opening action of this example if we want to be able to save the created elements.

An editing domain has to be given to the widget.

(a) I, Nicolas Guyomar, wrote 100% of the code I've provided.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.

Regards,
Nicolas Guyomar
Comment 9 Gregoire Dupe CLA 2011-02-17 13:36:08 EST
Comment on attachment 189200 [details]
org.eclipse.emf.facet.widgets.nattable.examples.ecore


Here are a contribution from one employee of Mia-Software, targeting future
Indigo release. The company has signed a Member Commiter Agreement. The
contribution does not need a CQ (see bug 322327).

I've committed this contribution.

Committed revision 327.
Comment 10 Gregoire Dupe CLA 2011-02-17 13:36:37 EST
This bug can be marked has fixed.
Comment 11 Vincent Lorenzo CLA 2011-03-11 07:16:45 EST
I can' t close this bug, because the action doesn't work. In my table, when I try to create a new element, I get this exception : 

java.lang.NoSuchMethodError: org.eclipse.emf.facet.widgets.nattable.instance.tableinstance.TableInstance.getParameter()Ljava/lang/Object;
	at org.eclipse.emf.facet.widgets.nattable.NatTableWidget.getParameter(NatTableWidget.java:2192)
	at org.eclipse.emf.facet.widgets.nattable.NatTableWidget.createNewElement(NatTableWidget.java:1937)
	at org.eclipse.emf.facet.widgets.nattable.NatTableWidget.createNewElement(NatTableWidget.java:1916)
	at org.eclipse.emf.facet.widgets.nattable.NatTableWidget.selectInstantiationMethodToLaunch(NatTableWidget.java:1905)
	at org.eclipse.emf.facet.widgets.nattable.handlers.LaunchInstantiationMethodHandler.execute(LaunchInstantiationMethodHandler.java:29)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:824)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:810)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:800)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4126)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3715)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2697)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2661)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2495)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 12 Nicolas Guyomar CLA 2011-03-15 06:55:57 EDT
(In reply to comment #11)

Hi Vincent,

I can not reproduce this exception.

Could you give us steps to reproduce it ? As well the different resources you are using?

I tested it with the latest EMF Facet build and the org.eclipse.emf.facet.widgets.nattable.examples.ecore plug-in, to create EClass and EDataType in an Ecore model.

Regards,
Nicolas Guyomar
Comment 13 Vincent Lorenzo CLA 2011-04-06 03:25:09 EDT
This bug can be closed.
Comment 14 Gregoire Dupe CLA 2011-06-06 11:42:55 EDT
(In reply to comment #13)
> This bug can be closed.

Then, I close this bug.