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 180106 - need public action to clear Line.ShowOpenType.REUSE effect
Summary: need public action to clear Line.ShowOpenType.REUSE effect
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-01 10:39 UTC by err
Modified: 2010-04-20 20:05 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
prototype implementation as source zip (15.99 KB, application/octet-stream)
2010-04-10 03:41 UTC, err
Details
1.3 plugin source (15.26 KB, application/octet-stream)
2010-04-20 20:05 UTC, err
Details

Note You need to log in before you can comment on or make changes to this bug.
Description err 2010-02-01 10:39:28 UTC
I would like to reset the reuse flag without modifying the open file. (in some cases that is even impossible since file is read-only). I was thinking of putting together a patch, but the "lastReusable" flag is buried deep in CloneableEditorSupport and I have no idea where to begin.

BTW, putting a "Pin" button on editor tab of the active reusable editor window would be cool (like the Pin button on an IO-tab).

I would normally have started this with Editor product, but since o.openide.text is the starting point (bottom up)...
Comment 1 err 2010-02-02 08:22:08 UTC
In case it wasn't clear, all I'm looking for is an Action to which I can bind a keystroke. So I don't think this requires a public API change.

With guidance, I might be able to put together a patch.

The UI stuff is just blue sky and wishful thinking.
Comment 2 err 2010-04-10 03:41:58 UTC
Created attachment 97003 [details]
prototype implementation as source zip

Here's an implementation that uses reflection. The action is enabled when the active TopComponent is "reusable".
Comment 3 err 2010-04-20 19:51:39 UTC
Plugin Description
In some situation the IDE/platform opens a file with the REUSE flag (see NetBeans API doc Line.ShowOpenType); files opened like this can be automatically replaced in an editor window by other files. This plugin provides a registered action, toolbar button and menu actions which can clear the REUSE flag; this prevents a file from being replaced.  The toolbar button, which looks like a "push pin", provides a visual indication that the currently active editor is REUSEable; the button is only enabled when the active editor is REUSEable.  IDE REUSE examples: single stepping into a file, clicking on a stacktrace for goto source, jVi tag-stack operations.
Comment 4 err 2010-04-20 20:05:39 UTC
Created attachment 97746 [details]
1.3 plugin source

Cleanup the enable logic, nicer pin png.
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=27787
(hope its ok to stash the source here)