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 34812 - Treat as Text is unusable
Summary: Treat as Text is unusable
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ tboudreau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-09 09:41 UTC by Pavel Buzek
Modified: 2004-08-13 12:11 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
changes made (6.07 KB, patch)
2004-04-26 18:59 UTC, _ tboudreau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2003-07-09 09:41:37 UTC
The action changes the file's extension. There is
no way to view/edit an existing file with unknown
extension in a text editor in netbeans without
first changing its ext.
Comment 1 mslama 2003-08-19 15:22:59 UTC
Please could you provide me with more info? Where is this action
(Convert to Text) available?
Comment 2 Pavel Buzek 2003-08-29 12:43:36 UTC
Sorry I putted in wrong name, the label on action is Treat as Text. It
is available on node of default data object, I believe.
Comment 3 mslama 2004-04-19 15:05:14 UTC
Assigning to Tim
Comment 4 _ tboudreau 2004-04-26 18:58:23 UTC
Adding Jesse to cc, since I remember him saying something about some plans for this, 
something involving a hex editor, and it's his code.

Since the behaviour was a little strange (typically you want to treat it as text because you 
want to open it, so making it a two step operation seems pretty unnecessary), I've done 
the following:

 - Treat as Text > Open as Text
 - Convert to Default > Stop Treating as Text
 - No confirmation dialog on treat as text action
 - Confirmation dialog on Stop treating as Text only if the file is open
 - ConvertToTextAction will now try to open the file if, after doing the change, it has an 
OpenCookie (the open attempt is invokeLatered to get it out of the way of any 
machinations that might be going on in the meantime).

I'll attach the diff.
Comment 5 _ tboudreau 2004-04-26 18:59:20 UTC
Created attachment 14562 [details]
changes made
Comment 6 Jesse Glick 2004-04-26 20:11:34 UTC
I think what we actually wanted to do was kill this action (and maybe
the whole text module) altogether, and just add an Edit cookie
directly to DefaultDataObject. If it's a binary file, obviously
editing it as text won't be very useful, but nothing ought to *break*
as a result of trying.

This patch is definitely an improvement, though (based on your
description - did not read code patch).