Package com.volantis.mcs.interaction

Examples of com.volantis.mcs.interaction.Proxy


        return proxy;
    }

    private Proxy createPropertyProxy(PropertyDescriptor descriptor) {
        TypeDescriptor propertyType = descriptor.getPropertyType();
        Proxy proxy = interactionModel.createProxyForType(propertyType);

        return proxy;
    }
View Full Code Here


        for (int i = 0; i < list.size(); i++) {
            PropertyDescriptor descriptor = (PropertyDescriptor) list.get(i);
            PropertyIdentifier identifier = descriptor.getIdentifier();
            PropertyAccessor accessor = descriptor.getPropertyAccessor();

            Proxy childProxy = getPropertyProxy(identifier);
            Object childObject = childProxy.copyModelObject();
            accessor.set(copy, childObject);
        }

        return copy;
    }
View Full Code Here

    }

    public Proxy getItemProxy(int index) {

        ProxyListItem item = (ProxyListItem) proxyItems.get(index);
        Proxy proxy = item.getProxy();

        return proxy;
    }
View Full Code Here

        removeItems(proxyIndex, proxyIndex);
    }

    public Operation prepareCreateAndAddProxyItemOperation() {

        Proxy itemProxy = createItemProxy();

        return prepareAddProxyItemOperation(itemProxy);
    }
View Full Code Here

        return operation;
    }

    public Operation prepareAddModelItemOperation(Object modelItem) {
        Proxy itemProxy = createItemProxy();
        itemProxy.setModelObject(modelItem);

        return prepareAddProxyItemOperation(itemProxy);
    }
View Full Code Here

        // model object in the underlying list and adding it to the new list.
        for (int i = 0; i < proxyItems.size(); i += 1) {
            ProxyListItem item = (ProxyListItem) proxyItems.get(i);
            int modelIndex = item.getModelIndex();
            if (modelIndex != -1) {
                Proxy proxy = item.getProxy();
                Object itemModelObject = proxy.copyModelObject();
                accessor.insert(copy, modelIndex, itemModelObject);
            }
        }

        // Return the new list.
View Full Code Here

                        properties.get(i);

                TypeDescriptor propertyType = property.getPropertyType();

                PropertyIdentifier identifier = property.getIdentifier();
                Proxy propertyProxy = proxy.getPropertyProxy(identifier);

                panel.add(new JLabel(identifier.getDescription()));
                panel.add(
                        controlCreator.createControl(
                                propertyType, propertyProxy));
            }
        } else if (count == 1) {
            PropertyDescriptor property =
                    (PropertyDescriptor) properties.get(0);
            PropertyIdentifier identifier = property.getIdentifier();
            Proxy propertyProxy = proxy.getPropertyProxy(identifier);
            add(new ComponentCreator(gui).create(propertyProxy),
                BorderLayout.CENTER);

        } else {
            throw new IllegalStateException("No properties defined for bean");
View Full Code Here

//                                personProxy, Person.LAST_NAME);
//                        String age = getPropertyAsString(
//                                personProxy, Person.AGE);
//
//                        String details = firstName + " " + lastName + " - " + age;
                        Proxy proxy = (Proxy) value;
                        ProxyRenderer renderer = gui.getRenderers().getRenderer(
                                proxy);
                        String details = renderer.render(proxy);

                        return super.getListCellRendererComponent(
                                list, details, index, isSelected, cellHasFocus);
                    }
                });
        list.addMouseListener(
                new MouseAdapter() {

                    public void mouseClicked(MouseEvent e) {
                        if (e.getClickCount() == 2) {
                            int index = list.getSelectedIndex();
                            Proxy itemProxy = listProxy.getItemProxy(index);
                            openEditDialog(itemProxy);
                        }
                    }
                });

        JPanel listButtonPanel = new JPanel();
        listButtonPanel.setBackground(Color.YELLOW);
        gridBagConstraints.gridx = 1;
        gridBagConstraints.fill = GridBagConstraints.VERTICAL;
        add(listButtonPanel);

        listButtonPanel.setLayout(new GridLayout(2, 1));

        JButton button;

        AbstractAction addContactAction = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                final Proxy itemProxy = listProxy.addItemProxy();
                openEditDialog(itemProxy);
            }
        };
        addContactAction.putValue(Action.NAME, "Add");
View Full Code Here

        // =====================================================================

        root.addDiagnosticListener(diagnosticListenerMock);
        root.validate();

        final Proxy firstNameProxy = root.getPropertyProxy(Person.FIRST_NAME);
        final Proxy lastNameProxy = root.getPropertyProxy(Person.LAST_NAME);
        final Proxy ageProxy = root.getPropertyProxy(Person.AGE);
        final Proxy addressProxy = root.getPropertyProxy(Person.ADDRESS);

        final ProxyDiagnostic firstNameDiagnostic = new ProxyDiagnosticImpl(
                DiagnosticLevel.ERROR,
                firstNameProxy,
                modelFactory.createMessage("not.set", "firstName"));
View Full Code Here

        Person wilma = createWilmaFlintstone(flintstonesAddress);

        contactsList.add(fred);
        contactsList.add(wilma);

        Proxy proxy = createProxy(contacts);

        Path path2Fred = modelFactory.parsePath("/contacts/0/address");
        Proxy fredAddress = proxy.getProxy(path2Fred);

        Path path2Wilma = modelFactory.parsePath("/contacts/1/address");
        Proxy wilmaAddress = proxy.getProxy(path2Wilma);

        // Build up a mapping from the model object to the proxies.
        Prepare4Validation prepare = new Prepare4Validation();
        prepare.prepare(proxy);
View Full Code Here

TOP

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

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.