Introduce field from method-parameters

Hi,

I´m implementing the interface LoginModule with the method

public void initialize( Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options )

I want now to create the fields
private Subject subject;
private CallbackHandler callbackHandler;


and the default-assignments in the method-body. Can IDEA help me?

3 comments

On Wed, 29 Oct 2003 21:46:21 +0000 (UTC), Johannes Schneider
<idea@johannes-schneider.info> wrote:

Hi,

>

I´m implementing the interface LoginModule with the method

>

public void initialize( Subject subject, CallbackHandler
callbackHandler, Map sharedState, Map options )

>

I want now to create the fields
private Subject subject;
private CallbackHandler callbackHandler;

>

and the default-assignments in the method-body. Can IDEA help me?


Right now no. But you can rename initialize as a constructor, use
intention "Create field for Parameter" and rename it
back to initialize. (Rename in the old way, not refactor it)

Isn't perfect but it works

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

0

Johannes Schneider wrote:

Hi,

I´m implementing the interface LoginModule with the method

public void initialize( Subject subject, CallbackHandler callbackHandler,
Map sharedState, Map options )

I want now to create the fields
private Subject subject;
private CallbackHandler callbackHandler;


and the default-assignments in the method-body. Can IDEA help me?


Yes indeed. Type 'subject' in the method body and press CtrlAltF.
Ditto for others.

Friendly,
Dmitry
--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Dmitry Lomov (JetBrains) wrote:

Johannes Schneider wrote:

>>I´m implementing the interface LoginModule with the method
>>
>>public void initialize( Subject subject, CallbackHandler callbackHandler,
>>Map sharedState, Map options )
>>
>>I want now to create the fields
>>private Subject subject;
>>private CallbackHandler callbackHandler;
>>[...]
>>
>>and the default-assignments in the method-body. Can IDEA help me?


Yes indeed. Type 'subject' in the method body and press CtrlAltF.
Ditto for others.


I've always wondered why I couldn't use CtrlAltF directly on the
parameter? Is it a matter of where to place the assignment statement?

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0

Please sign in to leave a comment.