001    /**
002     * Copyright (c) 2000-2013 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.portal.model.impl;
016    
017    import com.liferay.portal.kernel.util.UnicodeProperties;
018    import com.liferay.portal.model.Layout;
019    import com.liferay.portal.model.LayoutType;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public class LayoutTypeImpl implements LayoutType {
025    
026            public LayoutTypeImpl(Layout layout) {
027                    setLayout(layout);
028            }
029    
030            @Override
031            public Layout getLayout() {
032                    return _layout;
033            }
034    
035            @Override
036            public UnicodeProperties getTypeSettingsProperties() {
037                    return _layout.getTypeSettingsProperties();
038            }
039    
040            @Override
041            public String getTypeSettingsProperty(String key) {
042                    return getTypeSettingsProperty(key, null);
043            }
044    
045            @Override
046            public String getTypeSettingsProperty(String key, String defaultValue) {
047                    UnicodeProperties typeSettingsProperties = getTypeSettingsProperties();
048    
049                    return typeSettingsProperties.getProperty(key, defaultValue);
050            }
051    
052            @Override
053            public void setLayout(Layout layout) {
054                    _layout = layout;
055            }
056    
057            @Override
058            public void setTypeSettingsProperty(String key, String value) {
059                    UnicodeProperties typeSettingsProperties = getTypeSettingsProperties();
060    
061                    typeSettingsProperties.setProperty(key, value);
062            }
063    
064            private Layout _layout;
065    
066    }