| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| UpdateUpdatableAction |
|
| 1.0;1 |
| 1 | package org.jtheque.core.managers.view.impl.actions.module; | |
| 2 | ||
| 3 | /* | |
| 4 | * This file is part of JTheque. | |
| 5 | * | |
| 6 | * JTheque is free software: you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation, either version 3 of the License. | |
| 9 | * | |
| 10 | * JTheque is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | */ | |
| 18 | ||
| 19 | import org.jtheque.core.managers.Managers; | |
| 20 | import org.jtheque.core.managers.update.IUpdateManager; | |
| 21 | import org.jtheque.core.managers.update.Updatable; | |
| 22 | import org.jtheque.core.managers.view.able.IViewManager; | |
| 23 | ||
| 24 | /** | |
| 25 | * An action to update a module. | |
| 26 | * | |
| 27 | * @author Baptiste Wicht | |
| 28 | */ | |
| 29 | 0 | public final class UpdateUpdatableAction extends AbstractUpdateAction { |
| 30 | /** | |
| 31 | * Construct a new UpdateModuleAction. | |
| 32 | */ | |
| 33 | public UpdateUpdatableAction() { | |
| 34 | 0 | super("modules.actions.update"); |
| 35 | 0 | } |
| 36 | ||
| 37 | @Override | |
| 38 | boolean isUpToDate() { | |
| 39 | 0 | return Managers.getManager(IUpdateManager.class).isUpToDate(getSelectedObject()); |
| 40 | } | |
| 41 | ||
| 42 | @Override | |
| 43 | String getMessage() { | |
| 44 | 0 | return "updatable"; |
| 45 | } | |
| 46 | ||
| 47 | @Override | |
| 48 | Updatable getSelectedObject() { | |
| 49 | 0 | return Managers.getManager(IViewManager.class).getViews().getModuleView().getSelectedUpdatable(); |
| 50 | } | |
| 51 | } |