I'm using the abbreviation 'itst' for Iterate String Tokens.

Here's the template:

StringTokenizer $TOKENIZER$ = new StringTokenizer($STRING$);
while ($TOKENIZER_COPY$.hasMoreTokens()) {
    String $VAR$ = $TOKENIZER_COPY$.nextToken();
    $END$
}

Where variables look like this:

    TOKENIZER       suggestVariableName()               "tokenizer"
    STRING          variableOfType("java.lang.String")
    VAR             suggestVariableName()               "token"
    TOKENIZER_COPY  TOKENIZER
<tick>

Gives code that looks like:

    StringTokenizer tokenizer = new StringTokenizer(myString);
    while (tokenizer.hasMoreTokens()) {
        String token = tokenizer.nextToken();
        |
    }

Make sure you tick 'Reformat code according to style'.

Additionally, there should be some sort of message in the
live-template-creation window to let users know then can 'Right-click for
available methods'... this isn't obvious!

Drew Noakes

ThoughtWorks, Inc. UK
[EMAIL PROTECTED]
07941.725.355



_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features

Reply via email to