Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311167 - [Documentation] Document how to make a language JDT independent
Summary: [Documentation] Document how to make a language JDT independent
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-30 08:57 EDT by Holger Schill CLA
Modified: 2017-09-19 18:00 EDT (History)
6 users (show)

See Also:
sebastian.zarnekow: helios+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Schill CLA 2010-04-30 08:57:01 EDT
To make a language JDT independent you have to use some implementations that have been introduced in bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=301606.

In the UIModele of your language you have to overwrite some bindings:

        @Override
	public Class<? extends IResourceForEditorInputFactory> bindIResourceForEditorInputFactory() {
		return ResourceForIEditorInputFactory.class;
	}
	
	@Override
	public Class<? extends IResourceSetProvider> bindIResourceSetProvider() {
		return SimpleResourceSetProvider.class;
	}
	
	@Override
	public com.google.inject.Provider<org.eclipse.xtext.resource.containers.IAllContainersState> provideIAllContainersState() {
		return org.eclipse.xtext.ui.shared.Access.getWorkspaceProjectsState();
	}

The next thing you have to do is to overwrite the generated projectCreator of you language. (If you told the Genarator to generate one)

In this class you have to overwrite the method configureProject. Normally the JDT-stuff of projectConfiguration is done here. We have no JDT so we have to configure nothing. Just leave the body empty.

The next thing is to redefine the projectNatures and builders that should be applied to you language projects.

In in this case just remove the JDT stuff in this way:

    protected String[] getProjectNatures() {
        return new String[] {
			"org.eclipse.pde.PluginNature",
			"org.eclipse.xtext.ui.shared.xtextNature"
		};
    }
    
    protected String[] getBuilders() {
    	return new String[]{
			"org.eclipse.pde.ManifestBuilder", 
			"org.eclipse.pde.SchemaBuilder"
		};
	}

After that you have to bind the new created Iproject

	@Override
	public Class<? extends IProjectCreator> bindIProjectCreator() {
		return JDTFreeMyDslProjectCreator.class;
	}

Done.
Comment 1 Jan Koehnlein CLA 2010-08-05 10:52:09 EDT
Fixed in HEAD. Proof reading would be appreciated.
Comment 2 Marco CLA 2010-09-22 14:16:31 EDT
What exactly is the fix?

For me the problem seems to be that there is no method configureProject in the tree of the generated ProjectCreator.
Comment 4 Sebastian Zarnekow CLA 2010-09-23 03:55:06 EDT
Unfortunately the docs are outdated. You have to customize the configured IProjectCreator.
Comment 5 Karsten Thoms CLA 2017-09-19 17:49:49 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 6 Karsten Thoms CLA 2017-09-19 18:00:47 EDT
Closing all bugs that were set to RESOLVED before Neon.0