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.
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)...
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.
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".
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.
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)