introduce constant during extraction of strings

Hello!

In my code I have multiple strings with same value like "agent_name" or
"supplier_birht_date" ... I would like to create String constants like
AGENT_NAME = "agent_name", SUPPLIER_BIRTH_DATE = "supplier_birth_date"
and replace all occurences...

Right now I forced to use "Introduce constant..." and retype AGENT_NAME
instead of default STRING.

Build #816.

Questions are:

Is it possible that default STRING will be replaced with content of the
string constant? (+ upper cased if possible)

Is it possible to have shortcuts working in the "Introduce constant"
dialog? (the Ctrl-Shift-U for example)

Is it possible to get batch refactroring like "Extract string constants"
... I have some impression that it already was available in early
Ariadna eap builds, but now I can not find it.

wbr, iit.


2 comments
Comment actions Permalink

Is it possible that default STRING will be replaced with content of the
string constant? (+ upper cased if possible)


That's quite discussible...

>

Is it possible to have shortcuts working in the "Introduce constant"
dialog? (the Ctrl-Shift-U for example)

>

The negative side is that none will know it.

Is it possible to get batch refactroring like "Extract string constants"
... I have some impression that it already was available in early
Ariadna eap builds, but now I can not find it.


AFAIK we never had such functionality.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"


"Ilja Teterin" <iit@atbusiness.com> wrote in message
news:bav6no$a8i$1@is.intellij.net...

Hello!

>

In my code I have multiple strings with same value like "agent_name" or
"supplier_birht_date" ... I would like to create String constants like
AGENT_NAME = "agent_name", SUPPLIER_BIRTH_DATE = "supplier_birth_date"
and replace all occurences...

>

Right now I forced to use "Introduce constant..." and retype AGENT_NAME
instead of default STRING.

>

Build #816.

>

Questions are:

>

Is it possible that default STRING will be replaced with content of the
string constant? (+ upper cased if possible)

>

Is it possible to have shortcuts working in the "Introduce constant"
dialog? (the Ctrl-Shift-U for example)

>

Is it possible to get batch refactroring like "Extract string constants"
... I have some impression that it already was available in early
Ariadna eap builds, but now I can not find it.

>

wbr, iit.

>


0
Comment actions Permalink


Valentin Kipiatkov wrote:
>>Is it possible that default STRING will be replaced with content of the
>>string constant? (+ upper cased if possible)

That's quite discussible...

Hope community will join to discussion.

At least as "additional" option to default STRING (you have dropdown
there already).

my code (heritage of devels (c) 1999 ) looks like

..
a_map.put("agent_name", xxxx);
a_map.put("agent_phone", xxxx1);
process(a_map);
...
x = a_map.get("agent_name");
y = a_map.get("agent_phone");
...
etc ...

>>Is it possible to have shortcuts working in the "Introduce constant"
>>dialog? (the Ctrl-Shift-U for example)

The negative side is that none will know it.

You will announce it - and we will use it ...

btw: where I can get an official printable default short-cuts table :) ?
Like the one created by the rolf.lohaus@epost.de?

>>Is it possible to get batch refactroring like "Extract string constants"
>>... I have some impression that it already was available in early
>>Ariadna eap builds, but now I can not find it.

AFAIK we never had such functionality.


Looks like I am idealizing the IDEA :).

Have you ever had functionality to "invert" logical expressions:

if( a ) {
x;
} else {
y;
}

into

if ( !a ) {
y;
} else {
x;
}

and my favourite:

if ( someField.equals ("Y")) ....

into

if ( "Y".equals(someField)) ...

wbr, iit.


0

Please sign in to leave a comment.