001/*
002 * JGrapes Event Driven Framework
003 * Copyright (C) 2017-2018 Michael N. Lipp
004 * 
005 * This program is free software; you can redistribute it and/or modify it 
006 * under the terms of the GNU Affero General Public License as published by 
007 * the Free Software Foundation; either version 3 of the License, or 
008 * (at your option) any later version.
009 * 
010 * This program is distributed in the hope that it will be useful, but 
011 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
012 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License 
013 * for more details.
014 * 
015 * You should have received a copy of the GNU Affero General Public License along 
016 * with this program; if not, see <http://www.gnu.org/licenses/>.
017 */
018
019package org.jgrapes.webconsole.base.events;
020
021import java.util.List;
022import org.jdrupes.json.JsonObject;
023import org.jgrapes.core.Event;
024
025/**
026 * Notifies the server about a change of the web console layout. This event
027 * is sent by the browser when the layout changes due to user interaction
028 * (e.g. moving the preview representations) or due to notifications
029 * from the server (e.g. {@link RenderConlet}).
030 * 
031 * The server should persist the layout and pass it back to the browser
032 * in response to {@link ConsoleReady} (see this event's description
033 * for details). 
034 */
035public class ConsoleLayoutChanged extends Event<Void> {
036
037    private final List<String> previewLayout;
038    private final List<String> tabsLayout;
039    private final JsonObject xtraInfo;
040
041    /**
042     * @param previewLayout
043     * @param tabsLayout
044     */
045    public ConsoleLayoutChanged(List<String> previewLayout,
046            List<String> tabsLayout, JsonObject xtraInfo) {
047        this.previewLayout = previewLayout;
048        this.tabsLayout = tabsLayout;
049        this.xtraInfo = xtraInfo;
050    }
051
052    /**
053     * @return the previewLayout
054     */
055    public List<String> previewLayout() {
056        return previewLayout;
057    }
058
059    /**
060     * @return the tabsLayout
061     */
062    public List<String> tabsLayout() {
063        return tabsLayout;
064    }
065
066    /**
067     * The extra information.
068     *
069     * @return the value
070     */
071    public JsonObject xtraInfo() {
072        return xtraInfo;
073    }
074
075}