Rev 245 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 207 | 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 | |||
| 242 | espaco | 20 | import javax.inject.Named; |
| 21 | |||
| 207 | espaco | 22 | import org.springframework.context.annotation.Scope; |
| 23 | |||
| 245 | espaco | 24 | import br.com.ec.web.exception.VerificadorLancamentoException; |
| 25 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
||
| 26 | import br.com.ec.web.message.LancadorMensagem; |
||
| 27 | |||
| 242 | espaco | 28 | @Named |
| 207 | espaco | 29 | @Scope("session") |
| 30 | public class GuestPreferences implements Serializable { |
||
| 31 | |||
| 32 | private String inputStyleClass = ""; |
||
| 33 | private String topbarTheme = "light"; |
||
| 34 | private String menuTheme = "dim"; |
||
| 35 | private String menuMode = ""; |
||
| 36 | private String darkMode = "light"; |
||
| 37 | private String componentTheme = ""; |
||
| 209 | espaco | 38 | private boolean orientationRTL = false; |
| 207 | espaco | 39 | |
| 413 | espaco | 40 | public GuestPreferences() {} |
| 41 | |||
| 207 | espaco | 42 | public String getInputStyleClass() { |
| 43 | return inputStyleClass; |
||
| 44 | } |
||
| 45 | public void setInputStyleClass(String inputStyleClass) { |
||
| 46 | this.inputStyleClass = inputStyleClass; |
||
| 47 | } |
||
| 48 | |||
| 49 | public String getTopbarTheme() { |
||
| 50 | return topbarTheme; |
||
| 51 | } |
||
| 52 | public void setTopbarTheme(String topbarTheme) { |
||
| 53 | this.topbarTheme = topbarTheme; |
||
| 54 | } |
||
| 55 | |||
| 56 | public String getMenuTheme() { |
||
| 57 | return menuTheme; |
||
| 58 | } |
||
| 59 | public void setMenuTheme(String menuTheme) { |
||
| 60 | this.menuTheme = menuTheme; |
||
| 61 | } |
||
| 62 | |||
| 63 | public String getMenuMode() { |
||
| 64 | return menuMode; |
||
| 65 | } |
||
| 66 | public void setMenuMode(String menuMode) { |
||
| 67 | this.menuMode = menuMode; |
||
| 68 | } |
||
| 69 | |||
| 70 | public String getDarkMode() { |
||
| 71 | return darkMode; |
||
| 72 | } |
||
| 73 | public void setDarkMode(String darkMode) { |
||
| 74 | this.darkMode = darkMode; |
||
| 75 | } |
||
| 76 | |||
| 77 | public boolean isOrientationRTL() { |
||
| 78 | return orientationRTL; |
||
| 79 | } |
||
| 80 | public void setOrientationRTL(boolean orientationRTL) { |
||
| 81 | this.orientationRTL = orientationRTL; |
||
| 82 | } |
||
| 245 | espaco | 83 | |
| 84 | public String getComponentTheme() { |
||
| 85 | return componentTheme; |
||
| 86 | } |
||
| 87 | public void setComponentTheme(String componentTheme) { |
||
| 88 | this.componentTheme = componentTheme; |
||
| 89 | } |
||
| 90 | |||
| 91 | public void confirmarMudancas() { |
||
| 92 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 93 | public void execute() { |
||
| 94 | LancadorMensagem.lancarSucessoRedirecionandoTela("CONFIGURAÇÃO ALTERARA!", "/sistema/configuracoes.xhtml"); |
||
| 95 | } |
||
| 96 | }); |
||
| 97 | } |
||
| 98 | |||
| 207 | espaco | 99 | /* |
| 100 | private Map<String,String> themeColors; |
||
| 101 | |||
| 102 | private String theme = "blue"; |
||
| 103 | |||
| 104 | private String menuLayout = "static"; |
||
| 105 | |||
| 106 | @PostConstruct |
||
| 107 | public void init() { |
||
| 108 | themeColors = new HashMap<String,String>(); |
||
| 109 | themeColors.put("turquoise", "#00acac"); |
||
| 110 | themeColors.put("blue", "#2f8ee5"); |
||
| 111 | themeColors.put("orange", "#efa64c"); |
||
| 112 | themeColors.put("purple", "#6c76af"); |
||
| 113 | themeColors.put("pink", "#f16383"); |
||
| 114 | themeColors.put("light-blue", "#63c9f1"); |
||
| 115 | themeColors.put("green", "#57c279"); |
||
| 116 | themeColors.put("deep-purple", "#7e57c2"); |
||
| 117 | } |
||
| 118 | |||
| 119 | public String getTopbarTheme() { |
||
| 120 | return "light"; |
||
| 121 | } |
||
| 122 | |||
| 123 | public String getTheme() { |
||
| 124 | return theme; |
||
| 125 | } |
||
| 126 | |||
| 127 | public String getMenuLayout() { |
||
| 128 | if(this.menuLayout.equals("static")) |
||
| 129 | return "menu-layout-static"; |
||
| 130 | else if(this.menuLayout.equals("overlay")) |
||
| 131 | return "menu-layout-overlay"; |
||
| 132 | else if(this.menuLayout.equals("horizontal")) |
||
| 133 | return "menu-layout-static menu-layout-horizontal"; |
||
| 134 | else |
||
| 135 | return "menu-layout-static"; |
||
| 136 | } |
||
| 137 | |||
| 138 | public void setTheme(String theme) { |
||
| 139 | this.theme = theme; |
||
| 140 | } |
||
| 141 | |||
| 142 | public void setMenuLayout(String menuLayout) { |
||
| 143 | this.menuLayout = menuLayout; |
||
| 144 | } |
||
| 145 | |||
| 146 | public Map getThemeColors() { |
||
| 147 | return this.themeColors; |
||
| 148 | } |
||
| 149 | */ |
||
| 150 | } |