Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325455 - Split up IStateAccess into read and write interface
Summary: Split up IStateAccess into read and write interface
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M3   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-16 08:48 EDT by Jan Koehnlein CLA
Modified: 2017-09-19 17:37 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments
Patch movinf modify() methd (8.77 KB, patch)
2010-10-07 12:36 EDT, Jan Koehnlein CLA
jan: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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