001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.dynamicdatamapping.model;
016    
017    import java.util.ArrayList;
018    import java.util.List;
019    import java.util.Locale;
020    
021    /**
022     * @author Marcellus Tavares
023     */
024    public class DDMFormLayout {
025    
026            public DDMFormLayout() {
027            }
028    
029            public DDMFormLayout(DDMFormLayout ddmFormLayout) {
030                    _defaultLocale = ddmFormLayout._defaultLocale;
031    
032                    for (DDMFormLayoutPage ddmFormLayoutPage :
033                                    ddmFormLayout._ddmFormLayoutPages) {
034    
035                            addDDMFormLayoutPage(new DDMFormLayoutPage(ddmFormLayoutPage));
036                    }
037            }
038    
039            public void addDDMFormLayoutPage(DDMFormLayoutPage ddmFormLayoutPage) {
040                    _ddmFormLayoutPages.add(ddmFormLayoutPage);
041            }
042    
043            public DDMFormLayoutPage getDDMFormLayoutPage(int index) {
044                    return _ddmFormLayoutPages.get(index);
045            }
046    
047            public List<DDMFormLayoutPage> getDDMFormLayoutPages() {
048                    return _ddmFormLayoutPages;
049            }
050    
051            public Locale getDefaultLocale() {
052                    return _defaultLocale;
053            }
054    
055            public void setDDMFormLayoutPages(
056                    List<DDMFormLayoutPage> ddmFormLayoutPages) {
057    
058                    _ddmFormLayoutPages = ddmFormLayoutPages;
059            }
060    
061            public void setDefaultLocale(Locale defaultLocale) {
062                    _defaultLocale = defaultLocale;
063            }
064    
065            private List<DDMFormLayoutPage> _ddmFormLayoutPages = new ArrayList<>();
066            private Locale _defaultLocale;
067    
068    }