javauis/tsrc/fute/lcdui/Midp_StringItem_01/src/FormStringItemTests.java
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 27 May 2010 12:49:31 +0300
changeset 26 dc7c549001d5
child 56 abc41079b313
permissions -rw-r--r--
Revision: v2.1.26 Kit: 2010121
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
/**
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
 * import midp classes.
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
 */
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
import javax.microedition.midlet.*;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
import javax.microedition.lcdui.*;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
/**
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
 * This class is to test all the StringItem tests
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
 */
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
public class FormStringItemTests extends Form implements CommandListener, ItemCommandListener
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
{
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
    //referemce to the parent MIDlet
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
    private Midp_StringItem_01 m = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
    //the form to add the StringItems
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
    private Form stringItemForm = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
    //the label to create the StringItem
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
    private TextField label = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
    //the text to create the StringItem
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
    private TextField text = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
    //the text to create the StringItem
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
    private TextField width = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
    //the text to create the StringItem
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
    private TextField height = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
    //the StringItem to test
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
    private StringItem si = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
    private ChoiceGroup cg = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
    private String[] cgTypes = {"LAYOUT_DEFAULT","LAYOUT_LEFT","LAYOUT_RIGHT","LAYOUT_CENTER","LAYOUT_TOP","LAYOUT_BOTTOM",
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
                                "LAYOUT_VCENTER","LAYOUT_NEWLINE_BEFORE","LAYOUT_NEWLINE_AFTER","LAYOUT_SHRINK","LAYOUT_VSHRINK",
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
                                "LAYOUT_EXPAND","LAYOUT_VEXPAND"
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
                               };
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
    //the command to go back to the main screen
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
    private Command cmdBack = new Command("Back", Command.BACK, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
    //the command to create the StringItem with the entered label and text
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
    private Command cmdCreate = new Command("Create", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
    //the command to create the StringItem with the entered label and text and with focus
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
    private Command cmdCreateHL = new Command("Create as Hyperlink", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
    //the command to create the StringItem with the entered label and text and with focus
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
    private Command cmdCreateButton = new Command("Create as Button", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
    //the command to unlock the Item
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
    private Command cmdUnlock = new Command("Unlock", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
    //the command for the item
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
    private Command cmdItem = new Command("Item cmd", Command.ITEM, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
    //the command to remove/restore the item command or the first item
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
    private Command cmdRemoveCommand = new Command("Remove command", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
    private Command cmdRestoreCommand = new Command("Restore command", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
    private Command cmdRemoveItem = new Command("Remove first item", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
    //Command for adding the itemcommandlisteners for the stringitems in layout tests
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
    private Command cmdAddListeners = new Command("Add listeners", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
    //the command for layout test
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
    private Command cmdLayout = new Command("Layout Test", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
    //the command for layout test
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
    private Command cmdLayoutButton = new Command("Layout Button Test", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
    //the command for layout test
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
    private Command cmdLayoutHL = new Command("Layout Hyperlink Test", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
    //the command for layout test
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
    private Command cmdVLayout = new Command("Vertical Layout Test", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
    //the command for layout test
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
    private Command cmdVLayoutHL = new Command("Vertical Layout Hyperlink Test", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
    //the command for layout test
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
    private Command cmdVLayoutButton = new Command("Vertical Layout Button Test", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
    //the command for adding a StringItem with long text
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
    private Command cmdLongText = new Command("Long text layout test", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
    private Command cmdNext = new Command("Next", Command.SCREEN, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
    private Command cmdExit = new Command("Exit", Command.EXIT, 1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
    static int change = -1;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
    public FormStringItemTests(Midp_StringItem_01 m)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
    {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
        //set the name of the form to be the name of MIDlet
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
        super(m.getClass().getName());
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
        this.m = m;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
        //create TextFields
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
        label = new TextField("Label:", null, 200, TextField.ANY);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
        text = new TextField("Text:", null, 200, TextField.ANY);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
        width = new TextField("Set preferred width:", null, 5, TextField.NUMERIC);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
        height = new TextField("Set preferred height:", null, 5, TextField.NUMERIC);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
        cg = new ChoiceGroup("Layout:",ChoiceGroup.EXCLUSIVE,cgTypes,null);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
        append(label);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
        append(text);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
        append(width);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
        append(height);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
        append(cg);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
        addCommand(cmdCreate);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
        addCommand(cmdCreateHL);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
        addCommand(cmdCreateButton);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
        addCommand(cmdLayout);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
        addCommand(cmdLayoutHL);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
        addCommand(cmdLayoutButton);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
        addCommand(cmdVLayout);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
        addCommand(cmdVLayoutHL);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
        addCommand(cmdVLayoutButton);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
        addCommand(cmdLongText);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
        addCommand(cmdExit);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
        setCommandListener(this);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
        Display.getDisplay(m).setCurrent(this);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
        //create StringItemForm
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
        stringItemForm = new Form("StringItem");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
        stringItemForm.addCommand(cmdBack);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
        stringItemForm.setCommandListener(this);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
    }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
    /**
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
     *  This method handles command invocations.
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
     *
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
     *@param  c  This is the command responsible for the event.
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
     *@param  s  Should be equal to this.
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
     */
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
    public void commandAction(Command c, Displayable s)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
    {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
        if (c == cmdBack)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
            label.setString(null);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
            text.setString(null);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
            Display.getDisplay(m).setCurrent(this);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
        else if (c == cmdLongText)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
            String longString = "This is a really long string. Check that you can successfully" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
                                " read the last line (congratulations).\n" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
                                "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
                                " tempor nisl in quam aliquet eu posuere eros tempor. Vivamus felis" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
                                " urna, hendrerit id fringilla eu, feugiat blandit tellus. Curabitur" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
                                " scelerisque tempus ante, eu convallis ligula ultrices nec. Nullam" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
                                " vulputate aliquet ullamcorper. Lorem ipsum dolor sit amet," +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
                                " consectetur adipiscing elit. Proin at odio vel urna luctus dignissim" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
                                " a quis urna. Lorem ipsum dolor sit amet, consectetur adipiscing elit." +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
                                " Phasellus aliquet luctus eros vitae aliquam. Suspendisse ut magna a" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
                                " ipsum fermentum imperdiet. Maecenas eu nunc sed metus placerat" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
                                " adipiscing. Duis lacus lacus, vestibulum id vestibulum a, tempus at" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
                                " nulla. Proin sagittis nibh vitae dui interdum varius. Cras purus" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
                                " nulla, lobortis eu laoreet a, ultricies vitae sem. Integer aliquam" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
                                " ultricies metus. Nulla nec dignissim mi. Nullam risus augue, egestas" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
                                " vitae facilisis eu, adipiscing eu turpis. Nulla convallis semper" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
                                " lobortis. Nullam eget lacus nunc. Nam ipsum lectus, mattis in mollis" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
                                " eu, tristique nec nibh. Nam pellentesque euismod est, a laoreet turpis" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
                                " pulvinar bibendum. Sed malesuada lacus eu ante luctus ut faucibus odio" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
                                " tristique. Donec quis mi ante. Praesent a porta velit. Duis tincidunt" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
                                " velit eget sapien viverra pulvinar.\n" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
                                "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
                                " tempor nisl in quam aliquet eu posuere eros tempor. Vivamus felis" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
                                " urna, hendrerit id fringilla eu, feugiat blandit tellus. Curabitur" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
                                " scelerisque tempus ante, eu convallis ligula ultrices nec. Nullam" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
                                " vulputate aliquet ullamcorper. Lorem ipsum dolor sit amet," +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
                                " consectetur adipiscing elit. Proin at odio vel urna luctus dignissim" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
                                " a quis urna. Lorem ipsum dolor sit amet, consectetur adipiscing elit." +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
                                " Phasellus aliquet luctus eros vitae aliquam. Suspendisse ut magna a" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
                                " ipsum fermentum imperdiet. Maecenas eu nunc sed metus placerat" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
                                " adipiscing. Duis lacus lacus, vestibulum id vestibulum a, tempus at" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
                                " nulla. Proin sagittis nibh vitae dui interdum varius. Cras purus" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
                                " nulla, lobortis eu laoreet a, ultricies vitae sem. Integer aliquam" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
                                " ultricies metus. Nulla nec dignissim mi. Nullam risus augue, egestas" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
                                " vitae facilisis eu, adipiscing eu turpis. Nulla convallis semper" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
                                " lobortis. Nullam eget lacus nunc. Nam ipsum lectus, mattis in mollis" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
                                " eu, tristique nec nibh. Nam pellentesque euismod est, a laoreet turpis" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
                                " pulvinar bibendum. Sed malesuada lacus eu ante luctus ut faucibus odio" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
                                " tristique. Donec quis mi ante. Praesent a porta velit. Duis tincidunt" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
                                " velit eget sapien viverra pulvinar.\n" +
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
                                "Now, congratulations if you can read this final line!";
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
            si = new StringItem("The StringItem", longString);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
            stringItemForm.append(si);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
            Display.getDisplay(m).setCurrent(stringItemForm);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
        else if (c == cmdNext)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
            change++;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
            changeForm();
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
        else if (c == cmdRemoveCommand)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
            Item item = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
            item = stringItemForm.get(0);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
            item.removeCommand(cmdUnlock);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
            item.removeCommand(cmdItem);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
        else if (c == cmdRestoreCommand)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
            Item item = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
            item = stringItemForm.get(0);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
            item.addCommand(cmdUnlock);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
            item.setDefaultCommand(cmdItem);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
        else if (c == cmdRemoveItem)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
            stringItemForm.delete(0);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
        else if (c == cmdLayout)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
            layoutTest(Item.PLAIN);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
        else if (c == cmdLayoutHL)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
            layoutTest(Item.HYPERLINK);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
        else if (c == cmdLayoutButton)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
            layoutTest(Item.BUTTON);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
        else if (c == cmdVLayout)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
            verticalLayoutTest(Item.PLAIN);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
        else if (c == cmdVLayoutHL)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
            verticalLayoutTest(Item.HYPERLINK);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
        else if (c == cmdVLayoutButton)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
            verticalLayoutTest(Item.BUTTON);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
        else if (c == cmdAddListeners)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   262
            int size = stringItemForm.size();
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   263
            for (int i = 0; i < size; i++)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
                Item item = null;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   266
                item = stringItemForm.get(i);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   267
                item.setItemCommandListener(this);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   268
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   269
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   270
        else if (c == cmdExit)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   271
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   272
            m.destroyApp(false);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
            m.notifyDestroyed();
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
        else
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   276
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   277
            String l = label.getString();
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
            String t = text.getString();
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
            int index = cg.getSelectedIndex();
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
            String lo = cg.getString(index);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   281
            int layout = 0;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   282
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
            if (c == cmdCreate)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   284
                si = new StringItem(l, t);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   285
            else if (c == cmdCreateHL)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   286
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   287
                si = new StringItem(l, t, Item.HYPERLINK);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   288
                si.setDefaultCommand(cmdItem);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   289
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   290
            else if (c == cmdCreateButton)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   291
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   292
                si = new StringItem(l, t, Item.BUTTON);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   293
                si.setDefaultCommand(cmdItem);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   294
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   295
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   296
            if (lo.equals(cgTypes[0]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   297
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   298
                layout = Item.LAYOUT_DEFAULT;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   299
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   300
            else if (lo.equals(cgTypes[1]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
                layout = Item.LAYOUT_LEFT;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   304
            else if (lo.equals(cgTypes[2]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   305
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   306
                layout = Item.LAYOUT_RIGHT;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   307
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
            else if (lo.equals(cgTypes[3]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   310
                layout = Item.LAYOUT_CENTER;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   311
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   312
            else if (lo.equals(cgTypes[4]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   313
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314
                layout = Item.LAYOUT_TOP;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   315
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   316
            else if (lo.equals(cgTypes[5]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   317
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
                layout = Item.LAYOUT_BOTTOM;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   319
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   320
            else if (lo.equals(cgTypes[6]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   321
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   322
                layout = Item.LAYOUT_VCENTER;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   323
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   324
            else if (lo.equals(cgTypes[7]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   325
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   326
                layout = Item.LAYOUT_NEWLINE_BEFORE;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   327
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   328
            else if (lo.equals(cgTypes[8]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
                layout = Item.LAYOUT_NEWLINE_AFTER;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332
            else if (lo.equals(cgTypes[9]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   333
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   334
                layout = Item.LAYOUT_SHRINK;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   335
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   336
            else if (lo.equals(cgTypes[10]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   337
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   338
                layout = Item.LAYOUT_VSHRINK;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   339
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   340
            else if (lo.equals(cgTypes[11]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   341
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   342
                layout = Item.LAYOUT_EXPAND;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   343
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   344
            else if (lo.equals(cgTypes[12]))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   345
            {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   346
                layout = Item.LAYOUT_VEXPAND;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   347
            }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   348
            si.setItemCommandListener(this);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   349
            si.setLayout(layout);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   350
            setSize(width.getString(),height.getString());
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
            stringItemForm.append(si);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   352
            stringItemForm.addCommand(cmdRemoveCommand);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   353
            stringItemForm.addCommand(cmdRestoreCommand);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   354
            stringItemForm.addCommand(cmdRemoveItem);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
            Display.getDisplay(m).setCurrent(stringItemForm);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   357
    }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   358
    public void commandAction(Command c, Item i)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   359
    {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
        if (c == cmdBack)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   361
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   362
            label.setString(null);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   363
            text.setString(null);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
            Display.getDisplay(m).setCurrent(this);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
        else if (c == cmdUnlock)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
            i.setPreferredSize(-1,-1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
        else if (c == cmdItem)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   371
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
            i.setLabel(i.getLabel() + ".");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   374
    }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   375
    private void setSize(String width, String height)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   376
    {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   377
        if (width.equals("") && height.equals(""))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   378
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   379
            si.setPreferredSize(-1,-1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   380
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   381
        else if (height.equals(""))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   382
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   383
            si.setPreferredSize(Integer.parseInt(width),-1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   384
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
        else if (width.equals(""))
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   387
            si.setPreferredSize(-1,Integer.parseInt(height));
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   388
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   389
        else
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
            si.setPreferredSize(Integer.parseInt(width),Integer.parseInt(height));
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
    }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
    private void layoutTest(int mode)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
    {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
        stringItemForm.deleteAll();
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
        stringItemForm.addCommand(cmdAddListeners);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
        si = new StringItem("Default Layout","StringItem",mode);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
        StringItem si2 = new StringItem("Layout Right","StringItem",mode);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
        si2.setLayout(StringItem.LAYOUT_RIGHT);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
        StringItem si3 = new StringItem("Layout Left","StringItem",mode);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
        si3.setLayout(StringItem.LAYOUT_LEFT);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
        StringItem si4 = new StringItem("Layout Center","StringItem",mode);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   407
        si4.setLayout(StringItem.LAYOUT_CENTER);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
        StringItem si5 = new StringItem("Layout Expand","StringItem",mode);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
        si5.setLayout(StringItem.LAYOUT_EXPAND | StringItem.LAYOUT_NEWLINE_BEFORE);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
        si5.setDefaultCommand(cmdBack);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
        if (mode != Item.PLAIN)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
            si.setDefaultCommand(cmdBack);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
            si2.setDefaultCommand(cmdBack);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
            si3.setDefaultCommand(cmdBack);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
            si4.setDefaultCommand(cmdBack);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
        stringItemForm.append(si);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
        stringItemForm.append(si2);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
        stringItemForm.append(si3);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
        stringItemForm.append(si4);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
        stringItemForm.append(si5);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
        Display.getDisplay(m).setCurrent(stringItemForm);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
    }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
    private void verticalLayoutTest(int mode)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
    {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
        stringItemForm.deleteAll();
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
        si = new StringItem("Default","String",mode);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
        Spacer sp = new Spacer(10, this.getHeight());
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
        if (mode != Item.PLAIN)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
            si.setDefaultCommand(cmdBack);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   438
        stringItemForm.addCommand(cmdNext);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
        stringItemForm.append(si);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
        stringItemForm.append(sp);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
        Display.getDisplay(m).setCurrent(stringItemForm);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
    }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
    private void changeForm()
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   445
    {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   446
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
        switch (change)
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
        {
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   449
        case -1:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   450
            stringItemForm.setTitle("Default");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   451
            si.setLabel("Default");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   452
            si.setLayout(StringItem.LAYOUT_DEFAULT);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
            break;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   454
        case 0:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   455
            stringItemForm.setTitle("Default(75,75)");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   456
            si.setPreferredSize(75,75);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   457
            break;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   458
        case 1:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
            stringItemForm.setTitle("Top");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   460
            si.setPreferredSize(-1,-1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
            si.setLabel("Top");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
            si.setLayout(StringItem.LAYOUT_TOP);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
            break;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
        case 2:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
            stringItemForm.setTitle("Top(75,75)");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
            si.setPreferredSize(75,75);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
            break;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   468
        case 3:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   469
            stringItemForm.setTitle("Vcenter");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
            si.setPreferredSize(-1,-1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
            si.setLabel("VCenter");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
            si.setLayout(StringItem.LAYOUT_VCENTER);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
            break;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
        case 4:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
            stringItemForm.setTitle("Vcenter(75,75)");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
            si.setPreferredSize(75,75);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
            break;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   478
        case 5:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
            stringItemForm.setTitle("Bottom");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
            si.setPreferredSize(-1,-1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
            si.setLabel("Bottom");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
            si.setLayout(StringItem.LAYOUT_BOTTOM);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
            break;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
        case 6:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
            stringItemForm.setTitle("Bottom(75,75)");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
            si.setPreferredSize(75,75);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
            break;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
        case 7:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
            stringItemForm.setTitle("Vexpand");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
            si.setPreferredSize(-1,-1);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
            si.setLabel("Vexpand");
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
            si.setLayout(StringItem.LAYOUT_VEXPAND);
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
            break;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
        case 8:
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
            change = -1;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
            changeForm();
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
            return;
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
        }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
    }
dc7c549001d5 Revision: v2.1.26
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
}