This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Enhance CloneableEditorSupport to reflect read-only state | ||
---|---|---|---|
Product: | platform | Reporter: | Peter Zavadsky <pzavadsky> |
Component: | Text | Assignee: | issues@editor <issues> |
Status: | NEW --- | ||
Severity: | blocker | CC: | jglick, jtulach |
Priority: | P3 | Keywords: | API |
Version: | 3.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 21748 |
Description
Peter Zavadsky
2002-07-18 09:52:16 UTC
I remember a request to have two components open one of them in read-only state, second in read-write. If that is what we want to also solve, I suggest to add new constructor for CloneableEditor, so the creator can initialize the editor in the right state in CES.createCloneableEditor method: new CloneableEditor (this, false); this should cover most of the usecases. If there is a need to switch the state of editor, I would add protected final CloneableEditor.setReadOnly (boolean state) which could be used to change the state of the editor after creation (but only for subclassers). Acceptable? I think the diff status of components is an obscure idea. To support one read-only and second read-write component from the same support instance is not so easy possible with our current implementation. What should show the read-only component, while somebody else changes the read-write one? Should also show the changes or not? 1) Yes. I think is obscure then, (why it is read-only?) 2) No. In that case not only read-only status should be distributed to the components, but also modification status, and then also document (???, at least the read-only would have some unchangeable copy of the original one) , that sounds even more obscure now. Moreover I guess there is still needed the property for the env which will say that the object providing document is read-only (doesn't matter whether there are diff statuses of components or not). What do you think? reassigne to David K., new owner of editor I have changed version from 4.0 dev to S1S 4.2 (Nevada). ENHANCEMENT, not DEFECT, I think... Yes. *** Issue 35303 has been marked as a duplicate of this issue. *** See also issue 35303. The Delete, Paste and other modification actions cannot be disabled/enabled when readonly state has changed. Reassigning to new module owner mslama. Would still be useful, I think. Currently the most visible indication of r/o status, the special background, is hardcoded in org.netbeans.modules.editor.lib2.highlighting.ReadOnlyFilesHighlighting to check FileObject.canWrite, which prevents it from being used on non-file-backed editors. Would make sense for CES.Env to have an optional subinterface (to be implemented by DataEditorSupport.Env) checking read-only status. ReadOnlyFilesHighlighting would need to somehow get this information from the Document, I suppose via a documented Boolean-type property. Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/a031261a055d User: Jesse Glick <jglick@netbeans.org> Log: Removing unused package-private method (#25762 stub). |