| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| IFeatureManager |
|
| 1.0;1 | ||||
| IFeatureManager$CoreFeature |
|
| 1.0;1 |
| 1 | package org.jtheque.core.managers.feature; | |
| 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.feature.Feature.FeatureType; | |
| 20 | ||
| 21 | import java.util.Collection; | |
| 22 | ||
| 23 | /** | |
| 24 | * A feature manager specification. | |
| 25 | * | |
| 26 | * @author Baptiste Wicht | |
| 27 | */ | |
| 28 | public interface IFeatureManager { | |
| 29 | /** | |
| 30 | * An enumeration of the core features. | |
| 31 | */ | |
| 32 | 0 | enum CoreFeature { |
| 33 | 0 | FILE, |
| 34 | 0 | EDIT, |
| 35 | 0 | ADVANCED, |
| 36 | 0 | HELP |
| 37 | } | |
| 38 | ||
| 39 | /** | |
| 40 | * Add a menu to the application. It's an object who contains some features that will be | |
| 41 | * added to the menu bar. | |
| 42 | * | |
| 43 | * @param menu The menu to add to the application. | |
| 44 | */ | |
| 45 | void addMenu(Menu menu); | |
| 46 | ||
| 47 | /** | |
| 48 | * Remove the menu from the application. | |
| 49 | * | |
| 50 | * @param menu The menu to remove. | |
| 51 | */ | |
| 52 | void removeMenu(Menu menu); | |
| 53 | ||
| 54 | /** | |
| 55 | * Return all the features of the application. | |
| 56 | * | |
| 57 | * @return A List containing all the features. | |
| 58 | */ | |
| 59 | Collection<Feature> getFeatures(); | |
| 60 | ||
| 61 | /** | |
| 62 | * Return the core feature. | |
| 63 | * | |
| 64 | * @param feature The feature type. | |
| 65 | * @return The searched feature. | |
| 66 | */ | |
| 67 | Feature getFeature(CoreFeature feature); | |
| 68 | ||
| 69 | /** | |
| 70 | * Add a feature listener. | |
| 71 | * | |
| 72 | * @param listener The feature listener to add. | |
| 73 | */ | |
| 74 | void addFeatureListener(FeatureListener listener); | |
| 75 | ||
| 76 | /** | |
| 77 | * Remove a feature listener. | |
| 78 | * | |
| 79 | * @param listener The feature listener to remove. | |
| 80 | */ | |
| 81 | void removeFeatureListener(FeatureListener listener); | |
| 82 | ||
| 83 | /* Deprecated old methods */ | |
| 84 | ||
| 85 | /** | |
| 86 | * Create a feature. | |
| 87 | * | |
| 88 | * It's better to create a Custom Menu and to add it using addMenu method. | |
| 89 | * | |
| 90 | * @param position The position of the feature. | |
| 91 | * @param type The type of the feature. | |
| 92 | * @param key The internationalization key. | |
| 93 | * @return The created feature. | |
| 94 | */ | |
| 95 | @Deprecated | |
| 96 | Feature createFeature(int position, FeatureType type, String key); | |
| 97 | ||
| 98 | /** | |
| 99 | * Add a sub feature to a parent feature. | |
| 100 | * | |
| 101 | * It's better to create a Custom Menu and to add it using addMenu method. | |
| 102 | * | |
| 103 | * @param parent The parent feature. | |
| 104 | * @param actionName The bean name of the action. | |
| 105 | * @param type The type of the sub feature. | |
| 106 | * @param position The position of the sub feature. | |
| 107 | * @param icon The icon of the action. | |
| 108 | * @param baseName The images base name. | |
| 109 | * @return The sub feature. | |
| 110 | */ | |
| 111 | @Deprecated | |
| 112 | Feature addSubFeature(Feature parent, String actionName, FeatureType type, int position, String baseName, String icon); | |
| 113 | ||
| 114 | /** | |
| 115 | * Add a sub feature to a parent feature. | |
| 116 | * | |
| 117 | * It's better to create a Custom Menu and to add it using addMenu method. | |
| 118 | * | |
| 119 | * @param parent The parent feature. | |
| 120 | * @param actionName The bean name of the action. | |
| 121 | * @param type The type of the sub feature. | |
| 122 | * @param position The position of the sub feature. | |
| 123 | * @return The sub feature. | |
| 124 | */ | |
| 125 | @Deprecated | |
| 126 | Feature addSubFeature(Feature parent, String actionName, FeatureType type, int position); | |
| 127 | ||
| 128 | /** | |
| 129 | * Add a feature. | |
| 130 | * | |
| 131 | * It's better to create a Custom Menu and to add it using addMenu method. | |
| 132 | * | |
| 133 | * @param feature The feature to add. | |
| 134 | */ | |
| 135 | @Deprecated | |
| 136 | void addFeature(Feature feature); | |
| 137 | ||
| 138 | /** | |
| 139 | * Remove a feature. | |
| 140 | * | |
| 141 | * It's better to create a Custom Menu and to add it using addMenu method. | |
| 142 | * | |
| 143 | * @param feature The feature to remove. | |
| 144 | */ | |
| 145 | @Deprecated | |
| 146 | void removeFeature(Feature feature); | |
| 147 | } |