Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » New Project Wizard not shown
New Project Wizard not shown [message #1705845] Wed, 19 August 2015 12:55 Go to next message
Steffen Schuette is currently offline Steffen SchuetteFriend
Messages: 26
Registered: August 2010
Junior Member
Hi,

I wanted to add a new project wizard to my Xtext dsl. Therefore I added the following code to the .mwe2 file of the plugin:

              // provides a new project wizard
    		fragment = projectWizard.SimpleProjectWizardFragment {
			    generatorProjectName = "${projectName}.generator"
			    fileExtension = fileExtensions
			} 


When regenerating this gave my a new namespace mydsl.wizard with MyDslProjectInfo.java and MyDSLNewProject.xpt

So far so good. Next I added the following code to MyDslUiModule.java

private AbstractUIPlugin plugin;  
	
	public MyDslUiModule(AbstractUIPlugin plugin) {
		super(plugin);
		this.plugin = plugin;
	}
	
	public void configureLanguageName(Binder binder) {  
	 binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("com.somepath.mydsl");  
	}  
	  
	public void configureFileExtensions(Binder binder) {  
	 binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("mydsl");  
	}  
	  
	@Override  
	public void configure(Binder binder) {  
	 super.configure(binder);  
	 binder.bind(AbstractUIPlugin.class).toInstance(plugin);  
	 binder.bind(IDialogSettings.class).toInstance(plugin.getDialogSettings());  
	}  
	  
	  
	// contributed by org.eclipse.xtext.ui.generator.projectWizard.SimpleProjectWizardFragment  
	public Class<? extends org.eclipse.xtext.ui.wizard.IProjectCreator> bindIProjectCreator() {  
	 return MyDslProjectCreator.class;  
	}  


However, the Wizard still does not show up. What am I missing out?

Thanks

Steffen
Re: New Project Wizard not shown [message #1705846 is a reply to message #1705845] Wed, 19 August 2015 13:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
did you merge plugin.xml_gen to plugin.xml

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: New Project Wizard not shown [message #1705954 is a reply to message #1705846] Thu, 20 August 2015 12:03 Go to previous messageGo to next message
Steffen Schuette is currently offline Steffen SchuetteFriend
Messages: 13
Registered: August 2015
Junior Member
That was it! Thanks. The following was missing:

 <extension
         point="org.eclipse.ui.newWizards">
      <wizard
            category="org.eclipse.xtext.projectwiz"
            class="myNamespace.MyDslExecutableExtensionFactory:myNamespace.MyDslNewProjectWizard"
            id="myNamespace.MyDslNewProjectWizard"
            name="MyDsl Application"
            project="true">
      </wizard>
   </extension>


However, I now have the next problem. Well actually there are 2 of them.

1. No matter what workspace location I choose in the wizard, e.g. c:\test the project is always created in the current eclipse workspace, e.g. runtime workspace.

2. I want to use the name of the new project in the .xpt template. However the following code leads to the error "Attribute ProjectName not found in myNamespace::MyDsl::MyDslProjectInfo"

«DEFINE model FOR MyDslProjectInfo»
	«FILE "src/test.mydsl"-»
	Project Name: «this.ProjectName»
	«ENDFILE»
«ENDDEFINE»


Why does it ignore the Getter of DefaultProjectInfo class?

Thanks!

[Updated on: Fri, 21 August 2015 06:55]

Report message to a moderator

Re: New Project Wizard not shown [message #1705965 is a reply to message #1705954] Thu, 20 August 2015 13:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
it is
«this.projectName»

in good old Xpand


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: New Project Wizard not shown [message #1706049 is a reply to message #1705965] Fri, 21 August 2015 12:06 Go to previous messageGo to next message
Steffen Schuette is currently offline Steffen SchuetteFriend
Messages: 13
Registered: August 2015
Junior Member
That was simple! It is working now (except for the bug with the location mentioned above) when I start it as runtime eclipse. When I export it as plugin (like I did it all the time before) the editor cannot start because:

org.eclipse.core.runtime.CoreException: Failed to create injector for myNamespace.MyDsl ExtensionFactory: myNamespace.MyDslExecutableExtensionFactory
	at org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory.create(AbstractGuiceAwareExecutableExtensionFactory.java:59)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:262)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
[...]
Caused by: com.google.inject.CreationException: Guice creation errors:

1) Error injecting constructor, org.eclipse.emf.common.util.WrappedException: org.eclipse.xtext.resource.ClasspathUriResolutionException: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/myDsl/mydsl.xmi'
  at org.eclipse.xtext.common.services.TerminalsGrammarAccess.<init>(Unknown Source)
  at org.eclipse.xtext.common.services.TerminalsGrammarAccess.class(Unknown Source)
Re: New Project Wizard not shown [message #1706054 is a reply to message #1706049] Fri, 21 August 2015 12:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Have no idea on that

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: New Project Wizard not shown [message #1787033 is a reply to message #1706049] Thu, 17 May 2018 13:08 Go to previous message
Marco Radavelli is currently offline Marco RadavelliFriend
Messages: 1
Registered: May 2018
Junior Member
Did you manage to solve that problem?

I have the same but cannot figure it out how to solve it :-(
Previous Topic:Error "Type Duplicate JvmIdentifiableElement '<unnamed>'"
Next Topic:Xtext 2.9.1 and Eclipse Photon Milestone 6 (4.8.0M6)
Goto Forum:
  


Current Time: Thu Apr 18 03:51:56 GMT 2024

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

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

Back to the top