Revert StaticDisplayState; For hosted only allow debug to be used.
[SquirrelJME.git] / modules / midp-lcdui / src / test / java / mleui / forms / TestItemFormOwner.java
blob6de0a4e7a28c1cf7db63a2ae51a716dd7269330c
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.UIItemType;
16 import cc.squirreljme.runtime.lcdui.mle.UIBackend;
18 /**
19 * Tests that the item on the form is the item of the given form.
21 * @since 2021/01/03
23 public class TestItemFormOwner
24 extends BaseUIForm
26 /**
27 * {@inheritDoc}
28 * @since 2021/01/03
30 @Override
31 protected void test(UIBackend __backend, UIDisplayBracket __display,
32 UIFormBracket __form)
33 throws Throwable
35 UIItemBracket item = __backend.itemNew(UIItemType.BUTTON);
37 // Should not be on the form
38 this.secondary("first-null",
39 null == __backend.itemForm(item));
41 // Placing it on the form, it should point to that form
42 __backend.formItemPosition(__form, item, 0);
43 this.secondary("set-matches",
44 __backend.equals(__form, __backend.itemForm(item)));
46 // Replacing the item should make it go away
47 UIItemBracket rep = __backend.itemNew(UIItemType.LABEL);
48 __backend.formItemPosition(__form, rep, 0);
49 this.secondary("replace-null",
50 null == __backend.itemForm(item));