@Override public Category getCategory(final String categoryId) { return commandManager.getCategory(categoryId); }
@Override public Category getCategory(String categoryId) { return commandManager.getCategory(categoryId); }
/** * Returns the categories that are defined. * * @return The defined categories; this value may be empty, but it is never * <code>null</code>. * @since 3.2 */ public final Category[] getDefinedCategories() { final Category[] categories = new Category[definedCategoryIds.size()]; final Iterator<String> categoryIdItr = definedCategoryIds.iterator(); int i = 0; while (categoryIdItr.hasNext()) { String categoryId = categoryIdItr.next(); categories[i++] = getCategory(categoryId); } return categories; }
/** * Returns the categories that are defined. * * @return The defined categories; this value may be empty, but it is never * <code>null</code>. * @since 3.2 */ public final Category[] getDefinedCategories() { final Category[] categories = new Category[definedCategoryIds.size()]; final Iterator<String> categoryIdItr = definedCategoryIds.iterator(); int i = 0; while (categoryIdItr.hasNext()) { String categoryId = categoryIdItr.next(); categories[i++] = getCategory(categoryId); } return categories; }
/** * Returns the categories that are defined. * * @return The defined categories; this value may be empty, but it is never * <code>null</code>. * @since 3.2 */ public Category[] getDefinedCategories() { final Category[] categories = new Category[definedCategoryIds.size()]; final Iterator<String> categoryIdItr = definedCategoryIds.iterator(); int i = 0; while (categoryIdItr.hasNext()) { String categoryId = categoryIdItr.next(); categories[i++] = getCategory(categoryId); } return categories; }
/** * Sets the name and description of the category for uncategorized commands. * This is the category that will be returned if * {@link #getCategory(String)} is called with <code>null</code>. * * @param name * The name of the category for uncategorized commands; must not * be <code>null</code>. * @param description * The description of the category for uncategorized commands; * may be <code>null</code>. * @since 3.2 */ public final void defineUncategorizedCategory(final String name, final String description) { final Category category = getCategory(AUTOGENERATED_CATEGORY_ID); category.define(name, description); }
/** * Sets the name and description of the category for uncategorized commands. * This is the category that will be returned if * {@link #getCategory(String)} is called with <code>null</code>. * * @param name * The name of the category for uncategorized commands; must not * be <code>null</code>. * @param description * The description of the category for uncategorized commands; * may be <code>null</code>. * @since 3.2 */ public void defineUncategorizedCategory(final String name, final String description) { final Category category = getCategory(AUTOGENERATED_CATEGORY_ID); category.define(name, description); }
/** * Sets the name and description of the category for uncategorized commands. * This is the category that will be returned if * {@link #getCategory(String)} is called with <code>null</code>. * * @param name * The name of the category for uncategorized commands; must not * be <code>null</code>. * @param description * The description of the category for uncategorized commands; * may be <code>null</code>. * @since 3.2 */ public final void defineUncategorizedCategory(final String name, final String description) { final Category category = getCategory(AUTOGENERATED_CATEGORY_ID); category.define(name, description); }
@Override public Category defineCategory(String id, String name, String description) { Category cat = commandManager.getCategory(id); if (!cat.isDefined()) { cat.define(name, description); } return cat; }
/** * Gets the category with the given identifier. If no such category * currently exists, then the category will be created (but be undefined). * * @param categoryId * The identifier to find; must not be <code>null</code>. If * the category is <code>null</code>, then a category suitable * for uncategorized items is defined and returned. * @return The category with the given identifier; this value will never be * <code>null</code>, but it might be undefined. * @see Category */ public Category getCategory(final String categoryId) { if (categoryId == null) { return getCategory(AUTOGENERATED_CATEGORY_ID); } checkId(categoryId); Category category = categoriesById.get(categoryId); if (category == null) { category = new Category(categoryId); categoriesById.put(categoryId, category); category.addCategoryListener(this); } return category; }
/** * Gets the category with the given identifier. If no such category * currently exists, then the category will be created (but be undefined). * * @param categoryId * The identifier to find; must not be <code>null</code>. If * the category is <code>null</code>, then a category suitable * for uncategorized items is defined and returned. * @return The category with the given identifier; this value will never be * <code>null</code>, but it might be undefined. * @see Category */ public final Category getCategory(final String categoryId) { if (categoryId == null) { return getCategory(AUTOGENERATED_CATEGORY_ID); } checkId(categoryId); Category category = categoriesById.get(categoryId); if (category == null) { category = new Category(categoryId); categoriesById.put(categoryId, category); category.addCategoryListener(this); } return category; }
/** * Gets the category with the given identifier. If no such category * currently exists, then the category will be created (but be undefined). * * @param categoryId * The identifier to find; must not be <code>null</code>. If * the category is <code>null</code>, then a category suitable * for uncategorized items is defined and returned. * @return The category with the given identifier; this value will never be * <code>null</code>, but it might be undefined. * @see Category */ public final Category getCategory(final String categoryId) { if (categoryId == null) { return getCategory(AUTOGENERATED_CATEGORY_ID); } checkId(categoryId); Category category = categoriesById.get(categoryId); if (category == null) { category = new Category(categoryId); categoriesById.put(categoryId, category); category.addCategoryListener(this); } return category; }
final int configurationElementCount, final CommandManager commandManager) { Category undefCat = commandManager.getCategory(null); if (!undefCat.isDefined()) { ATT_DESCRIPTION); final Category category = commandManager.getCategory(categoryId); if (!category.isDefined()) { category.define(name, description);
final Category category = commandManager.getCategory(categoryId); if (!category.isDefined()) { addWarning(