Examples of BeanProxy


Examples of com.volantis.mcs.interaction.BeanProxy

                return (i == COLUMN_SELECTOR) ?
                        decorator.decorateImage(SELECTOR_IMAGE, o) : null;
            }

            public String getColumnText(Object o, int i) {
                BeanProxy ruleProxy = (BeanProxy) o;
                String returnValue = null;
                if (i == COLUMN_SELECTOR) {
                    // Selectors
                    Proxy selectorsProxy =
                            ruleProxy.getPropertyProxy(Rule.SELECTORS);
                    Object model = selectorsProxy.getModelObject();
                    returnValue = selectorListToText((List) model);
                } else if (i == COLUMN_ORDER) {
                    // Order
                    ListProxy rules = (ListProxy) getSelectedStyleSheetProxy().
                            getPropertyProxy(ThemeModel.RULES);
                    int index = rules.getItemProxyIndex(ruleProxy);
                    // Indices start at 0, but humans expect 1...
                    returnValue = String.valueOf(index + 1);
                }
                return returnValue;
            }

            public void addListener(ILabelProviderListener iLabelProviderListener) {
            }

            public void dispose() {
            }

            public boolean isLabelProperty(Object o, String s) {
                return true;
            }

            public void removeListener(ILabelProviderListener iLabelProviderListener) {
            }
        };
        ruleTable.setLabelProvider(labelProvider);

        CellEditor editors [] = new CellEditor[2];
        editors[0] = new TextCellEditor(table);

        ruleTable.setCellEditors(editors);
        ruleTable.setColumnProperties(new String[]{"selectors", "order"});
        ruleTable.setCellModifier(new ICellModifier() {
            public boolean canModify(Object o, String s) {
                return "selectors".equals(s);
            }

            public Object getValue(Object o, String s) {
                Object value = null;
                // Only selectors are modifiable, so ignore all other settings
                if ("selectors".equals(s)) {
                    List selectors = ruleProxyToSelectorList((BeanProxy) o);
                    value = selectorListToText(selectors);
                }
                return value;
            }

            public void modify(Object tableItem, String columnName, Object newValue) {
                if ("selectors".equals(columnName)) {
                    TableItem item = (TableItem) tableItem;
                    BeanProxy ruleProxy = (BeanProxy) item.getData();
                    String oldValue = labelProvider.getColumnText(ruleProxy, COLUMN_SELECTOR);
                    if (!oldValue.equals(newValue)) {
                        List parsed =
                                CSS_PARSER.parseSelectorGroup((String) newValue);
                        ListProxy selectorsProxy = (ListProxy) ruleProxy.getPropertyProxy(Rule.SELECTORS);
                        Operation setList = selectorsProxy.prepareSetModelObjectOperation(parsed);
                        context.executeOperation(setList);
                    }
                }
            }
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

                if (group != null) {
                    ListProxy rules = (ListProxy) getSelectedStyleSheetProxy().
                            getPropertyProxy(ThemeModel.RULES);
                    Operation addOp = rules.prepareCreateAndAddProxyItemOperation();
                    context.executeOperation(addOp);
                    BeanProxy newRule = (BeanProxy) rules.getItemProxy(rules.size() - 1);
                    ListProxy selectors = (ListProxy) newRule.getPropertyProxy(Rule.SELECTORS);
                    Operation setOp = selectors.prepareSetModelObjectOperation(wizard.getSelectorGroup().getSelectors());
                    context.executeOperation(setOp);
                }
            }
        };
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

            }
        }
    }

    private BeanProxy getSelectedStyleSheetProxy() {
        BeanProxy variant = context.getSelectedVariant();
        BaseProxy content = (BaseProxy) variant.getPropertyProxy(PolicyModel.CONTENT);
        BeanProxy concreteContent = (BeanProxy) content.getConcreteProxy();
        if (concreteContent == null) {
            ThemeContentBuilder contentModel =
                    InternalPolicyFactory.getInternalInstance().createThemeContentBuilder();
            content.setModelObject(contentModel);
            concreteContent = (BeanProxy) content.getConcreteProxy();
        }

        return (BeanProxy) concreteContent.getPropertyProxy(ThemeModel.STYLE_SHEET);
    }
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

        if (ruleTable.getInput() == null) {
            BaseProxy contentBase = (BaseProxy) context.getSelectedVariant().
                    getPropertyProxy(PolicyModel.CONTENT);
            Proxy concreteContent = contentBase.getConcreteProxy();
            if (concreteContent != null) {
                BeanProxy themeContent = (BeanProxy) concreteContent;
                BeanProxy styleSheet = (BeanProxy) themeContent.
                        getPropertyProxy(ThemeModel.STYLE_SHEET);
                Proxy rules = styleSheet.getPropertyProxy(ThemeModel.RULES);
                ruleTable.setInput(rules);
                rules.addListener(tableRefresher, true);
                rules.addDiagnosticListener(tableRefresher);
            }
        }
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

            // Add the attributes after the other controls.
            displayArea.addProperties(attributes, false, comboDescriptors,
                    policyReferenceTypes);

            // Set the values of the properties
            BeanProxy interaction = (BeanProxy) context.getInteractionModel();
            displayArea.updateFromProxy(interaction);

            displayArea.addPropertiesCompositeChangeListener(
                    new PropertiesCompositeChangeListener() {
                        public void propertyChanged(
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

                        namesToDescriptors.get(policyName);
                SelectionPolicyType policyType =
                        (SelectionPolicyType) descriptor.getPolicyType();
                context.setCategoryValues(policyType.getKeywords());

                BeanProxy model = (BeanProxy) context.getInteractionModel();
                Proxy categorisationScheme = model.getPropertyProxy(
                        PolicyModel.CATEGORISATION_SCHEME);

                if (!ObjectHelper.equals(policyName,
                        categorisationScheme.getModelObject())) {
                    Operation setSchemeOp = categorisationScheme
                            .prepareSetModelObjectOperation(policyName);
                    context.executeOperation(setSchemeOp);
                }
            }
        });

        BeanProxy model = (BeanProxy) context.getInteractionModel();
        final Proxy categorisationScheme =
                model.getPropertyProxy(PolicyModel.CATEGORISATION_SCHEME);
        String selectedPolicy = (String) categorisationScheme.getModelObject();
        if (selectedPolicy != null) {
            combo.setSelection(new StructuredSelection(selectedPolicy));
            PolicyDescriptor descriptor = (PolicyDescriptor)
                    namesToDescriptors.get(selectedPolicy);
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

        }

        if (previouslySelectedBuilder == null) {
            context.setSelectedVariant(null);
        } else {
            BeanProxy modelProxy = (BeanProxy) context.getInteractionModel();
            ListProxy variants = (ListProxy)
                    modelProxy.getPropertyProxy(PolicyModel.VARIANTS);
            boolean setSelection = false;
            for (int i = 0; !setSelection && i < variants.size(); i++) {
                VariantBuilder builder = (VariantBuilder)
                        variants.getItemProxy(i).getModelObject();
                if (previouslySelectedBuilder.equals(builder)) {
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

                defaultVariantType);
        ProxyLabelDecorator decorator = new ProxyLabelDecorator();
        ILabelProvider dlp = createLabelProvider(provider, decorator);

        viewer.setLabelProvider(dlp);
        BeanProxy policy = (BeanProxy) context.getInteractionModel();

        if (policy != null) {
            ListProxy deviceThemes = (ListProxy)
                    policy.getPropertyProxy(PolicyModel.VARIANTS);
            viewer.setInput(deviceThemes);
        }

        createActions();
        createButtons(displayArea);
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

                    }
                }

                // Javadoc inherited
                public void selectionMade(BuilderSelectionEvent event) {
                    BeanProxy selectedVariant = context.getSelectedVariant();
                    if (selectedVariant != null) {
                        boolean enableDesign = !selectedVariant.isReadOnly();
                        if (enableDesign != design.isEnabled()) {
                            design.setEnabled(enableDesign);
                        }
                    }
                }
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

        }

        if (previouslySelectedBuilder == null) {
            context.setSelectedVariant(null);
        } else {
            BeanProxy modelProxy = (BeanProxy) context.getInteractionModel();
            ListProxy variants = (ListProxy)
                    modelProxy.getPropertyProxy(PolicyModel.VARIANTS);
            boolean setSelection = false;
            for (int i = 0; !setSelection && i < variants.size(); i++) {
                VariantBuilder builder = (VariantBuilder)
                        variants.getItemProxy(i).getModelObject();
                if (previouslySelectedBuilder.equals(builder)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.