Package com.sun.midp.util

Examples of com.sun.midp.util.SerialCallback$Callback


            }
        }
        baton.finish();

        // wait for queued events to be processed
        new SerialCallback(dpy).invokeAndWait();

        assertTrue("layout must be valid", checkValidLayout(form));
        dpy.liveTracer.clear();
    }
View Full Code Here


     */
    void testTraversalInconsistency() {
        Form form = new Form("Test Form 2");
        FormLFImpl formLF = (FormLFImpl)form.formLF;
        final Baton baton = new Baton();
        SerialCallback scb = new SerialCallback(dpy);

        // can be any interactive item
        Item item = new Gauge(null, true, 1, 0);

        // Set up a form with no focusable item.

        form.append("String 1");
        dpy.setCurrent(form);
        scb.invokeAndWait();

        // Block the event queue to prevent the invalidate from
        // being processed.

        dpy.callSerially(
            new Runnable() {
                public void run() {
                    baton.pass();
                }
            });
        baton.start();

        // Append a focusable item to the form, and then call
        // uTraverse() directly, as if a key had been pressed at
        // exactly the right moment.

        form.insert(0, item);
        formLF.uTraverse(Canvas.DOWN);
        baton.finish();

        // Wait for the invalidate to finish processing, then
        // check assertions.

        scb.invokeAndWait();
        assertEquals("item 0 should be focused", 0, formLF.traverseIndex);
    }
View Full Code Here

    /**
     * Starts the test
     */
    void setUp() {
        display = new StubDisplay();
        scb = new SerialCallback(display);
       
        form = new Form("Form");
        tf = new TextField("TextField", longtext, 256, TextField.ANY);
        form.append(tf);

View Full Code Here

        firstForm = new Form("A Form");
        firstCommand = new Command("first command", Command.SCREEN, 1);
        secondCommand = new Command("second command", Command.SCREEN, 1);
        thirdCommand = new Command("third command", Command.SCREEN, 1);
        display = new StubDisplay();
        scb = new SerialCallback(display);

        firstForm.addCommand(firstCommand);
        firstForm.addCommand(secondCommand);
        firstForm.addCommand(thirdCommand);
    }
View Full Code Here

        // The setCurrent(cv1) call supersedes the
        // alert, so dismissing the alert should not
        // return to cv0.

        new SerialCallback(dpy).invokeAndWait();
        checkCurrent("alert", alert, false);
        checkCurrent("cv0", cv0, false);
        checkCurrent("cv1", cv1, true);
    }
View Full Code Here

        checkCurrent("alert", alert, false);
        checkCurrent("cv0", cv0, false);
        checkCurrent("cv1", cv1, true);

        dismiss(alert);
        new SerialCallback(dpy).invokeAndWait();
        checkCurrent("alert", alert, false);
        checkCurrent("cv0", cv0, false);
        checkCurrent("cv1", cv1, true);
    }
View Full Code Here

        // establish initial conditions
        setCurrentWait(cv0);
        checkCurrent("cv0", cv0, true);

        thrown = false;
        new SerialCallback(dpy) {
            public void run() {
                dpy.setCurrent(alert1);
                try {
                    dpy.setCurrent(alert2);
                } catch (IllegalArgumentException iae) {
View Full Code Here

        // establish initial conditions
        setCurrentWait(cv0);
        checkCurrent("cv0", cv0, true);

        thrown = false;
        new SerialCallback(dpy) {
            public void run() {
                dpy.setCurrent(alert1);
                try {
                    dpy.setCurrent(alert1);
                } catch (IllegalArgumentException iae) {
View Full Code Here

            });

        // Dismissing alert1 should do nothing, since it has
        // been superseded by alert2.

        new SerialCallback(dpy).invokeAndWait();
        checkCurrent("alert1", alert1, false);
        checkCurrent("alert2", alert2, true);
        checkCurrent("cv0", cv0, false);
        checkCurrent("cv1", cv1, false);
View Full Code Here

                }
            });

        // Ensure that the second setCurrent had no effect.

        new SerialCallback(dpy).invokeAndWait();
        checkCurrent("alert1", alert1, true);
        checkCurrent("cv0", cv0, false);
        checkCurrent("cv1", cv1, false);

        dismissWait(alert1);
View Full Code Here

TOP

Related Classes of com.sun.midp.util.SerialCallback$Callback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.