Summary: | DCR - JM - Buffer contents is duplicated (1G03HCP) | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Erich Gamma <erich_gamma> |
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P2 | CC: | kai-uwe_maetzel |
Version: | 2.0 | ||
Target Milestone: | 2.0 M1 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Erich Gamma
2001-10-10 22:51:05 EDT
JUI suggested we would define a factory method allowing them to supply their own document. pls discuss API addition with Kai before moving ahead. From Kai: As you know there has been a long lasting recurring discussion about the buffer duplication we see when editing a compilation unit in the editor. Here is a proposal that would solve our problem and wouldn't hurt you. Only api additions would be necessary. Having this issue solved would enable us to be less vulnerable when performing code manipulations while having open editors. Here it comes: ICompilationUnit addition: IWorkingCopy getWorkingCopy(IBufferFactory factory); IBufferFactory: IBuffer createBuffer(IOpenable owner); IBufferManager addition: IBuffer getBuffer(IOpenable owner, IBufferFactory factory); Optionally default: BufferManager implements IBufferFactory What do you think are the substantial disadvantages of this proposal? It would be good for us if we could find a solution as design decisions are queueing up relying on a decision. If you like we could talk about this on the phone tomorrow morning. IBufferManager is internal. Do you plan to use it? Added IWorkingCopy getWorkingCopy(IProgressMonitor, IBuffer) that returns an IWorkingCopy opened with the given buffer on ICompilationUnit. Actually, the buffer must know its owner upon creation as this owner is used as the key in the buffer manager table. So we need a factory as Kai suggested. Added IBufferFactory: IBuffer createBuffer(IOpenable owner); and changed getWorkingCopy to take a factory ICompilationUnit: IWorkingCopy getWorkingCopy(IBufferFactory factory); Added WorkingCopyTests.testWorkingCopyCustomizedBuffer() |