ponder-lab / Constants-to-Enum-Eclipse-Plugin

A research prototype Eclipse plugin that refactors Java legacy code to make use of the new enum program construct that was introduced in Java 5.
Eclipse Public License 1.0
3 stars 2 forks source link

Refactoring menu entry #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Add "Convert Constants To Enum" option in the refactoring menu.

Original issue reported on code.google.com by raffi.t.khatchadourian on 29 Jul 2009 at 2:44

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
There are also several places where the refactoring doesn't show up in the 
context menu. For example, while the 
refactoring shows up by right-clicking a field in the outline view, it does not 
show up by right-clicking the field 
in the editor.

Original comment by raffi.t.khatchadourian on 30 Jul 2009 at 3:51

GoogleCodeExporter commented 9 years ago
I found this error message in the error log. It could be helpful. Clearly, the 
problem pertains to metadata 
configured in the plugin.xml file.

Plug-in 'edu.ohio_state.khatchad.refactoring' contributed an invalid Menu 
Extension (Path: 
'org.eclipse.jdt.ui.refactoring.menu' is invalid): 
org.eclipse.refactoring.ConvertFieldsToEnum.action

Original comment by raffi.t.khatchadourian on 30 Jul 2009 at 3:53

GoogleCodeExporter commented 9 years ago
I suppose for now we can just run the refactoring from the outline view.

Original comment by raffi.t.khatchadourian on 30 Jul 2009 at 3:53

GoogleCodeExporter commented 9 years ago
Will care about this.

Original comment by b.muskalla@gmail.com on 25 Aug 2009 at 6:32

GoogleCodeExporter commented 9 years ago
Added menu item to all refactoring popup menus (eg, Package Explorer, Outline), 
added 
item to main Refactoring menu

Original comment by b.muskalla@gmail.com on 28 Aug 2009 at 12:44

GoogleCodeExporter commented 9 years ago
Thanks! Obviously, I haven't yet taken a look at this, but what happens when 
the refactoring is selected on, for 
example, a class? Are all fields from the class extracted and sent as input to 
the refactoring? Also, does right 
clicking a field in the editor show an option for the refactoring? Thanks again!

Original comment by raffi.t.khatchadourian on 28 Aug 2009 at 12:52

GoogleCodeExporter commented 9 years ago
Currently the refactoring is only active if you selection is a field.
We could think about adding classes as valid selection and take all the class 
fields 
into account. Would you open a bug for that?

Regarding the text selection: That's currently not yet possible as it requires 
a little 
more work in the handler activeWhen strategy. I opened issue 13 for this.

Original comment by b.muskalla@gmail.com on 28 Aug 2009 at 12:58

GoogleCodeExporter commented 9 years ago
Ah, sorry, I got confused with another issue. There is an open issue for this, 
its issue 4.

Original comment by raffi.t.khatchadourian on 28 Aug 2009 at 1:14