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 157518 - Caret jumps to EOF when properties file saved
Summary: Caret jumps to EOF when properties file saved
Status: VERIFIED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Properties (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Alexey Butenko
URL:
Keywords:
: 158322 158695 159474 160189 161689 162247 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-27 22:44 UTC by Jesse Glick
Modified: 2009-07-16 02:35 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-01-27 22:44:59 UTC
090127, JDK 6u11. In recent builds I have noticed that whenever a *.properties file is saved (or modified on disk and
reloaded), the caret jumps to the end of the buffer. Minor but a frequent irritation.
Comment 1 Alexey Butenko 2009-02-11 06:45:10 UTC
*** Issue 158322 has been marked as a duplicate of this issue. ***
Comment 2 Alexey Butenko 2009-02-18 08:17:38 UTC
*** Issue 158695 has been marked as a duplicate of this issue. ***
Comment 3 Michel Graciano 2009-02-18 13:39:59 UTC
Same behaviour for 6.5 withh all patches applied.

Regards
Comment 4 dkittle 2009-02-27 20:20:06 UTC
This is still in NB 6.7M2...
Comment 5 Andrei Chistiakov 2009-03-03 10:43:17 UTC
*** Issue 159474 has been marked as a duplicate of this issue. ***
Comment 6 Alexey Butenko 2009-03-12 15:55:51 UTC
*** Issue 160189 has been marked as a duplicate of this issue. ***
Comment 7 mslama 2009-03-13 12:46:43 UTC
I found where problem is: PropertiesEditorSupport adds 2 file change listeners EnvironmentListener to property file.
Result is that code in CloneableEditorSupport is confused and sets incorrect caret position after reload. I fixed this
problem in CloneableEditorSupport but still due to 2 events document is reloaded 2 times. So please create and add only
one file change listener. 

Probably caused by copying code from DataEditorSupport. One registration is at Environment constructor and second one at
Environment.changeFile. First one can probably be removed but make sure there is then always at least one file change
listener.

For CloneableEditorSupport I filed issue #160252.
Comment 8 mslama 2009-03-13 14:10:03 UTC
I fixed issue #160252 so cursor will stay now at correct place when file is saved. Still there are 2 file change
listeners in PropertiesEditorSupport so please fix it.
Comment 9 Jesse Glick 2009-03-13 16:27:20 UTC
I thought part of the point of fixing the weird loaders usage in the properties module was to simplify the code so that
bugs like this would vanish. Yet I see that there is still a special FileEntry subclass, a special editor support rather
than the standard DataEditorSupport, etc. It is likely that all of this junk can simply be deleted. Then the
*.properties data object would just be a pretty generic data object with only two features of note:

1. A DataNode with children showing keys, refreshing with live document edits, maybe permitting edits from the nodes
themselves. Not trivial, but straightforward.

2. An OpenCookie which shows a grid that can load related *.properties from the same folder (or more generally from the
ClassPath.EXECUTE, in case localizations are kept in separate source trees or even separate projects). Pure GUI, no
special support needed from the loaders layer.
Comment 10 Alexey Butenko 2009-03-17 12:21:52 UTC
Agree, but it was also certain request for certain feature. And I was thinking about how to make it, but probably at some point forgot about simplifying the 
code. So anyway it is a subject of separate issue.

This issue is fixed by changeset 78b556301c25
Comment 11 Alexey Butenko 2009-04-02 07:34:04 UTC
*** Issue 161689 has been marked as a duplicate of this issue. ***
Comment 12 Michel Graciano 2009-04-02 13:41:16 UTC
Please consider include it in the next 6.5 patch. Really annoying issue.

Regards
Comment 13 pgebauer 2009-04-08 14:16:26 UTC
The status whiteboard "65fixes4-candidate" has been removed.
At this time our proactive patches for the NetBeans 6.5.x IDE have concluded.

If you own a Sun service plan contract for NetBeans, you may wish to contact
Sun Service http://www.sun.com/contact/support.jsp to request a fix via the
product defect escalation process.

For more information on purchasing a Sun service plan contract for NetBeans,
refer to the service plan item "Sun Software Service Plans (S3P) for Developers"
in the Sun Service table found on our NetBeans Support Resources
page http://www.netbeans.org/kb/support.html
Comment 14 Michel Graciano 2009-07-16 02:34:55 UTC
v.
Comment 15 Michel Graciano 2009-07-16 02:35:35 UTC
*** Issue 162247 has been marked as a duplicate of this issue. ***