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.portal.editor.configuration;
016    
017    import com.liferay.portal.kernel.editor.configuration.EditorConfiguration;
018    import com.liferay.portal.kernel.editor.configuration.EditorOptions;
019    import com.liferay.portal.kernel.json.JSONObject;
020    
021    import java.util.HashMap;
022    import java.util.Map;
023    
024    /**
025     * @author Sergio Gonz??lez
026     */
027    public class EditorConfigurationImpl implements EditorConfiguration {
028    
029            public EditorConfigurationImpl(
030                    JSONObject configJSONObject, EditorOptions editorOptions) {
031    
032                    _configJSONObject = configJSONObject;
033                    _editorOptions = editorOptions;
034            }
035    
036            @Override
037            public JSONObject getConfigJSONObject() {
038                    return _configJSONObject;
039            }
040    
041            @Override
042            public Map<String, Object> getData() {
043                    Map<String, Object> data = new HashMap<>();
044    
045                    data.put("editorConfig", _configJSONObject);
046                    data.put("editorOptions", _editorOptions);
047    
048                    return data;
049            }
050    
051            @Override
052            public EditorOptions getEditorOptions() {
053                    return _editorOptions;
054            }
055    
056            private final JSONObject _configJSONObject;
057            private final EditorOptions _editorOptions;
058    
059    }