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 220252

Summary: All editable actions on file and file content should be disabled on read only file.
Product: editor Reporter: hantsy <hantsy>
Component: Actions/Menu/ToolbarAssignee: Svata Dedic <sdedic>
Status: RESOLVED WONTFIX    
Severity: normal CC: bmramba, sdedic, vriha
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 222212    
Bug Blocks:    
Attachments: stacktrace

Description hantsy 2012-10-17 08:35:15 UTC
I opened a class file from jar, NetBeans generated a temp read only source file for it.

But I think all editable actions(in Menu, context, editor toolar) should be disabled.

Such as delete, comments/uncomment, refactor, code generating.
Comment 1 Svata Dedic 2013-07-16 06:42:05 UTC
The same for a source from a JAR, i.e. Go To type j.l.String.
Comment 2 Svata Dedic 2013-07-16 11:02:29 UTC
It seems that the action registration lack the ability to declare whether the action should be enabled or not depending on writability. The paste action solved as issue #222935 is handled by a special case in EditorUI.

I think the enhancement described in issue #222212 need to be extended: the action should be able to specify writability constraints. Each of the actions could eventually monitor EditorRegistry and track the focused editor and its caret; this would add a burden to editor action writers.

*** This bug has been marked as a duplicate of bug 222212 ***
Comment 3 Svata Dedic 2013-07-18 06:19:19 UTC
*** Bug 232486 has been marked as a duplicate of this bug. ***
Comment 4 Svata Dedic 2013-07-18 06:20:30 UTC
Reopening; keeping this open and dependent on the API issue is more proper for progress tracking
Comment 5 bmramba 2013-09-13 09:11:58 UTC
Created attachment 140025 [details]
stacktrace

During editing, on pressing TAB key, this error is generated.
Comment 6 Martin Balin 2015-09-17 10:59:46 UTC
Report from old NetBeans version. Due to code changes since it was reported likely to not happen. Feel free to reopen if happens in 8.0.2 or 8.1.