Examples of BeanProxy


Examples of com.volantis.mcs.interaction.BeanProxy

     * @return an add action
     */
    public Action createAddVariantAction(final EditorContext context) {
        Action addAction = new Action() {
            public void run() {
                BeanProxy theme = (BeanProxy) context.getInteractionModel();
                ListProxy variants = (ListProxy)
                        theme.getPropertyProxy(PolicyModel.VARIANTS);

                final VariantType variantType =
                    ((PolicyEditorContext) context).getDefaultVariantType();
                VariantBuilder newVariant = PolicyFactory.getDefaultInstance().
                        createVariantBuilder(variantType);
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

     * @return a new action for the currently selected variant
     */
    public Action createNewVariantAction(final EditorContext context, final Control control) {
        Action newAction = new Action() {
            public void run() {
                BeanProxy interactionModel = (BeanProxy) context.getInteractionModel();
                ListProxy variantsModel = (ListProxy) interactionModel.getPropertyProxy(PolicyModel.VARIANTS);
                VariantType type = ((PolicyEditorContext) context).getDefaultVariantType();
                NewVariantWizard wizard = NewVariantWizard.createNewVariantWizard(type, variantsModel, context);
                wizard.init(null, null);
                // Instantiates the wizard container with the wizard and opens it
                WizardDialog dialog = new WizardDialog(control.getShell(), wizard);
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

        return ThemeFactory.getDefaultInstance().getRuleClass();
    }

    // Javadoc not required
    public void setSelectedVariant(BeanProxy newVariant) {
        BeanProxy oldVariant = selectedVariant;
        selectedVariant = newVariant;
        if (!ObjectHelper.equals(oldVariant, newVariant)) {
            fireSelectedVariantChanged(oldVariant, newVariant);
        }
    }
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

                if (event.getOldSelection() != null) {
                    ((Proxy) event.getOldSelection()).removeListener(readOnlyListener);
                }

                if (event.getSelection() != null) {
                    BeanProxy selectedVariant = (BeanProxy) event.getSelection();
                    selectedVariant.addListener(readOnlyListener, false);
                }
            }
        });

    }
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

        formPage.setMinSize(scrollable.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    }

    public void updateDisplay() {
        BeanProxy selectedVariant =
                ((ThemeEditorContext) getContext()).getSelectedVariant();

        if (selectedVariant == null) {
            displayAreaLayout.topControl = messagePage;
        } else {
            // Disable design for null types
            Proxy type = ((BeanProxy) selectedVariant).
                    getPropertyProxy(PolicyModel.VARIANT_TYPE);
            boolean nullType = VariantType.NULL == type.getModelObject();

            if (nullType) {
                displayAreaLayout.topControl = nullVariantPage;
            } else {
                // TODO better This is silly - try again...
                String deviceName =
                        String.valueOf(selectedVariant.getModelObject());
                designLabel.setText(designMessageFormat.format(
                        new Object[] {deviceName}));
                designLabel.pack();
                displayAreaLayout.topControl = formPage;
            }
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

        });
    }

    private void handleRuleSelection(SelectionChangedEvent event) {
        IStructuredSelection selection = (IStructuredSelection) event.getSelection();
        BeanProxy ruleProxy = (BeanProxy) selection.getFirstElement();
        BeanProxy stylePropertiesProxy = null;
        if (ruleProxy != null) {
            stylePropertiesProxy = (BeanProxy) ruleProxy.getPropertyProxy(Rule.STYLE_PROPERTIES);
        }
        stylePropertiesSection.setStyleProperties(stylePropertiesProxy);
    }
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

    private void selectedVariantChanged() {
        if (variantTypeProxy != null) {
            variantTypeProxy.removeListener(typeChangeListener);
        }

        final BeanProxy variantBuilderProxy = getSelectedVariant();
        if (variantBuilderProxy != null) {
            variantTypeProxy = variantBuilderProxy.
                    getPropertyProxy(PolicyModel.VARIANT_TYPE);
            if (variantTypeProxy != null) {
                variantTypeProxy.addListener(typeChangeListener, false);
            }
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

            public void savePolicy(PolicyBuilder policy, IResource policyResource, IProgressMonitor monitor) throws PolicyFileAccessException {
                try {
                    final Set entries = variantBuilderProxyToRootElement.entrySet();
                    for (Iterator iter = entries.iterator(); iter.hasNext(); ) {
                        final Map.Entry entry = (Map.Entry) iter.next();
                        final BeanProxy variantBuilderProxy =
                            (BeanProxy) entry.getKey();
                        final Proxy contentBuilderProxy =
                            variantBuilderProxy.getPropertyProxy(PolicyModel.CONTENT);
                        if (VariantType.NULL == variantBuilderProxy.getPropertyProxy(
                                PolicyModel.VARIANT_TYPE).getModelObject()) {
                            contentBuilderProxy.setModelObject(null);
                        } else if (!contentBuilderProxy.isReadOnly()) {
                            final ODOMElement element = (ODOMElement) entry.getValue();
                            final ContentBuilder contentBuilder = documentToBuilder(
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

     * Returns true iff there is no selected variant or it is read only
     * @return the read only status of the selected variant
     */
    public boolean isSelectedVariantReadOnly() {
        boolean readOnly = false;
        final BeanProxy selectedVariantProxy = getSelectedVariant();
        if (selectedVariantProxy == null) {
            readOnly = true;
        } else {
            final VariantBuilder selectedVariant =
                (VariantBuilder) selectedVariantProxy.getModelObject();
            if (selectedVariant == null) {
               readOnly = true;
            }
        }
        return readOnly;
View Full Code Here

Examples of com.volantis.mcs.interaction.BeanProxy

        }
        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);
                Proxy rules = styleSheet.getPropertyProxy(ThemeModel.RULES);
                ruleTable.setInput(rules);
                rules.addListener(tableRefresher, true);
                rules.addDiagnosticListener(tableRefresher);
            }
        }
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.