Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325455

Summary: Split up IStateAccess into read and write interface
Product: [Modeling] TMF Reporter: Jan Koehnlein <jan>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow, tmf.xtext-inbox
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: M3   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Patch movinf modify() methd jan: review+

Description Jan Koehnlein CLA 2010-09-16 08:48:58 EDT
While the readOnly() method is used very often, the modify() method should be used in framework internal classes only as it does not update the node model. (Users should rather use the IDocumentEditor in these cases). Also, we cannot provide read access only which would satisfy most usecases.
Comment 1 Jan Koehnlein CLA 2010-10-07 12:36:12 EDT
Created attachment 180436 [details]
Patch movinf modify() methd

Proposed patch, please review.

Moved modify method to XtextDocument, as it is kind of internal API. Unfortunately, this requires some casts. We could also move it to IXtextDocument, exposing it a bit more but getting rid of the casts.

Anybody still needs (I)EObjectHandle?
Comment 2 Jan Koehnlein CLA 2010-10-08 05:14:38 EDT
Sorry, wrong patch. Please ignore, I am reworking it anyway.
Comment 3 Jan Koehnlein CLA 2010-10-08 08:15:09 EDT
Pushed the following changes to master:

- IStateAccess has been split up into IReadAccess and IWriteAccess
- IStateAccess.AbstractImpl is now AbstractReadWriteAccss
- Removed IEObjectHandle and EObjectHandle, as we don't use it anywhere. To avoid more intantiations of the same model in memory, clients should either use the XtextDocument's read/write access or refer to IEObjectDescriptions.
- Former XtextDocument.modify() renamed to XtextDocument.internalModify()
- XtextDoucment.modify() now invokes the code form the DefaultDocumentEditor. That way, the API of the document gets more symmetric to the user and the formerly hidden IDocumentEditor/DefaultDocumentEditor have become obsolete and have been removed.
- Intordcued constructor injection for XtextDocument.

I guess, the resulting API is far easier to understand.
Comment 4 Karsten Thoms CLA 2017-09-19 17:26:15 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:37:37 EDT
Closing all bugs that were set to RESOLVED before Neon.0