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 org.jgrapes.core.Event;
022
023/**
024 * Notifies the server about a change of the web console layout. This event
025 * is sent by the browser when the layout changes due to user interaction
026 * (e.g. moving the preview representations) or due to notifications
027 * from the server (e.g. {@link RenderConlet}).
028 * 
029 * The server should persist the layout and pass it back to the browser
030 * in response to {@link ConsoleReady} (see this event's description
031 * for details). 
032 */
033public class ConsoleLayoutChanged extends Event<Void> {
034
035    private final String[] previewLayout;
036    private final String[] tabsLayout;
037    private final Object xtraInfo;
038
039    /**
040     * @param previewLayout
041     * @param tabsLayout
042     */
043    @SuppressWarnings("PMD.ArrayIsStoredDirectly")
044    public ConsoleLayoutChanged(String[] previewLayout, String[] tabsLayout,
045            Object xtraInfo) {
046        this.previewLayout = previewLayout;
047        this.tabsLayout = tabsLayout;
048        this.xtraInfo = xtraInfo;
049    }
050
051    /**
052     * @return the previewLayout
053     */
054    @SuppressWarnings("PMD.MethodReturnsInternalArray")
055    public String[] previewLayout() {
056        return previewLayout;
057    }
058
059    /**
060     * @return the tabsLayout
061     */
062    @SuppressWarnings("PMD.MethodReturnsInternalArray")
063    public String[] tabsLayout() {
064        return tabsLayout;
065    }
066
067    /**
068     * The extra information.
069     *
070     * @return the value
071     */
072    public Object xtraInfo() {
073        return xtraInfo;
074    }
075
076}