automatically adding a xtext nature to an existing file [message #893942] |
Fri, 06 July 2012 03:05  |
Eclipse User |
|
|
|
Hello!
In my project a new temporary editor-file is built by clicking on a button. This file ends everytime on ".calculation". Furthermore an anomaly of this file is that it does not belong to a project.
Now I want to add my xtext-nature to this file.
I've tried it with tis code:
public class NatureAddingEditorCallback extends AbstractDirtyStateAwareEditorCallback {
@Inject
private ToggleXtextNatureAction toggleNature;
@Override
public void afterCreatePartControl(XtextEditor editor) {
super.afterCreatePartControl(editor);
IResource resource = editor.getResource();
if (resource!=null && resource.getName().contains(".calculation")){
toggleNature.toggleNature(resource.getProject());
}
}
}
But this method is not called.
Can you help me, please?
Nice regards
Jule
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03827 seconds