Package com.volantis.mcs.interaction

Examples of com.volantis.mcs.interaction.ListProxy


        action.putValue(Action.NAME, "Edit...");
        component = new JButton(action);
    }

    public void visit(ListClassDescriptor descriptor) {
        final ListProxy listProxy = (ListProxy) proxy;
        Action action = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                EditDialog dialog = new EditDialog(
                        new ListComponent(gui, listProxy));
                dialog.show();
View Full Code Here


        final List expectedSources = new ArrayList();
        expectedSources.add(wilmaProxy);
        expectedSources.add(wilmaProxy.getPropertyProxy(Person.AGE));
        expectedSources.add(wilmaProxy.getPropertyProxy(Person.LAST_NAME));
        expectedSources.add(wilmaAddress);
        ListProxy lines =
                (ListProxy) wilmaAddress.getPropertyProxy(Address.LINES);
        expectedSources.add(lines);
        for (int i = 0; i < lines.size(); i++) {
            expectedSources.add(lines.getItemProxy(i));
        }

        // Set up a listener that removes sources from the expected list as
        // events arrive.
        wilmaProxy.addListener(new InteractionEventListenerAdapter() {
View Full Code Here

        address = person.getAddress();
        assertNull("Address not null", address);

        BeanProxy addressProxy = (BeanProxy) personProxy.getPropertyProxy(
                Person.ADDRESS);
        ListProxy linesProxy = (ListProxy) addressProxy.getPropertyProxy(
                Address.LINES);

        // Address should still be null after its proxy and a nested proxy have
        // been added.
        address = person.getAddress();
        assertNull("Address not null", address);

        OpaqueProxy lineProxy;
        lineProxy = (OpaqueProxy) linesProxy.addItemProxy();
        lineProxy.setModelObject("301 Cobblestone Way");

        // Address should not be null now.
        address = person.getAddress();
        assertNotNull("Address null", address);

        lineProxy = (OpaqueProxy) linesProxy.addItemProxy();
        lineProxy.setModelObject("Bedrock");

        lineProxy = (OpaqueProxy) linesProxy.addItemProxy();
        lineProxy.setModelObject("70777");

        List expectedAddressLines = new ArrayList();
        expectedAddressLines.add("301 Cobblestone Way");
        expectedAddressLines.add("Bedrock");
View Full Code Here

        assertEquals("age", new Integer(10040), value);

        // Check that the address proxy works.
        BeanProxy addressProxy = (BeanProxy) rootProxy.getPropertyProxy(
                Person.ADDRESS);
        ListProxy linesProxy = (ListProxy) addressProxy.getPropertyProxy(
                Address.LINES);
        int size = linesProxy.size();
        OpaqueProxy lineProxy;
        for (int i = 0; i < size; i += 1) {
            lineProxy = (OpaqueProxy) linesProxy.getItemProxy(i);
            String expectedLine = (String) lines.get(i);
            String actualLine = (String) lineProxy.getModelObject();
            assertEquals("Line " + i, expectedLine, actualLine);
        }

        ProxyModelChangedEvent event = new ProxyModelChangedEvent(
                firstNameProxy, "Fred", "Wilma", true);
        deepListenerMock.expects.proxyModelChanged(event);

        value = firstNameProxy.setModelObject("Wilma");
        assertEquals("old value", "Fred", value);

        // Test that paths work properly.
        checkPath(
                rootProxy, rootProxy, "", Arrays.asList(
                        new Object[]{rootProxy}));
        checkPath(
                rootProxy, linesProxy, "/address/lines",
                Arrays.asList(
                        new Object[]{
                            rootProxy,
                            addressProxy,
                            linesProxy
                        }));

        lineProxy = (OpaqueProxy) linesProxy.getItemProxy(2);
        checkPath(
                rootProxy, lineProxy, "/address/lines/2",
                Arrays.asList(
                        new Object[]{
                            rootProxy,
View Full Code Here

TOP

Related Classes of com.volantis.mcs.interaction.ListProxy

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.