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.jqueryui.events;
020
021import org.jgrapes.core.Event;
022import org.jgrapes.webconsole.base.ConsoleWeblet;
023
024/**
025 * Signals that the theme for the web console has changed. This  event is
026 * handled by the {@link ConsoleWeblet} but may, of course, also be
027 * used by other components.
028 * 
029 * ![Event Sequence](SetTheme.svg)
030 * 
031 * @startuml SetTheme.svg
032 * hide footbox
033 * 
034 * Browser -> WebConsole: "settheme"
035 * activate WebConsole
036 * WebConsole -> ConsoleWeblet: SetTheme
037 * deactivate WebConsole
038 * activate ConsoleWeblet
039 * ConsoleWeblet -> Browser: "reload"
040 * deactivate ConsoleWeblet
041 * 
042 * @enduml
043 */
044public class SetTheme extends Event<Void> {
045
046    private final String theme;
047
048    /**
049     * Creates a new event.
050     * 
051     * @param theme the theme to set
052     */
053    public SetTheme(String theme) {
054        this.theme = theme;
055    }
056
057    /**
058     * Returns the theme to set.
059     * 
060     * @return the theme
061     */
062    public String theme() {
063        return theme;
064    }
065}