Revert StaticDisplayState; For hosted only allow debug to be used.
[SquirrelJME.git] / modules / midp-lcdui / src / test / java / mleui / forms / TestAllSpecial.java
blobb0d8a197479edef0bf2ec36da6615ca791702158
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package mleui.forms;
12 import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket;
13 import cc.squirreljme.jvm.mle.brackets.UIFormBracket;
14 import cc.squirreljme.jvm.mle.brackets.UIItemBracket;
15 import cc.squirreljme.jvm.mle.constants.UIItemPosition;
16 import cc.squirreljme.jvm.mle.constants.UIItemType;
17 import cc.squirreljme.runtime.lcdui.mle.UIBackend;
19 /**
20 * Tests all the special slots.
22 * @since 2020/07/18
24 public class TestAllSpecial
25 extends BaseUIForm
27 /**
28 * {@inheritDoc}
29 * @since 2020/07/18
31 @Override
32 protected void test(UIBackend __backend, UIDisplayBracket __display,
33 UIFormBracket __form)
35 int n = (-UIItemPosition.MIN_VALUE) + 1;
36 UIItemBracket[] special = new UIItemBracket[n];
37 UIItemBracket[] normals = new UIItemBracket[n];
39 for (int i = 0; i < n; i++)
41 special[i] = __backend.itemNew(UIItemType.BUTTON);
42 normals[i] = __backend.itemNew(UIItemType.SINGLE_LINE_TEXT_BOX);
45 // Add all the items
46 for (int i = 0; i < n; i++)
48 // Skip the body so it is not there
49 if (i > 0 && i != -UIItemPosition.BODY)
50 __backend.formItemPosition(__form, special[i], -i);
52 // Add normal items otherwise
53 __backend.formItemPosition(__form, normals[i], i);
56 // Remove all the items
57 for (int i = n - 1; i >= 0; i--)
59 // Skip the body so it is not there
60 if (i > 0 && i != -UIItemPosition.BODY)
61 __backend.formItemRemove(__form, -i);
63 // Add normal items otherwise
64 __backend.formItemRemove(__form, i);
67 // Cleanup
68 for (int i = 1; i < n; i++)
70 __backend.itemDelete(special[i]);
71 __backend.itemDelete(normals[i]);