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 17130 - Allow Convert to Text on read only files if no actual changes to the file are needed
Summary: Allow Convert to Text on read only files if no actual changes to the file are...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
: 17210 (view as bug list)
Depends on: 11334
Blocks:
  Show dependency tree
 
Reported: 2001-10-30 14:29 UTC by ats37
Modified: 2002-06-14 17:58 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ats37 2001-10-30 14:29:06 UTC
I'm using 3.3 beta 1 with JDK 1.3.1_01 on Windows NT.

I have a couple of files with unknown file extensions (.idl & .j) in a mounted 
file system which (because it's a version-controller filesystem and they're not 
checked out) are read only.  When I double-click on them nothing happens, and 
the right-click menu option "Convert to Text" is greyed out.  This means I am 
unable to view the files.

If I make them read-write by checking them out, the Convert to Text option 
becomes available, and I am then able to open them.  Comparing the file to the 
previous version, however, shows no differences.  Since they're identical, the 
Convert to Text option obviously didn't need to write to the file itself, it 
just updated the corresponding .nbattrs entry.  If I then undo the checkout, 
making the file read-only again, I am still able to open the file (read only) 
in the editor subsequently.

It would be nice if I could have done this without having to mess around with 
checking out the file and undoing the checkout afterwards i.e. even if a file 
is read only, perhaps Netbeans could still allow the convert to text option if 
that can be done by just updating .nbattrs?
Comment 1 Jan Zajicek 2001-10-30 14:46:31 UTC
Passing to Yarda to comment this - architect. issue. BTW now this
isn't possible due to writting into nbattrs files and when the file is
read we cannot do this change. Maybe that this can be somehow handled
by the owner of this action - the text module.
Comment 2 ats37 2001-10-30 18:06:56 UTC
>BTW now this isn't possible due to writting into nbattrs 
>files and when the file is read we cannot do this change.

I'm not sure I understand what you mean - there's no problem with it 
writing to the .nbattrs file, since that's not under source control 
and so is read-write all the time.  It's the versioned (.idl & .j) 
files that are the problem, as Clearcase makes them read-only unless 
I have them checked out.  They don't get altered at all by the 
Convert to Text process (they're already text files, just not with a 
recognised file extension), but because they're RO Netbeans won't let 
me select the option.
Comment 3 Jan Zajicek 2001-10-31 09:51:17 UTC
You are right.

One quick solution is to go to the Tools, Options, IDE Configuration,
System, Object Types, Textual Objects node and change its Extensions
property to contain the 'idl' and 'j' extensions. From this change
will the ide recognize these files as text files.
Comment 4 Jaroslav Tulach 2001-11-01 10:38:34 UTC
Jan is right the problem is with .nbattr and the way how the access to
them is implemented. 

I think that the easiest solution would be to put another support
action to text module that would allow to open editor window over a
foreign data object. Thus no writing to .nbattrs would be necessary.

Comment 5 Jan Zajicek 2001-11-05 09:10:20 UTC
*** Issue 17210 has been marked as a duplicate of this issue. ***
Comment 6 Dennis Daniels 2001-11-14 10:30:45 UTC
taking beans from the BDK requires users to modify the read only text 
in the manifest...converting manifest from read only to read/write 
would be a great step forward
Comment 7 Jan Chalupa 2001-11-27 17:03:36 UTC
Target milestone -> 3.3.1.
Comment 8 Jesse Glick 2002-05-31 05:22:38 UTC
Does issue #11334 help here?
Comment 9 Miloslav Metelka 2002-05-31 16:46:49 UTC
I have uncommented additional checks for read-onliness in the
ConvertToTextAction and it appears that it works. I'll continue on
Monday and close the bug.
Comment 10 Miloslav Metelka 2002-06-14 17:58:11 UTC
Fixed.

Checking in src/org/netbeans/modules/text/ConvertToDefaultAction.java;
/cvs/text/src/org/netbeans/modules/text/ConvertToDefaultAction.java,v
 <--  ConvertToDefaultAction.java
new revision: 1.3; previous revision: 1.2
done
Checking in src/org/netbeans/modules/text/ConvertToTextAction.java;
/cvs/text/src/org/netbeans/modules/text/ConvertToTextAction.java,v 
<--  ConvertToTextAction.java
new revision: 1.9; previous revision: 1.8
done