Bug 334819 - Allow to set access modifier (visibility) for Java elements
Summary: Allow to set access modifier (visibility) for Java elements
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-19 13:17 EST by Matt Whitlock CLA
Modified: 2011-01-20 08:54 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock CLA 2011-01-19 13:17:59 EST
Build Identifier: I20100909-0800

It would be very handy if the Java Outline view would have a context menu allowing the user to change the access modifiers of one or more class members in one shot.  For example, when only class members are selected in the Outline, the Refactor menu would have a submenu labeled "Set Access", which would cascade to another menu containing "public", "protected", "(default)", and "private", using Eclipse's symbols for those access levels as the menu item icons.  Choosing one of those modifiers would alter the source code with the appropriate access modifier keyword.  The context menu should be available for all class members (fields, methods, and member types) as well as for top-level types (with "private" excluded).

Reproducible: Always
Comment 1 Markus Keller CLA 2011-01-20 05:53:58 EST
A refactoring for this would be quite expensive, since we would have to check all references to all members to be sure that the the changed members are still visible and that we don't change semantics (e.g. changed shadowing / overloading / overriding).
Comment 2 Matt Whitlock CLA 2011-01-20 08:54:15 EST
Cheaper than moving elements to another class, and there's a refactoring for that.