Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
106 espaco 1
/*
2
 * Copyright 2009-2014 PrimeTek.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package br.com.ec.controller;
17
 
18
import java.io.Serializable;
19
import java.util.HashMap;
20
import java.util.Map;
21
 
22
import javax.annotation.PostConstruct;
23
import javax.inject.Named;
24
 
25
import org.springframework.context.annotation.Scope;
26
 
27
@Named
28
@Scope("session")
29
public class GuestPreferences implements Serializable {
30
 
31
    private Map<String,String> themeColors;
32
 
33
    private String theme = "blue";
34
 
35
    private String menuLayout = "static";
36
 
37
    @PostConstruct
38
    public void init() {
39
        themeColors = new HashMap<String,String>();
40
        themeColors.put("turquoise", "#00acac");
41
        themeColors.put("blue", "#2f8ee5");
42
        themeColors.put("orange", "#efa64c");
43
        themeColors.put("purple", "#6c76af");
44
        themeColors.put("pink", "#f16383");
45
        themeColors.put("light-blue", "#63c9f1");
46
        themeColors.put("green", "#57c279");
47
        themeColors.put("deep-purple", "#7e57c2");
48
    }
49
 
50
        public String getTheme() {             
51
                return theme;
52
        }
53
 
54
    public String getMenuLayout() {    
55
        if(this.menuLayout.equals("static"))
56
            return "menu-layout-static";
57
        else if(this.menuLayout.equals("overlay"))
58
            return "menu-layout-overlay";
59
        else if(this.menuLayout.equals("horizontal"))
60
            return "menu-layout-static menu-layout-horizontal";
61
        else
62
            return "menu-layout-static";
63
    }
64
 
65
        public void setTheme(String theme) {
66
                this.theme = theme;
67
        }
68
 
69
    public void setMenuLayout(String menuLayout) {
70
        this.menuLayout = menuLayout;
71
    }
72
 
73
    public Map getThemeColors() {
74
        return this.themeColors;
75
    }
76
}