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.

Bug 226978 - Fold SPI to integrate with NB Editor UI
Summary: Fold SPI to integrate with NB Editor UI
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2013-03-04 12:13 UTC by Svata Dedic
Modified: 2013-03-13 02:10 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed SPI (9.94 KB, patch)
2013-03-04 12:13 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2013-03-04 12:13:00 UTC
Created attachment 132148 [details]
Proposed SPI

During discussions following issue #226368, it was decided to split editor.fold into two modules to reduce dependencies of Fold API clients to the deprecated editor.lib. 

Because of that separation, a hook is needed to attach handlers to UI components; formerly this would be done in the FoldHierarchyExecution, but that class should remain independent of editor.lib dependencies now. Currently it is not possible to observe that folding (or an editor) was initialized for a JTextComponent, except hooking using "doc-install-action-name-list" preference key, which seems as inappropriate for this initialization API.

As a minimal change the FoldHierarchyMonitor SPI will be introduced (see the attached diff). It allows to "ping" implementations of UI that a FoldHierarchy was created and - depending on future observations of the performance - when the 1st FoldManager registers for the hierarchy. 
The UI (e.g. BaseCaret bridge) can then hook to UI (folding changes and caret movement) and mediate the processing.
Comment 1 Svata Dedic 2013-03-08 17:24:20 UTC
Changeset: 0d6c8d4a4534
Author:    Svata Dedic <sdedic@netbeans.org>
Date:      2013-03-08 18:24
Message:   Added hook to initialize on fold hierarchy creation.
Comment 2 Quality Engineering 2013-03-13 02:10:06 UTC
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/0d6c8d4a4534
User: Svata Dedic <sdedic@netbeans.org>
Log: Issue #226978 - Fold SPI to integrate with NB Editor UI: fixed
Added hook to initialize on fold hierarchy creation.