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 55484 - encapsulate fields usability issues
Summary: encapsulate fields usability issues
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: Macintosh Mac OS X
: P3 blocker with 1 vote (vote)
Assignee: Jan Becicka
URL:
Keywords:
: 50286 52044 53787 56272 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-24 13:38 UTC by Milos Kleint
Modified: 2005-09-05 10:11 UTC (History)
0 users

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 Milos Kleint 2005-02-24 13:38:02 UTC
using 23/2/2005 build.

I want to generate getters for fields in my new
class. I run Encapsulate Fields.. action from popup.

1. the tools offers me getters and setters for
"public static final int" constants -> definitely
an error.

2. I don't want to create setters so I try to
delete the setter column entries, however I'm not
allowed to complete the operation because the Next
button is disabled and I'm warned that the setters
has not a valid name. -> if not error, at least
usability problem.
Comment 1 Jan Becicka 2005-02-24 14:19:24 UTC
I definitely agree with 2) It is not possible to suppress creation of
getters or setters from ui. This should changed.

Current specification:

____|_Field_|__Getter__|__Setter__|
[x] | field | getField | setField |

New specification could be improved e.g. this way:
|_Field_|_____Getter___|____Setter____|
| field | [x] getField | [x] setField |

Ad 1) Creating getter for static final fields makes sense IMO. This
part of issue is duplicate of issue 38220.

Rudolfe, please take a look at it
Comment 2 Milos Kleint 2005-02-24 14:25:47 UTC
final static value should not have a setter at all, correct?
it can be set just once, and if already set in the definition, then
not at all.
Comment 3 Jan Becicka 2005-02-24 14:31:48 UTC
Yes setter method does not make sense. BTW setter method is not
created, isn't it?
Comment 4 Milos Kleint 2005-02-24 14:39:10 UTC
well, in the first panel it shows the setter, giving me an impression
it will be created.
however in the second panel with the tree, the setter is listed but
unselected.
Comment 5 Jan Becicka 2005-03-17 15:47:49 UTC
I fixed 2 issues:
1. If you set empty name for getter or setter - getter or setter is not created.
2. Setter is not created by default for final fields.

Anyway Encapsulate Field Panel should be improved for promo-F.

Checking in org/netbeans/modules/refactoring/EncapsulateFieldElement.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/EncapsulateFieldElement.java,v
 <--  EncapsulateFieldElement.java
new revision: 1.12; previous revision: 1.11
done
Checking in
org/netbeans/modules/refactoring/plugins/EncapsulateFieldRefactoringPlugin.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/plugins/EncapsulateFieldRefactoringPlugin.java,v
 <--  EncapsulateFieldRefactoringPlugin.java
new revision: 1.10; previous revision: 1.9
done
Checking in org/netbeans/modules/refactoring/ui/EncapsulateFieldUI.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/EncapsulateFieldUI.java,v
 <--  EncapsulateFieldUI.java
new revision: 1.12; previous revision: 1.11
done


Comment 6 Rudolf Bock 2005-03-17 17:39:39 UTC
Definitely, this dialog will get a new UI. There are must be possible create only getters or setters.
Comment 7 Martin Matula 2005-03-17 18:14:54 UTC
Reopening until it gets resolved completely (RESOLVED LATER should not be used).
Comment 8 Jan Becicka 2005-05-20 09:58:03 UTC
*** Issue 53787 has been marked as a duplicate of this issue. ***
Comment 9 Jan Becicka 2005-05-20 09:58:54 UTC
*** Issue 50286 has been marked as a duplicate of this issue. ***
Comment 10 Jan Becicka 2005-05-20 10:07:03 UTC
*** Issue 52044 has been marked as a duplicate of this issue. ***
Comment 11 Jan Becicka 2005-05-20 10:13:26 UTC
*** Issue 56272 has been marked as a duplicate of this issue. ***
Comment 12 Jan Becicka 2005-05-24 08:46:05 UTC
EncapsulateFieldPanel.form Bundle.properties (in directory
D:\sources\trunk\refactoring\src\org\netbeans\modules\refactoring\ui\)
Checking in EncapsulateFieldUI.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/EncapsulateFieldUI.java,v
 <--  EncapsulateFieldUI.java
new revision: 1.13; previous revision: 1.12
done
Checking in EncapsulateFieldPanel.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/EncapsulateFieldPanel.java,v
 <--  EncapsulateFieldPanel.java
new revision: 1.10; previous revision: 1.9
done
Checking in EncapsulateFieldPanel.form;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/EncapsulateFieldPanel.form,v
 <--  EncapsulateFieldPanel.form
new revision: 1.4; previous revision: 1.3
done
Checking in Bundle.properties;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/Bundle.properties,v 
<--  Bundle.properties
new revision: 1.52; previous revision: 1.51
done