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 31102 - inconsistent behavior in popup menu for generating R/W property for field
Summary: inconsistent behavior in popup menu for generating R/W property for field
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-16 15:20 UTC by miks
Modified: 2007-09-26 09:14 UTC (History)
0 users

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 miks 2003-02-16 15:20:33 UTC
The Editor doesn't behave the same when a class member is 
highlighted and not.
_When the member variable is NOT highlighted then the 
editor (while pressing the right mouse button) will 
display a menu with the possibility to "Generate R/W 
property for field" (in tool sub menu)

_When the member variable is highlighted then the editor 
(while pressing the right mouse button) will NOT display 
the possibility to "Generate R/W property for field" in 
the menu.
Comment 1 Marian Mirilovic 2003-02-17 17:09:04 UTC
I don't know where is a problem, so reassigne to java for 
investigation ....
Comment 2 Tomas Hurka 2003-02-18 11:02:32 UTC
I am sorry I cannot reproduce it. It works for me. Please add steps how to reproduce it. Thanks.
Comment 3 Jan Becicka 2003-02-18 11:29:00 UTC
It is pretty simple to reproduce it. But I'm not sure if this behavior
is not as designed.

If you textually select the field in the editor, yu are not able to
generate R/W property.

Comment 4 miks 2003-02-18 20:56:32 UTC
I don't think that this is the right behavior to not 
enable the creation of the properties when a field is 
highlighted, since usually when you want to perform an 
action on something then you always select it by double 
clicking in it, then you use a contextual menu for the 
action.
Getting a contextual menu for 'generating R/W properties' 
when the field is not selected, is less intuitive.
 
By the way, if the field is marked 'static' or 'final' 
then highlighted or not the menu will not permit the 
creation of R/W property that is not the right behavior 
also.

I think that the behavior should be:
1. If the field is marked 'final' then it should not be 
possible to generate Write property for field but the Read 
should be permitted.
2. If the field is marked is NOT marked final then R/W 
properties should be enable.

A new sub menu should be redisigned to permit 3 operations:
1. generate R/W (desabled - if field is marked final) 
2. generate R
3. generate W (desabled - if field is marked final)

Therefore the following is the schematic contextual menu:
--> Tool 
   --> Generate R/W properties 
      --> Generate R/W
          Generate R
          Generate W
Comment 5 Svata Dedic 2003-02-27 16:36:02 UTC
It's seems as the famous +- 1 problem: when the caret is between last 
char of the field's name and the end-decl semicolon, the IDE evaluates 
the position as outside of the field decl ;-) (obviously exactly that 
happens if you doubleclick the name to select it). 
 
Comment 6 Svata Dedic 2003-02-27 17:23:50 UTC
OK, corrected sharp "more than" to "more or equals" and voila. 
 
Fixed in trunk: 
/cvs/java/src/org/netbeans/modules/java/JavaParserGlue.java,v  <--  
JavaParserGlue.java 
new revision: 1.40; previous revision: 1.39 
 
Comment 7 Jan Becicka 2003-04-01 08:30:44 UTC
VERIFIED
Comment 8 Quality Engineering 2007-09-20 10:59:02 UTC
Reorganization of java component