Package net.sourceforge.marathon.component

Examples of net.sourceforge.marathon.component.MComponent


        if (component.isMComponentEditable())
            dragComponentText = getText(component);
        else
            dragComponentText = null;
        dragComponent = component;
        MComponent container = null;
        if (dragComponent instanceof MCellComponent)
            container = ((MCellComponent) dragComponent).getCollectionComponentWithWindowID();
        if (container != null && container.isMComponentEditable()) {
            dragComponentContainer = container;
            dragComponentContainerText = container.getText();
        } else {
            dragComponentContainer = null;
            dragComponentContainerText = null;
        }
    }
View Full Code Here


    }

    @Test
    public void testAssertColumnCount() {
        JTable table = new JTable(1, 3);
        MComponent component = new MTable(table, "table", null, WindowMonitor.getInstance());
        ComponentFinder resolver = new DummyResolver(component);
        ActionTestCase.assertPasses(
                new AssertColumnCount(ID, 3, ScriptModelServerPart.getModelServerPart(), WindowMonitor.getInstance()), resolver);
        ActionTestCase.assertFails(
                new AssertColumnCount(ID, 4, ScriptModelServerPart.getModelServerPart(), WindowMonitor.getInstance()), resolver);
View Full Code Here

        TreePath[] selectionPaths = assertionTree.getSelectionPaths();
        for (int i = 0; i < selectionPaths.length; i++) {
            TreePath path = selectionPaths[i];
            Object[] objects = path.getPath();
            final StringBuffer sb = new StringBuffer();
            MComponent forComponent = mcomponent;
            for (int j = 1; j < objects.length; j++) {
                final AssertionTreeNode node = (AssertionTreeNode) objects[j];
                if (node.getObject() instanceof MComponent) {
                    forComponent = (MComponent) node.getObject();
                    sb.setLength(0);
                    continue;
                }
                sb.append(node.getProperty());
                if (j < objects.length - 1) {
                    if (!((AssertionTreeNode) objects[j + 1]).getProperty().startsWith("["))
                        sb.append(".");
                } else {
                    IScriptElement enscript;
                    String property = sb.toString();
                    if (action == ASSERT_ACTION) {
                        if (property.equals("Content") && forComponent instanceof MCollectionComponent)
                            enscript = new AssertContent(forComponent.getComponentId(),
                                    ((MCollectionComponent) forComponent).getContent(), scriptModel, windowMonitor)
                                    .enscript(forComponent);
                        else {
                            String value;
                            if (property.equals("Text"))
                                value = forComponent.getComparableObject().toString();
                            else
                                value = forComponent.getProperty(property);
                            enscript = new AssertPropertyAction(forComponent.getComponentId(), property, value, scriptModel,
                                    windowMonitor).enscript(forComponent);
                        }
                    } else {
                        String value;
                        if (property.equals("Text"))
                            value = forComponent.getComparableObject().toString();
                        else
                            value = forComponent.getProperty(property);
                        enscript = new WaitPropertyAction(forComponent.getComponentId(), property, value, scriptModel,
                                windowMonitor).enscript(forComponent);
                    }
                    if (getFinder() != null)
                        getFinder().markUsed(forComponent);
                    getRecorder().record(enscript);
View Full Code Here

        if (!finder.hasTopLevelWindow()) {
            pushed = true;
            Window window = WindowMonitor.getTopLevelWindowWithFocus();
            finder.push(window);
        }
        MComponent component = finder.getMContainerById(new ComponentId(windowTitle));
        if (pushed)
            finder.pop();
        finder.push(component.getComponent());
    }
View Full Code Here

    }

    public String getProperty(ComponentId id, String property) {
        if(failMessage != null)
            failX(failMessage);
        MComponent component = finder.getMComponentById(id);
        return component.getProperty(property);
    }
View Full Code Here

    }

    public Object getPropertyObject(ComponentId id, String property) {
        if(failMessage != null)
            failX(failMessage);
        MComponent component = finder.getMComponentById(id);
        return component.getPropertyObject(property);
    }
View Full Code Here

    public void screenCapture(String imageName, String windowName) {
        play(new ScreenCaptureAction(imageName, windowName, scriptModel, windowMonitor));
    }

    public void screenCapture(String imageName, String windowName, ComponentId id) {
        MComponent component = finder.getMComponentById(id);
        play(new ScreenCaptureAction(imageName, windowName, component, scriptModel, windowMonitor));
    }
View Full Code Here

        Iterator<IContextMenu> iterator = contextMenus.iterator();
        while (iterator.hasNext()) {
            IContextMenu menu = (IContextMenu) iterator.next();
            menu.setComponent(component, point, isTriggered);
        }
        MComponent mcomponent = finder.getMComponentByComponent(component, point);
        if (mcomponent == null) {
            return;
        }
        if (isTriggered) {
            overlayFrame = new TransparentFrame(mcomponent);
            overlayFrame.setVisible(true);
        }
        String info = mcomponent.getComponentInfo();
        titleLabel.setText("   " + mcomponent.getMComponentName() + (info == null ? "" : " (" + info + ")"));
        pack();
    }
View Full Code Here

    public String getName() {
        return "Custom";
    }

    public void setComponent(final Component component, Point point, boolean isTriggered) {
        final MComponent mcomponent = getFinder().getMComponentByComponent(component);
        new Thread() {
            public void run() {
                String[][] customAssertions = runtime.getCustomAssertions(mcomponent);
                model.setData(customAssertions);
            }
View Full Code Here

                            if (i > 0)
                                new Snooze(delayInMS);

                            ComponentId id = (ComponentId) ids.get(i);

                            MComponent mc = resolver.getMComponentById(id);
                            Component c = null;
                            if (mc != null) {
                                c = mc.getComponent();
                                if (c instanceof JMenu && (((JMenu) c).getPopupMenu().getComponentCount() == 0 || ((JMenu) c).getPopupMenu().isShowing())) {
                                    continue;
                                }
                            }
View Full Code Here

TOP

Related Classes of net.sourceforge.marathon.component.MComponent

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.