Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Shared working copies

Are there any client using shared working copies outside JDT/UI ?

These working copies are meant to be reused in multiple spots (e.g. several
editors in different windows) and thus provide some notion of sharing. This
mechanism allows all editors pointing at the same file to be updated
simultaneously when edits occur, since the underlying working copy and
associated buffer is the same.

Moving towards 3.0, shared working copies seem to be still hard to manage,
and bug report http://bugs.eclipse.org/bugs/show_bug.cgi?id=36888 expresses
the need to make these 'special' working copies being edited more
transparent. A typical situation causing grief is the package explorer
view,
which needs to switch a child element from a compilation unit to its
corresponding shared working copy, as soon as it gets open in an editor.
These items aren't identical, and what they'd like instead is to have a
unique handle onto the unit, which would be smart enough to understand it
becomes edited and thus would switch to a working copy like behavior from
thereon.

Currently, shared working copies are associated with a buffer factory,
which
is contributed by clients who care about these working copies. This
mechanism allows to have each client manage its own set of shared working
copies.

If moving away from these, and rather considering some smarter and more
transparent compilation units instead, then naturally we wonder whether we
should preserve supporting multiple clients or not.
If all clients are only interested in sharing the edited unit contents
anyway, the multiple clients story is just unnecessary flexibility which
will likely cause major API changes so as to provide the client viewpoint
information when necessary.

Please answer the PR directly, so that the discussion gets archived.





Back to the top