| Save event XtextEditor [message #756575] |
Mon, 14 November 2011 06:56  |
Darie Moldovan Messages: 67 Registered: November 2010 Location: Darmstadt, Germany |
Member |
|
|
Hi,
I'm wondering where I could find/customize/overwrite the doSave() method of an xtext editor, which was created in the classical way in Eclipse (New->Xtext Project). What I want to do is write some information in a file upon saving the model of the xtext editor. Due to the automatically generated structure of the editor, there is no explicit class, which extends the EditorPart and implements the doSave(), isDirty() etc. methods - the class where I could eventually write some data/preferences to a file.
Any help is kindly apreciated.
|
|
|
| Re: Save event XtextEditor [message #756631 is a reply to message #756575] |
Mon, 14 November 2011 09:34   |
Sven Efftinge Messages: 1668 Registered: July 2009 |
Senior Member |
|
|
You should create an implementation of IXtextEditorCallback and bind it like this in your <LanguageName>UIModule
public void configureMySpecialSaveHook(com.google.inject.Binder binder) {
binder.bind(IXtextEditorCallback.class).annotatedWith(Names.named("SpecialSaveHook")).to(
MySpecialSaveHook.class);
}
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
|
|
| Re: Save event XtextEditor [message #899674 is a reply to message #899667] |
Wed, 01 August 2012 14:36  |
Christian Dietrich Messages: 4554 Registered: July 2009 |
Senior Member |
|
|
Hi,
i am not quite sure what you want to do
never the less:
- call XtextEditor.getResource get an IResource and use std mechanims to calc the emf uri
- use XtextEditor.getDocument.readOnly/XtextEditor.getDocument.readOnly/modify
~Christian
|
|
|
Powered by
FUDForum. Page generated in 0.01986 seconds