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: | API between code folding and BaseCaret | ||
---|---|---|---|
Product: | editor | Reporter: | Svata Dedic <sdedic> |
Component: | Painting & Printing | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | API, API_REVIEW_FAST |
Priority: | P2 | ||
Version: | 7.4 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 226413 | ||
Attachments: |
Proposed changes
Y01 implemented, added necessary portion of refactored classes |
Description
Svata Dedic
2013-02-19 22:13:47 UTC
Created attachment 131587 [details]
Proposed changes
Y01 A test could ensure the Callable is really provided by the editor and it behaves as expected. Created attachment 131926 [details]
Y01 implemented, added necessary portion of refactored classes
Y01: testcase added, checked actual effect of fold-provided Callable.
Note: since dependencies changed (actually reversed between editor.fold and editor.lib), I had to provide refactored classes (moved from editor.lib to editor.fold) as part of the diff, so the code is compilable after patching.
See issue #226413 for the scope of the refactoring.
Implemented in http://hg.netbeans.org/jet-main/rev/c1b657407e68 Integrated into 'main-golden', will be available in build *201303122300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/c1b657407e68 User: Svata Dedic <sdedic@netbeans.org> Log: #226413, #226368: Folds UI separated to a new module. editor.lib partially cleaned up from folding code. The patch Y01 deprecates CodeFoldingSideBar with the following comment:
> You should use {@link FoldUtilities#createSidebarComponent(javax.swing.text.JTextComponent)} or {@link FoldUtilities#getFoldingSidebarFactory()} instead. Subclassing CodeFoldingSidebar is no longer actively supported, though still working.
Unfortunately the described methods do not exist. Based on the change to java.editor/src/org/netbeans/modules/java/editor/resources/layer.xml in commit c1b657407e68, it appears that in most cases the factory class used to create the sidebar component is simply no longer required. Removing my factory class and its registration in the layer.xml for my module left my code folding feature intact and removed the usage of deprecated API.
Yes, sorry. I updated the linked Wiki page; since it was possible to register folding sidebar for all editors, and only display it when actually a foldmanager exists, the API becomes unnecessary - until of course someone requests more finer control over the sidebar construction. |