Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Adding Xtext nature to Xtext project from existing ecore
Adding Xtext nature to Xtext project from existing ecore [message #999111] Fri, 11 January 2013 11:12 Go to next message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

Hi everyone,

I've created new Xtext project from my ecore model. After some problems I've generated correctly Xtext Artifacts. Now, as usual, I've launched an Eclipse instance and I've created a new project. But when I create a new file with my extension will not appear dialog for adding Xtext nature to the project.

Why is this happening?
Re: Adding Xtext nature to Xtext project from existing ecore [message #999117 is a reply to message #999111] Fri, 11 January 2013 11:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
I think there is still something wrong generated. As a first step I
would compare plugin.XML and plugin.xml-gen
Then I would have a look at the OSGi console and check if your
languages ui plugin is correctly started

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Adding Xtext nature to Xtext project from existing ecore [message #999118 is a reply to message #999111] Fri, 11 January 2013 11:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
PS make sure you use builderintegrationfragment in your workflow

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Adding Xtext nature to Xtext project from existing ecore [message #999162 is a reply to message #999117] Fri, 11 January 2013 13:38 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

Christian Dietrich wrote on Fri, 11 January 2013 12:21
I think there is still something wrong generated. As a first step I
would compare plugin.XML and plugin.xml-gen
Then I would have a look at the OSGi console and check if your
languages ui plugin is correctly started


How can't I see that? There isn't a generated plugin!

When I create the project no plugin.xml was create automatically, so I've written the plugin, but there isn't generated one.
Doesn't it like my plugin?


<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<plugin>

  <extension point="org.eclipse.emf.ecore.generated_package">
    <package 
       uri = "http://www.rcpvision.it/ats/suitetest/CoreLanguage" 
       class = "it.rcpvision.ats.suitetest.corelanguage.LanguagePackage"
       genModel = "it/rcpvision/ats/suitetest/CoreLanguage.genmodel" /> 
	
 </extension>
</plugin>
Re: Adding Xtext nature to Xtext project from existing ecore [message #999171 is a reply to message #999162] Fri, 11 January 2013 13:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
Am talking about the ui project not the runtime project. What does
the console say?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Adding Xtext nature to Xtext project from existing ecore [message #999173 is a reply to message #999171] Fri, 11 January 2013 14:09 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

Plugin e plugin_gen in ui project are identical.

Console says:
0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri 'E:\Workspaces\PrototipoAts'
511  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'com.egicon.ats.sequence.model.sequenceruntime.AtsSequenceRuntimePackage'
511  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'com.egicon.ats.sequence.model.atsvariable.AtsvariablePackage'
511  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'com.egicon.ats.sequence.model.typesystem.AtstypesystemPackage'
512  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'com.egicon.ats.sequence.model.sequenceedit.AtssequenceeditPackage'
717  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://com/egicon/ats/sequenceruntime' from 'platform:/resource/com.egicon.ats.sequence.model/model/AtsSequenceRuntime.genmodel'
717  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://com/egicon/ats/sequenceedit' from 'platform:/resource/com.egicon.ats.sequence.model/model/AtsSequenceEdit.genmodel'
717  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://com/egicon/ats/typesystem' from 'platform:/resource/com.egicon.ats.sequence.model/model/AtsSequenceEdit.genmodel'
717  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://com/egicon/ats/variable' from 'platform:/resource/com.egicon.ats.sequence.model/model/AtsSequenceEdit.genmodel'
717  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://configuration' from 'platform:/resource/com.egicon.ats.devices.model/model/configuration.genmodel'
1161 [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning E:\Workspaces\PrototipoAts\it.rcpvision.ats.suitetest.corelanguage\..\it.rcpvision.ats.suitetest.corelanguage\src-gen
1169 [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning E:\Workspaces\PrototipoAts\it.rcpvision.ats.suitetest.corelanguage\..\it.rcpvision.ats.suitetest.corelanguage.ui\src-gen
1293 [main] INFO  ipse.xtext.generator.LanguageConfig  - generating infrastructure for it.rcpvision.ats.suitetest.CoreLanguage with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, Ecore2XtextValueConverterServiceFragment, JavaValidatorFragment, ImportURIScopingFragment, SimpleNamesFragment, FormatterFragment, LabelProviderFragment, OutlineTreeProviderFragment, QuickOutlineFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment, CompareFragment, BuilderIntegrationFragment, QuickfixProviderFragment
3566 [main] INFO  or.validation.JavaValidatorFragment  - generating Java-based EValidator API
4520 [main] INFO  text.generator.junit.Junit4Fragment  - generating Compare Framework infrastructure
4607 [main] INFO  .emf.mwe2.runtime.workflow.Workflow  - Done.
Re: Adding Xtext nature to Xtext project from existing ecore [message #999177 is a reply to message #999173] Fri, 11 January 2013 14:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
Hi,

Is the editor generally working? Is the only missing the the
natureaddingcallback. Did you check the builderintegrationfragment as
I said?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Adding Xtext nature to Xtext project from existing ecore [message #999180 is a reply to message #999173] Fri, 11 January 2013 14:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
PS from the log this does not seem the problem .so what does the
console say when running eclipse?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Adding Xtext nature to Xtext project from existing ecore [message #999191 is a reply to message #999180] Fri, 11 January 2013 14:40 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

Thanks for replies.

Yes, I've got
fragment = builder.BuilderIntegrationFragment {}
in my .mwe2

The editor doesn't work: I see the file with the default editor, no editor for my language is avaible.

But now I've got following exception:
!SESSION 2013-01-11 15:36:37.826 -----------------------------------------------
eclipse.buildId=I20120608-1400
java.version=1.6.0_38
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=it_IT
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data E:\Workspaces\PrototipoAts/../runtime-EclipseApplication -dev file:E:/Workspaces/PrototipoAts/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os win32 -ws win32 -arch x86 -consoleLog

!ENTRY org.eclipse.jdt.core 4 4 2013-01-11 15:36:51.390
!MESSAGE Exception while initializing all containers
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource '/.org.eclipse.jdt.core.external.folders/.link4' already exists.
	at org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:320)
	at org.eclipse.core.internal.resources.Resource.assertLinkRequirements(Resource.java:176)
	at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:673)
	at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:647)
	at org.eclipse.jdt.internal.core.ExternalFoldersManager.createLinkFolder(ExternalFoldersManager.java:166)
	at org.eclipse.jdt.internal.core.ExternalFoldersManager.createLinkFolder(ExternalFoldersManager.java:157)
	at org.eclipse.jdt.internal.core.ExternalFolderChange.updateExternalFoldersIfNecessary(ExternalFolderChange.java:48)
	at org.eclipse.jdt.internal.core.ChangeClasspathOperation.classpathChanged(ChangeClasspathOperation.java:62)
	at org.eclipse.jdt.internal.core.SetContainerOperation.executeOperation(SetContainerOperation.java:110)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793)
	at org.eclipse.jdt.internal.core.JavaModelManager$11.run(JavaModelManager.java:2773)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2789)
	at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1873)
	at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:3128)
	at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2691)
	at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2855)
	at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1960)
	at org.eclipse.jdt.internal.core.JavaProject.buildStructure(JavaProject.java:463)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:258)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:518)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:255)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:241)
	at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:196)
	at org.eclipse.jdt.internal.core.JavaProject.getPackageFragmentRoots(JavaProject.java:1848)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.getPackageFragmentRoots(PackageExplorerContentProvider.java:323)
	at org.eclipse.jdt.ui.StandardJavaElementContentProvider.getChildren(StandardJavaElementContentProvider.java:183)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.getChildren(PackageExplorerContentProvider.java:307)
	at org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren(AbstractTreeViewer.java:1374)
	at org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeViewer.java:391)
	at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.getFilteredChildren(ProblemTreeViewer.java:274)
	at org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildren(AbstractTreeViewer.java:620)
	at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:820)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:797)
	at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:644)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:768)
	at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:1500)
	at org.eclipse.jface.viewers.TreeViewer.handleTreeExpand(TreeViewer.java:952)
	at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:1511)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:132)
	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.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:7565)
	at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5534)
	at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1896)
	at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:5086)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4584)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4976)
	at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2440)
	at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1534)
	at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:6435)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4564)
	at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5958)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4976)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2546)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3756)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	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:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	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:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
!SUBENTRY 1 org.eclipse.core.resources 4 367 2013-01-11 15:36:51.393
!MESSAGE Resource '/.org.eclipse.jdt.core.external.folders/.link4' already exists.

!ENTRY org.eclipse.ui 2 2 2013-01-11 15:37:28.842
!MESSAGE Invalid property category path: ValidationPropertiesPage (bundle: org.eclipse.wst.xml.ui, propertyPage: org.eclipse.wst.xml.ui.propertyPage.project.validation)
Re: Adding Xtext nature to Xtext project from existing ecore [message #999196 is a reply to message #999191] Fri, 11 January 2013 14:46 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
Hi there does not seem to be any hint on Xtext in that log. Please
use the OSGi console to check if the ui plugin of your lang is
started

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Adding Xtext nature to Xtext project from existing ecore [message #999215 is a reply to message #999196] Fri, 11 January 2013 15:16 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

OSGi console says that my plugin is installed:
...
597	INSTALLED   it.rcpvision.ats.suitetest.corelanguage_1.0.0.qualifier
598	INSTALLED   it.rcpvision.ats.suitetest.corelanguage.tests_1.0.0.qualifier
599	INSTALLED   it.rcpvision.ats.suitetest.corelanguage.ui_1.0.0.qualifier
osgi> 
Re: Adding Xtext nature to Xtext project from existing ecore [message #999218 is a reply to message #999215] Fri, 11 January 2013 15:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
Installed is not started.

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Adding Xtext nature to Xtext project from existing ecore [message #999233 is a reply to message #999218] Fri, 11 January 2013 15:56 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

And why doesn't it start.

I've tryed with library example and it works.
So, here what I've done from the begin:
1) I have an ecore model
2) I've created new Xtext project from my existing ecore
3) I've changed imports with right strings (see below)
4) Generated Xtext Artifact
5) Run Eclipse Application
6) Create new java project and new .myextension file

With library it works, with my ecore plugin doesn't start.

import "platform:/resource/com.egicon.ats.sequence.model/model/AtsVariable.ecore" 
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "platform:/resource/com.egicon.ats.sequence.model/model/AtsTypeSystem.ecore" as typesystem
import "platform:/resource/com.egicon.ats.sequence.model/model/AtsSequenceEdit.ecore" as sequenceedit
import "platform:/resource/com.egicon.ats.devices.model/model/configuration.ecore" as configuration
Re: Adding Xtext nature to Xtext project from existing ecore [message #999236 is a reply to message #999233] Fri, 11 January 2013 15:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6327
Registered: July 2009
Senior Member
Please share a complete reproducable example (zip file )

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Adding Xtext nature to Xtext project from existing ecore [message #999242 is a reply to message #999236] Fri, 11 January 2013 16:16 Go to previous messageGo to next message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

Here are

[Updated on: Mon, 14 January 2013 10:04]

Report message to a moderator

Re: Adding Xtext nature to Xtext project from existing ecore [message #1000225 is a reply to message #999242] Mon, 14 January 2013 10:04 Go to previous message
Tommaso De Sica is currently offline Tommaso De Sica
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

Solved.

Problem was that some plugin in dependences uses Java 1.7.

Thanks for interesting.
Previous Topic:Parser optymization
Next Topic:Changing Xtext terminal symbols without changing the underlying model
Goto Forum:
  


Current Time: Thu Oct 02 04:48:41 GMT 2014

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

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