Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » refactoring a group of constants in enum
refactoring a group of constants in enum [message #259387] Tue, 07 April 2009 08:57 Go to next message
Eclipse UserFriend
Hi

Is there a refactoring option to select a group of constants and choose to
move them in a new enum type?

something like:

static final String FOO = "foo";
static final String BAR = "bar";

|
v

enum NewEnum { foo, bar }; (or enum NewEnum {FOO("foo"), BAR("bar") .....
}; - an option to keep constant name)


and the uses of constants would be refactored in
NewEnum.foo.name()
Re: refactoring a group of constants in enum [message #259391 is a reply to message #259387] Tue, 07 April 2009 10:18 Go to previous message
Eclipse UserFriend
Hi,

There is at least a proposal for google summer of code 2009 : http://wiki.eclipse.org/Convert_constants_to_enum

Regards,

Mariot

Diana a écrit :
> Hi
>
> Is there a refactoring option to select a group of constants and choose
> to move them in a new enum type?
>
> something like:
>
> static final String FOO = "foo";
> static final String BAR = "bar";
>
> |
> v
>
> enum NewEnum { foo, bar }; (or enum NewEnum {FOO("foo"), BAR("bar")
> ..... }; - an option to keep constant name)
>
>
> and the uses of constants would be refactored in
> NewEnum.foo.name()
>
Previous Topic:Increase the Eclipse content assist size
Next Topic:RefactoringUI should be able to be subclassed?
Goto Forum:
  


Current Time: Thu Apr 17 21:51:03 EDT 2025

Powered by FUDForum. Page generated in 1.23901 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top