Package com.volantis.mcs.policies.variants.layout

Examples of com.volantis.mcs.policies.variants.layout.InternalLayoutContentBuilder


     * @param enabled True to enable the controls, false to disable
     */
    private void setLayoutEnabled(boolean enabled) {
        if (providesLayout) {
            // Retrieve the layout type - canvas, montage or null.
            InternalLayoutContentBuilder content =
                    (InternalLayoutContentBuilder) getModelContent();
            LayoutType layoutType = null;
            if (content != null) {
                Layout layout = content.getLayout();
                if (layout != null) {
                    layoutType = layout.getType();
                }
            }

View Full Code Here


     * Update the model from the layout content controls.
     */
    private void updateLayoutModel() {
        ContentBuilder contentBuilder = getModelContent();
        if (contentBuilder != null) {
            InternalLayoutContentBuilder layoutContent =
                    (InternalLayoutContentBuilder) contentBuilder;
            Layout layout = layoutContent.getLayout();

            boolean changed = false;
            String defaultFragment = layout.getDefaultFragmentName();
            String defaultSegment = layout.getDefaultSegmentName();

View Full Code Here

    /**
     * Refresh the combos for default targets.
     */
    private void refreshTargets() {
        InternalLayoutContentBuilder builder =
                (InternalLayoutContentBuilder) getModelContent();
        if (builder != null) {
            Layout layout = builder.getLayout();
            if (layout != null) {
                // Preserve the current values before we update the input -
                // this is required because combo viewers handle changing inputs
                // badly, losing any pre-entered values.
                String defaultFragment = layout.getDefaultFragmentName();
View Full Code Here

            final VariantBuilder variantBuilder =
                (VariantBuilder) variantBuilderProxy.getModelObject();
            ContentBuilder contentBuilder = variantBuilder.getContentBuilder();

            if (contentBuilder == null) {
                final InternalLayoutContentBuilder layoutBuilder =
                    InternalPolicyFactory.getInternalInstance().
                        createLayoutContentBuilder();
                final CanvasLayout layout = new CanvasLayout();
                layoutBuilder.setLayout(layout);
                contentBuilder = layoutBuilder;
            }
            final JiBXWriter writer = new JiBXWriter();
            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
            writer.write(new OutputStreamWriter(baos), contentBuilder);
View Full Code Here

    public void performFinish(List variants) {
        super.performFinish(variants);
        Iterator it = variants.iterator();
        while (it.hasNext()) {
            VariantBuilder variant = (VariantBuilder) it.next();
            InternalLayoutContentBuilder content = (InternalLayoutContentBuilder)
                    ((InternalPolicyFactory) POLICY_FACTORY).createLayoutContentBuilder();
            LayoutType type = null;
            Object selected = ((IStructuredSelection) layoutType.
                    getSelection()).getFirstElement();
            if (selected instanceof LayoutType) {
                type = (LayoutType) selected;
            }

            Layout layout = null;
            if (type == LayoutType.CANVAS) {
                layout = new CanvasLayout();
            } else if (type == LayoutType.MONTAGE) {
                layout = new MontageLayout(null);
            }

            if (type == null) {
                variant.setContentBuilder(null);
                variant.setVariantType(VariantType.NULL);
            } else {
                content.setLayout(layout);
                variant.setContentBuilder(content);
            }
        }
    }
View Full Code Here

            if (model != null && model instanceof VariantBuilder) {
                VariantBuilder variant = (VariantBuilder) model;
                VariantType type = variant.getVariantType();

                if (type == VariantType.LAYOUT) {
                    InternalLayoutContentBuilder content =
                            (InternalLayoutContentBuilder)
                            variant.getContentBuilder();
                    if (content != null) {
                        Layout layout = content.getLayout();
                        if (layout != null) {
                            key = layout.getType().toString();
                        }
                    }
                } else {
View Full Code Here

            if (model != null && model instanceof VariantBuilder) {
                VariantBuilder variant = (VariantBuilder) model;
                VariantType type = variant.getVariantType();

                if (type == VariantType.LAYOUT) {
                    InternalLayoutContentBuilder content =
                            (InternalLayoutContentBuilder)
                            variant.getContentBuilder();
                    if (content != null) {
                        Layout layout = content.getLayout();
                        if (layout != null) {
                            key = layout.getType().toString();
                        }
                    }
                } else {
View Full Code Here

            if (model != null && model instanceof VariantBuilder) {
                VariantBuilder variant = (VariantBuilder) model;
                VariantType type = variant.getVariantType();

                if (type == VariantType.LAYOUT) {
                    InternalLayoutContentBuilder content =
                            (InternalLayoutContentBuilder)
                            variant.getContentBuilder();
                    if (content != null) {
                        Layout layout = content.getLayout();
                        if (layout != null) {
                            image = (Image) LAYOUT_ICONS.get(layout.getType());
                        }
                    }
                } else {
View Full Code Here

         builder.popFormat();
         Layout layout = builder.getLayout();

         InternalPolicyFactory policyFactory = (InternalPolicyFactory)
                 PolicyFactory.getDefaultInstance();
         InternalLayoutContentBuilder layoutContent =
                 policyFactory.createLayoutContentBuilder();
         layoutContent.setLayout(layout);

         StyleSheetActivator styleSheetActivator =
                 new StyleSheetActivatorImpl(null, null);

         // Activate it to turn it into a runtime device layout
         LayoutContentActivator activator = new LayoutContentActivator();
         final ActivatedLayoutContent activatedLayoutContent =
                 activator.activateLayoutContent(styleSheetActivator,
                         (InternalLayoutContent) layoutContent.getContent());
         RuntimeDeviceLayout runtimeLayout = new RuntimeLayoutAdapter(
                 "<anonymous>", layout,
                 activatedLayoutContent.getCompiledStyleSheet(),
                 activatedLayoutContent.getContainerNameToFragments());
View Full Code Here

        builder.popFormat();
        Layout layout = builder.getLayout();

        InternalPolicyFactory policyFactory = (InternalPolicyFactory)
                PolicyFactory.getDefaultInstance();
        InternalLayoutContentBuilder layoutContent =
                policyFactory.createLayoutContentBuilder();
        layoutContent.setLayout(layout);

        StyleSheetActivator styleSheetActivator =
                new StyleSheetActivatorImpl(null, null);

        // Activate it to turn it into a runtime device layout
        LayoutContentActivator activator = new LayoutContentActivator();
        final ActivatedLayoutContent activatedLayoutContent =
                activator.activateLayoutContent(styleSheetActivator,
                        (InternalLayoutContent) layoutContent.getContent());
        RuntimeDeviceLayout runtimeLayout = new RuntimeLayoutAdapter(
                "<anonymous>", layout,
                activatedLayoutContent.getCompiledStyleSheet(),
                activatedLayoutContent.getContainerNameToFragments());
View Full Code Here

TOP

Related Classes of com.volantis.mcs.policies.variants.layout.InternalLayoutContentBuilder

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.