Package com.volantis.mcs.interaction.operation

Examples of com.volantis.mcs.interaction.operation.Operation


     */
    private void setModelContent(ContentBuilder content) {
        BeanProxy selectedVariant = context.getSelectedVariant();
        if (selectedVariant != null) {
            Proxy contentProxy = selectedVariant.getPropertyProxy(PolicyModel.CONTENT);
            Operation setContent = contentProxy.prepareSetModelObjectOperation(content);
            context.executeOperation(setContent);
        }
    }
View Full Code Here


                            if (newAsset instanceof VariantBuilder) {
                                BeanProxy theme = (BeanProxy) context.getInteractionModel();
                                ListProxy variants = (ListProxy)
                                        theme.getPropertyProxy(PolicyModel.VARIANTS);
                                // TODO better We should probably check that we have the right sort of variant (or at least a compatible one)
                                Operation addOperation = variants.prepareAddModelItemOperation(newAsset);
                                context.executeOperation(addOperation);
                            }
                        }
                    }
                } finally {
View Full Code Here

                    final ThemeContentBuilder contentBuilder =
                        InternalPolicyFactory.getInternalInstance().
                            createThemeContentBuilder();
                    newVariant.setContentBuilder(contentBuilder);
                }
                Operation addOperation =
                        variants.prepareAddModelItemOperation(newVariant);
                context.executeOperation(addOperation);
            }
        };
        addAction.setText(EditorMessages.getString(RESOURCE_PREFIX +
View Full Code Here

                                PropertyDescriptor property,
                                Object newValue) {
                            Proxy propertyProxy = ((BeanProxy) context.
                                    getInteractionModel()).getPropertyProxy(
                                    property.getIdentifier());
                            Operation setOp = propertyProxy.
                                    prepareSetModelObjectOperation(newValue);
                            context.executeOperation(setOp);
                        }
                    });
        }
View Full Code Here

                Proxy categorisationScheme = model.getPropertyProxy(
                        PolicyModel.CATEGORISATION_SCHEME);

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

        int size = alternatePolicies.size();
        for (int i = size - 1; i >= 0; i--) {
            PolicyReference reference = (PolicyReference)
                    alternatePolicies.getItemProxy(i).getModelObject();
            if (reference.getExpectedPolicyType().equals(type)) {
                Operation removeOp = alternatePolicies
                        .prepareRemoveProxyItemOperation(
                                alternatePolicies.getItemProxy(i));
                context.executeOperation(removeOp);
            }
        }

        // Do not add an empty policy value as this is illlegal
        if (policy != null && policy.trim().length() > 0) {
            PolicyReference newReference = PolicyFactory.getDefaultInstance().
                    createPolicyReference(policy, type);
            Operation addOp =
                    alternatePolicies
                            .prepareAddModelItemOperation(newReference);
            context.executeOperation(addOp);
        }
    }
View Full Code Here

                    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

    private void createActions() {
        addAction = new Action() {
            public void run() {
                ListProxy rules = (ListProxy) getSelectedStyleSheetProxy().
                        getPropertyProxy(ThemeModel.RULES);
                Operation addOp = rules.prepareCreateAndAddProxyItemOperation();
                context.executeOperation(addOp);
                refreshRuleTable();
            }
        };
        addAction.setText(EditorMessages.getString(
                RESOURCE_PREFIX + "addAction.text"));

        newAction = new Action() {
            public void run() {
                SelectorGroupWizard wizard = new SelectorGroupWizard(
                        getShell(),
                        context.getProject());
                wizard.open();
                SelectorGroup group = wizard.getSelectorGroup();

                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);
                }
            }
        };
        newAction.setText(EditorMessages.getString(
                RESOURCE_PREFIX + "newAction.text"));

        deleteAction = new Action() {
            public void run() {
                ListProxy rules = (ListProxy) getSelectedStyleSheetProxy().
                        getPropertyProxy(ThemeModel.RULES);
                IStructuredSelection selection =
                        (IStructuredSelection) ruleTable.getSelection();
                if (!selection.isEmpty()) {
                    Proxy selected = (Proxy) selection.getFirstElement();
                    Operation delOp =
                            rules.prepareRemoveProxyItemOperation(selected);
                    context.executeOperation(delOp);
               
                    refreshRuleTable();
                }
View Full Code Here

            // don't alter the value (such as adding irrelevant whitespace)
            // from being seen as modifications leading to exceptions when
            // carrying out the set operation.
            if ((newPropertyValue == null) ? oldPropertyValue != null :
                    !newPropertyValue.equals(oldPropertyValue)) {
                Operation operation = valueProxy.prepareSetModelObjectOperation(newPropertyValue);
                context.executeOperation(operation);
            }
        }
    }
View Full Code Here

            }

            Iterator it = variants.iterator();
            while (it.hasNext()) {
                VariantBuilder next = (VariantBuilder) it.next();
                Operation addVariantOperation = variantList.prepareAddModelItemOperation(next);
                context.executeOperation(addVariantOperation);
            }

            finished = true;
        }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.interaction.operation.Operation

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.