Package abbot.script

Examples of abbot.script.Action


            addStep(step);
        }
        else if (methodName.startsWith("action")) {
            if (id == null) {
                // non-component action
                addStep(new Action(getContext(), null, methodName, argList));
            }
            else {
                ComponentReference ref = getComponentReference(id);
                if (ref == null)
                    throw new NoSuchReferenceException(id);
                addStep(new Action(getContext(), null,
                                   methodName, argList,
                                   method.getDeclaringClass()));
            }
        }
        else {
View Full Code Here


            ComponentReference cr = getResolver().addComponent(combo);
            String value =
                tester.getValueAsString(combo, list,
                                        combo.getItemAt(index), index);
            if (value == null) {
                step = new Action(getResolver(),
                                  null, "actionSelectIndex",
                                  new String[] {
                                      cr.getID(), String.valueOf(index)
                                  }, javax.swing.JComboBox.class);
            }
            else {
                step = new Action(getResolver(),
                                  null, "actionSelectItem",
                                  new String[] {
                                      cr.getID(), value
                                  }, javax.swing.JComboBox.class);
            }
View Full Code Here

            && ((Action)step).getMethodName().equals("actionKeyString");
    }

    private boolean isKeyStroke(Step step, String keycode) {
        if (step instanceof Action) {
            Action action = (Action)step;
            if (action.getMethodName().equals("actionKeyStroke")) {
                String[] args = action.getArguments();
                return (keycode == ANY_KEY
                        || (args.length > 1 && args[1].equals(keycode))
                        || (keycode.startsWith("VK_NUMPAD")
                            && args[1].equals("VK_" + keycode.substring(9))));
            }
View Full Code Here

            if (isKeyString(step)) {
                int j = i;
                while (++j < steps.size()) {
                    Step next = (Step)steps.get(j);
                    if (isKeyString(next)) {
                        Action action = (Action)step;
                        String[] args1 = action.getArguments();
                        String[] args2 = ((Action)next).getArguments();
                        action.setArguments(new String[] {
                            args1[0], args1[1] + args2[1]
                        });
                        setStatus("Joining '" + args1[1]
                                  + "' and '" + args2[1] + "'");
                        steps.remove(j--);
View Full Code Here

                            String[] args =
                                (mods == null || "0".equals(mods)
                                 ? new String[] { target, cs }
                                 : new String[] { target, cs, mods});
                            Step typed =
                                new Action(getResolver(),
                                           null, "actionKeyStroke", args);
                            steps.add(i, typed);
                            setStatus("Insert artifical " + typed);
                        }
                        else {
View Full Code Here

        while (current < steps.size()) {
            Step step = (Step)steps.get(current);
            if (isKey(step, modifier, PRESS)) {
                Log.debug("Found possible extraneous modifier");
                int keyDown = current;
                Action action = null;
                while (++current < steps.size()) {
                    step = (Step)steps.get(current);
                    if (step instanceof Action) {
                        if ("actionActionMap".
                            equals(((Action)step).getMethodName())) {
View Full Code Here

        return step;
    }

    protected Step createMenuSelection(Component menuItem) {
        ComponentReference cr = getResolver().addComponent(menuItem);
        Step step = new Action(getResolver(),
                               null, "actionSelectMenuItem",
                               new String[] { cr.getID() });
        return step;
    }
View Full Code Here

            method = "actionSelectAWTPopupMenuItem";
        // Get a unique path for the MenuItem
        String path = AWT.getPath(menuItem);
        // Do a quick search on the invoker for other popups.  If there are
        // duplicates, include the menu item name
        Step step = new Action(getResolver(),
                               null, method,
                               new String[] { ref.getID(), path });
        return step;
    }
View Full Code Here

        Step step;
        if (invoker != null) {
            ComponentReference inv = getResolver().addComponent(invoker);
            JMenuItem mi = (JMenuItem)menuItem;
            String where = getLocationArgument(invoker, x, y);
            step = new Action(getResolver(),
                              null, "actionSelectPopupMenuItem",
                              new String[] { inv.getID(), where,
                                             mi.getText()
                              }, invoker.getClass());
        }
        else {
            ComponentReference ref = getResolver().addComponent(menuItem);
            step = new Action(getResolver(),
                              null, "actionSelectMenuItem",
                              new String[] { ref.getID() });
        }
        return step;
    }
View Full Code Here

        if (code != null) {
            String[] args = mods != 0
                ? new String[] { cr.getID(), code,
                                 Robot.getKeyModifiers(mods) }
                : new String[] { cr.getID(), code };
            return new Action(getResolver(), null, "actionKeyStroke", args);
        }           
        return new Action(getResolver(), null,
                          "actionKeyString",
                          new String[] { cr.getID(),
                                         String.valueOf(keychar) });
    }
View Full Code Here

TOP

Related Classes of abbot.script.Action

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.