Package net.sourceforge.marathon

Examples of net.sourceforge.marathon.MessageList


     * text
     */
    @Test
    public void testSetTextFiresFocusGainedEvent() {
        final MTextComponent mTextField = new MTextComponent(dialog.getTextField(), "foo.bar", null, WindowMonitor.getInstance());
        final MessageList list = new MessageList();
        dialog.getTextField().addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent e) {
                list.add("focusGained (" + mTextField.getText() + ")");
            }

            public void focusLost(FocusEvent e) {
                list.add("focusLost (" + mTextField.getText() + ")");
            }
        });
        mTextField.setText("purple");
        list.assertNextMessage("focusGained (the text)");
    }
View Full Code Here


        assertEquals("not in popup list", mComboBox.getText());
    }

    @Test
    public void testEventsGetFiredOnSetText() {
        MessageList events = new MessageList();
        MockComponentListener listener = new MockComponentListener(events, "popup");
        BasicComboPopup popup = (BasicComboPopup) dialog.getComboBox().getAccessibleContext().getAccessibleChild(0);
        popup.getList().addFocusListener(listener);
        popup.getList().addMouseListener(listener);
        assertEquals("a", mComboBox.getText());
        events.assertEmpty();
        mComboBox.setText("b");
        events.assertNextMessageInList("popup:mouseEntered");
        events.assertNextMessageInList("popup:mousePressed");
        events.assertNextMessageInList("popup:mouseReleased");
    }
View Full Code Here

    @Before
    public void setUp() throws Exception {
        dialog = new DialogForTesting(this.getClass().getName());
        dialog.addButton("name", "text");
        events = new MessageList();
        eventQueue = new RecordingEventQueue(null, null, null, ScriptModelServerPart.getModelServerPart(),
                WindowMonitor.getInstance()) {
            public ContextMenuWindow showPopup(Component c, Point point) {
                events.add("popup shown " + c.getClass());
                return null;
View Full Code Here

    @Before
    public void setUp() throws Exception {
        dialog = new DialogForTesting("Main Dialog");
        dialog.addButton("button1.name", "button1");
        dialog.addMessageBoxButton("button2.name", "button2", "Message Dialog");
        events = new MessageList();
        events.addActionListener(dialog.getButton(), "button pressed");
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.marathon.MessageList

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.