1 /*
2  * aTunes
3  * Copyright (C) Alex Aranda, Sylvain Gaudard and contributors
4  *
5  * See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors
6  *
7  * http://www.atunes.org
8  * http://sourceforge.net/projects/atunes
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  */
20 
21 package net.sourceforge.atunes.kernel.actions;
22 
23 import net.sourceforge.atunes.model.IStateUI;
24 import net.sourceforge.atunes.model.IUIHandler;
25 import net.sourceforge.atunes.utils.I18nUtils;
26 
27 /**
28  * Shows or hides status bar
29  *
30  * @author fleax
31  *
32  */
33 public class ShowStatusBarAction extends CustomAbstractAction {
34 
35     private static final long serialVersionUID = 2303076465024539635L;
36 
37     private IUIHandler uiHandler;
38 
39     private IStateUI stateUI;
40 
41     /**
42      * @param stateUI
43      */
setStateUI(final IStateUI stateUI)44     public void setStateUI(final IStateUI stateUI) {
45 	this.stateUI = stateUI;
46     }
47 
48     /**
49      * @param uiHandler
50      */
setUiHandler(final IUIHandler uiHandler)51     public void setUiHandler(final IUIHandler uiHandler) {
52 	this.uiHandler = uiHandler;
53     }
54 
55     /**
56      * Default constructor
57      */
ShowStatusBarAction()58     public ShowStatusBarAction() {
59 	super(I18nUtils.getString("SHOW_STATUS_BAR"));
60     }
61 
62     @Override
initialize()63     protected void initialize() {
64 	super.initialize();
65 	putValue(SELECTED_KEY, stateUI.isShowStatusBar());
66     }
67 
68     @Override
executeAction()69     protected void executeAction() {
70 	uiHandler.showStatusBar((Boolean) getValue(SELECTED_KEY), true);
71     }
72 
73 }
74