Package com.volantis.mcs.interaction

Examples of com.volantis.mcs.interaction.BaseProxy


    /**
     * Update the theme model from the GUI.
     */
    private void updateThemeModel() {
        BaseProxy baseContentProxy = (BaseProxy) context.getSelectedVariant().getPropertyProxy(PolicyModel.CONTENT);
        Proxy contentProxy = baseContentProxy.getConcreteProxy();
        if (contentProxy != null) {
            BeanProxy contentBeanProxy = (BeanProxy) contentProxy;
            Proxy importParent = contentBeanProxy.getPropertyProxy(ThemeModel.IMPORT_PARENT_DEVICE_THEME);
            importParent.setModelObject(Boolean.valueOf(importParentCheckbox.getSelection()));
        } else {
View Full Code Here


            oldRules.removeDiagnosticListener(tableRefresher);
        }
        ruleTable.setInput(null);

        if (!nullType && deviceTheme != null) {
            BaseProxy content = (BaseProxy) deviceTheme.getPropertyProxy(PolicyModel.CONTENT);
            BeanProxy concreteContent = (BeanProxy) content.getConcreteProxy();
            if (concreteContent == null && !content.isReadOnly()) {
                ThemeContentBuilder contentModel =
                        InternalPolicyFactory.getInternalInstance().createThemeContentBuilder();
                content.setModelObject(contentModel);
                concreteContent = (BeanProxy) content.getConcreteProxy();
            }

            if (concreteContent != null) {
                BeanProxy styleSheet = (BeanProxy) concreteContent.
                        getPropertyProxy(ThemeModel.STYLE_SHEET);
View Full Code Here

        }
    }

    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

     * then an attempt is made to set the input correctly (from the currently
     * selected variant).
     */
    private void refreshRuleTable() {
        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);
View Full Code Here

         *         found.
         */
        private ListProxy getRulesFromVariant(BeanProxy variant) {
            ListProxy rules = null;

            BaseProxy content = (BaseProxy)
                    variant.getPropertyProxy(PolicyModel.CONTENT);
            BeanProxy themeContent = (BeanProxy) content.getConcreteProxy();
            if (themeContent != null) {
                BeanProxy stylesheet = (BeanProxy)
                        themeContent.getPropertyProxy(ThemeModel.STYLE_SHEET);
                rules = (ListProxy) stylesheet.
                        getPropertyProxy(ThemeModel.RULES);
View Full Code Here

        boolean enabled;
        if (newVariantType == VariantType.NULL) {

            BeanProxy selectedVariant = context.getSelectedVariant();
            if (selectedVariant != null) {
                BaseProxy metadataBase =
                    (BaseProxy)selectedVariant
                        .getPropertyProxy(PolicyModel.META_DATA);
                if (metadataBase != null) {
                    Operation setValue =
                        metadataBase.prepareSetModelObjectOperation(null);
                    context.executeOperation(setValue);
                }
            }

            enabled = false;
View Full Code Here

     */
    private BeanProxy getMetadataProxy() {
        BeanProxy metadataProxy = null;
        BeanProxy selectedVariant = context.getSelectedVariant();
        if (selectedVariant != null) {
            BaseProxy metadataBase = (BaseProxy) selectedVariant.getPropertyProxy(PolicyModel.META_DATA);
            if (metadataBase != null) {
                metadataProxy = (BeanProxy) metadataBase.getConcreteProxy();
                // If we have no concrete metadata, create an empty one of the
                // appropriate type unless the data is read only or the variant
                // type precludes this.
                Proxy typeProxy = selectedVariant.getPropertyProxy(PolicyModel.VARIANT_TYPE);
                if (metadataProxy == null && !metadataBase.isReadOnly() &&
                        typeProxy.getModelObject() != VariantType.NULL) {
                    MetaDataBuilder metaDataBuilder = getDefaultMetaDataBuilder();
                    metadataBase.setModelObject(metaDataBuilder);

                    // Now that we've set a concrete model object, we should
                    // have a concrete proxy.
                    metadataProxy = (BeanProxy) metadataBase.getConcreteProxy();
                }
            }
        }
        return metadataProxy;
    }
View Full Code Here

     */
    private Proxy getSelectionProxy() {
        Proxy selectionProxy = null;
        BeanProxy selectedVariant = context.getSelectedVariant();
        if (selectedVariant != null) {
            BaseProxy selectionBase = (BaseProxy) selectedVariant.getPropertyProxy(PolicyModel.SELECTION);
            if (selectionBase != null) {
                selectionProxy = selectionBase.getConcreteProxy();
                // If we have no concrete metadata, create an empty one of the
                // appropriate type
                if (selectionProxy == null) {
                    SelectionBuilder selection = getDefaultSelectionBuilder();
                    selectionBase.setModelObject(selection);

                    // Now that we've set a concrete model object, we should
                    // have a concrete proxy.
                    selectionProxy = selectionBase.getConcreteProxy();
                }
            }
        }
        return selectionProxy;
    }
View Full Code Here

TOP

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

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.