Package com.volantis.mcs.policies.variants

Examples of com.volantis.mcs.policies.variants.VariantBuilder


    }

    // Javadoc inherited
    public void performFinish(List variants) {
        if (variants.isEmpty()) {
            final VariantBuilder variantBuilder =
                POLICY_FACTORY.createVariantBuilder(variantType);
            variants.add(variantBuilder);
            if (variantType == VariantType.THEME) {
                final ThemeContentBuilder contentBuilder =
                    InternalPolicyFactory.getInternalInstance().
                        createThemeContentBuilder();
                variantBuilder.setContentBuilder(contentBuilder);
            }
        }
        if (variants.size() == 1) {
            VariantBuilder variant = (VariantBuilder) variants.get(0);
            variant.setSelectionBuilder(getSelectionBuilder());
        }
    }
View Full Code Here


        List diagnostics = proxy.getDiagnostics();
        if (diagnostics != null && !diagnostics.isEmpty()) {
         
            Object model = proxy.getModelObject();
            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();
                        }
View Full Code Here

                pages[i].performFinish(variants);
            }

            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

        String key = "default";
        if (!proxy.isReadOnly()) {
         
            Object model = proxy.getModelObject();
            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();
                        }
View Full Code Here

     * @return The string value of that object
     */
    protected String render(Object o) {
        String rendered = "";
        if (o != null && o instanceof VariantBuilder) {
            VariantBuilder variant = (VariantBuilder) o;
            rendered = new VariantLabelRenderer().render(variant);
        }
        return rendered;
    }
View Full Code Here

        Image image = null;
        if (o != null) {
            Proxy proxy = (Proxy) o;
            Object model = proxy.getModelObject();
            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());
                        }
View Full Code Here

     * @throws IOException if there was a problem reading the image file.
     */
    public VariantBuilder createGenericImageVariant(File imageFile,
            String assetGroup, int widthHint) throws IOException {

        VariantBuilder variantBuilder =
                factory.createVariantBuilder(VariantType.IMAGE);

        GenericImageSelectionBuilder generic =
                factory.createGenericImageSelectionBuilder();
        generic.setWidthHint(widthHint);
        variantBuilder.setSelectionBuilder(generic);

        ImageMetaDataBuilder image = createImageMetaData(imageFile);
        variantBuilder.setMetaDataBuilder(image);

        URLContentBuilder content = createURLContent(assetGroup, imageFile);
        variantBuilder.setContentBuilder(content);

        return variantBuilder;

    }
View Full Code Here

     * @throws IOException if there was a problem reading the image file.
     */
    public VariantBuilder createConvertibleImageVariant(File imageFile,
            String assetGroup) throws IOException {

        VariantBuilder variantBuilder =
                factory.createVariantBuilder(VariantType.IMAGE);

        DefaultSelectionBuilder defaultSelection =
                factory.createDefaultSelectionBuilder();
        variantBuilder.setSelectionBuilder(defaultSelection);

        ImageMetaDataBuilder image = createImageMetaData(imageFile);
        image.setConversionMode(ImageConversionMode.ALWAYS_CONVERT);
        variantBuilder.setMetaDataBuilder(image);

        URLContentBuilder content = createURLContent(assetGroup, imageFile);
        variantBuilder.setContentBuilder(content);

        return variantBuilder;
    }
View Full Code Here

                public void perform(File assetFile) {

                    logger.info("convertable-asset-file-added-for-component",
                                new Object[] {assetFile,  policyBuilder});
                    try {
                        VariantBuilder variantBuilder =
                                assetFactory.createConvertibleImageVariant(
                                        assetFile, assetGroupName);
                        addAssetSafely(policyBuilder, variantBuilder);
                    } catch (Exception e) {
                        logger.error(
View Full Code Here

                logger.info("device-asset-file-added",
                            new Object[] {assetFile,
                                          deviceName,
                                          policyBuilder});
                try {
                    VariantBuilder variantBuilder =
                            assetFactory.createDeviceImageVariant(
                            assetFile, assetGroupName, deviceName);
                    addAssetSafely(policyBuilder, variantBuilder);
                } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.policies.variants.VariantBuilder

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.