Bug 37410 - [misc] Add better visual clue that an editor is read-only
Summary: [misc] Add better visual clue that an editor is read-only
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2003-05-08 17:05 EDT by Simon Archer CLA
Modified: 2007-06-22 10:04 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Archer CLA 2003-05-08 17:05:57 EDT
Currently if you open a class that is visible via a JAR on the classpath, along 
with its source, Eclipse will show you the source in the editor.  The editor 
even allows your to place the insertion-pointer in the text, but prevents you 
from editing the code.

The only clue you have that the editor is open on a .class file (before trying 
to edit the code) is that the .class extention in the editor's tab.  I'd like 
to see a more verbose visual-clue that the class open in the editor is read-
only.  For example, changing the editor's background color.
Comment 1 Tom Hofmann CLA 2003-05-09 10:22:35 EDT
The editor tab also shows the "binary" icon instead of the "Java" one, and 
there is a status item informing you that the file is "Read Only".
Comment 2 Simon Archer CLA 2003-05-09 10:36:40 EDT
Agreed, the icon does change, but it's not exactly obvious to the casual 
observer.  I don't see the status item (but I'm running 2.0.2 at the moment, 
sorry).

I would like to see something as verbose as changing the background color of 
the editor, so there's absolutely no mistaking it as read-only.

The reason I hit this case is that when I search the workspace, hits are found 
in .class files.  In my workspace I have a rather special case where I have the 
source in one project, and the .class files on the class path for another 
project (and I want it that way).  So of course I get double the hits, half of 
which are in the .class files, which I end up trying to edit!
Comment 3 lorenzo CLA 2003-11-01 06:52:01 EST
Hi,
the read-only message displayed in 3.0-M4 is very annoying.
If you simply type one more key (or ctrl+space, see bug 27959) you completly
loose the editor. To restore it you have to close and reopen.

I think a "beep" could be enough or maybe change the editor titlebar color.
Comment 4 Brett Kotch CLA 2003-11-02 10:56:03 EST
I must agree, the binary icon doesn't cry out that the file isn't editable. 
Perhaps a decorator on the icon denoting that it is locked is a step in the 
right direction? 
Comment 5 Dani Megert CLA 2003-11-03 04:41:23 EST
What's mentioned in comment #3 has been fixed (was bug 42230).
Comment 6 Dani Megert CLA 2006-02-09 06:52:45 EST

*** This bug has been marked as a duplicate of 10464 ***
Comment 7 Simon Archer CLA 2006-08-17 18:22:17 EDT
I have to re-open this one because I've just spent a good couple of hours trying to debug a problem that was caused by a binary version of a resource being used instead of a local resource.

I really think that files that are opened in the workspace, but are based on a binary read-only file should be visually obvious.  And I mean really obvious, such as having a different color background.

Of course this is not just a JDT problem; in fact the problem I was having today was related to a feature.xml.

Comment 8 Dani Megert CLA 2006-08-18 03:20:20 EDT
Looks to me like your problem is different because it really is of no relevance in your case (unless you manually set the binary files to read-only) whether the files are read-only. Note that files in binary projects - like the feature.xml  that caused you trouble - are not marked as read-only by PDE i.e. in the normal setup even with the best read-only indication in the world you would have not realized it ;-)

I would reather like to understand why you spent 2 hours to figure this out and why a feature.xml caused this. Pleae provide more details.
Comment 9 Simon Archer CLA 2006-08-18 08:46:00 EDT
The problem was not figuring out that the file was read-only, but rather that a read-only file was being selected as part of my PDE build, and being used instead of my local copy.  I'll admit that my case was a rather obscure one, but that's the sort of problem you need good visual clues.  It's when you make assumptions that you fall into a trap.

The problem manifested itself in a build failure, the source files of which, on visual inspection, seemed to be fine.  The only clue I had that my root feature was referring to a binary dependent feature.xml in my target was the fact that when I opened it I could not synch with the Package Explorer, which was curious since I knew I had that feature.xml locally.

The point here is that when I open a file in Eclipse it would help to know that it's coming from my local workspace rather than from somewhere on the classpath or runtime target.  Today the clues are there but you have to look carefully.  For example, when opening a binary feature.xml or a class file (with source attached), you can give the text editor focus, but it's only when you start trying to type (and find that you can't) is it obvious that the file is not local.

My goal here is to leave this issue open for considering, so RESOLVED/REMIND is fine for now.
Comment 10 Dani Megert CLA 2006-08-19 07:09:33 EDT
So, maybe also use the binary project decorator on files that come from a binary plug-in?
Comment 11 Dani Megert CLA 2007-06-22 09:59:46 EDT
Get rid of deprecated state.
Comment 12 Dani Megert CLA 2007-06-22 10:04:55 EDT
.