Package net.sourceforge.marathon.event

Examples of net.sourceforge.marathon.event.FireableKeyEvent


        if (text.startsWith("password:"))
            text = text.substring(9);
        new FireableMouseClickEvent(getTextComponent()).fire(1);
        swingWait();
        selectAllText();
        FireableKeyEvent keyEvent = new FireableKeyEvent(getTextComponent(), 0);
        if (text.length() > 0) {
            keyEvent.fire(text);
        } else {
            keyEvent.fire(KeyEvent.VK_DELETE, KeyEvent.CHAR_UNDEFINED);
        }
        if (!getTextComponent().getText().equals(text)) {
            // Needed for non-editable fields and fields that do not
            // allow keyevents
            swingWait();
View Full Code Here


    private JTextComponent getTextComponent() {
        return (JTextComponent) getComponent();
    }

    private void selectAllText() {
        new FireableKeyEvent(getTextComponent(), OSUtils.MENU_MASK).fire("a");
        swingWait();
        if (getTextComponent().getSelectionStart() != 0
                || getTextComponent().getSelectionEnd() != getTextComponent().getText().length()) {
            throw new Error("clicking and then hitting ctrl-A should select everything");
        }
View Full Code Here

        }
        play(resolver.getWindow().getFocusOwner());
    }

    public void play(Component component) {
        FireableKeyEvent event = new FireableKeyEvent(component, keyStroke.getModifiers());
        event.fire(keyStroke.getKeyCode(), keyChar);
        component.repaint();
        AWTSync.sync();
    }
View Full Code Here

        if (!selectAllText()) {
            eventQueueRunner.invoke(getTextComponent(), "setText", new Object[] { text }, new Class[] { String.class });
            return;
        }
        swingWait();
        FireableKeyEvent keyEvent = new FireableKeyEvent(getTextComponent(), 0);
        if (text.length() > 0) {
            keyEvent.fire(text);
        } else {
            keyEvent.fire(KeyEvent.VK_DELETE, KeyEvent.CHAR_UNDEFINED);
        }
        swingWait();
        if (isCellEditing)
            keyEvent.fire(KeyEvent.VK_ENTER, (char) 13);
        swingWait();
    }
View Full Code Here

    private JTextComponent getTextComponent() {
        return (JTextComponent) getComponent();
    }

    private boolean selectAllText() {
        new FireableKeyEvent(getTextComponent(), OSUtils.MENU_MASK).fire("a");
        swingWait();
        int length = 0;
        if (getText() != null)
            length = getText().length();
        int selectionStart = eventQueueRunner.invokeInteger(getTextComponent(), "getSelectionStart");
View Full Code Here

TOP

Related Classes of net.sourceforge.marathon.event.FireableKeyEvent

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.