001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    }