| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| CloseBeanViewAction |
|
| 1.0;1 |
| 1 | package org.jtheque.core.managers.view.impl.actions.utils; | |
| 2 | ||
| 3 | import org.jtheque.core.managers.Managers; | |
| 4 | import org.jtheque.core.managers.beans.IBeansManager; | |
| 5 | import org.jtheque.core.managers.view.able.IView; | |
| 6 | import org.jtheque.core.managers.view.impl.actions.JThequeAction; | |
| 7 | ||
| 8 | import java.awt.event.ActionEvent; | |
| 9 | ||
| 10 | /* | |
| 11 | * This file is part of JTheque. | |
| 12 | * | |
| 13 | * JTheque is free software: you can redistribute it and/or modify | |
| 14 | * it under the terms of the GNU General Public License as published by | |
| 15 | * the Free Software Foundation, either version 3 of the License. | |
| 16 | * | |
| 17 | * JTheque is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
| 24 | */ | |
| 25 | ||
| 26 | /** | |
| 27 | * An action to close the view. | |
| 28 | * | |
| 29 | * @author Baptiste Wicht | |
| 30 | */ | |
| 31 | public final class CloseBeanViewAction extends JThequeAction { | |
| 32 | private final String view; | |
| 33 | ||
| 34 | /** | |
| 35 | * Construct a new CloseViewAction with a specific internationalization key. | |
| 36 | * | |
| 37 | * @param key The i18n key. | |
| 38 | * @param view The view to close, it's the spring id. | |
| 39 | */ | |
| 40 | public CloseBeanViewAction(String key, String view) { | |
| 41 | 0 | super(key); |
| 42 | ||
| 43 | 0 | this.view = view; |
| 44 | 0 | } |
| 45 | ||
| 46 | @Override | |
| 47 | public void actionPerformed(ActionEvent e) { | |
| 48 | 0 | Managers.getManager(IBeansManager.class).<IView>getBean(view).closeDown(); |
| 49 | 0 | } |
| 50 | } |