/** * Gets the command {@link ParameterType} with the given identifier. If no * such command parameter type currently exists, then the command parameter * type will be created (but will be undefined). * * @param parameterTypeId * The identifier to find; must not be <code>null</code> and * must not be zero-length. * @return The {@link ParameterType} with the given identifier; this value * will never be <code>null</code>, but it might be undefined. * @since 3.2 */ public final ParameterType getParameterType(final String parameterTypeId) { checkId(parameterTypeId); ParameterType parameterType = parameterTypesById.get(parameterTypeId); if (parameterType == null) { parameterType = new ParameterType(parameterTypeId); parameterTypesById.put(parameterTypeId, parameterType); parameterType.addListener(this); } return parameterType; }
/** * Gets the command {@link ParameterType} with the given identifier. If no * such command parameter type currently exists, then the command parameter * type will be created (but will be undefined). * * @param parameterTypeId * The identifier to find; must not be <code>null</code> and * must not be zero-length. * @return The {@link ParameterType} with the given identifier; this value * will never be <code>null</code>, but it might be undefined. * @since 3.2 */ public final ParameterType getParameterType(final String parameterTypeId) { checkId(parameterTypeId); ParameterType parameterType = parameterTypesById.get(parameterTypeId); if (parameterType == null) { parameterType = new ParameterType(parameterTypeId); parameterTypesById.put(parameterTypeId, parameterType); parameterType.addListener(this); } return parameterType; }
/** * Gets the command {@link ParameterType} with the given identifier. If no * such command parameter type currently exists, then the command parameter * type will be created (but will be undefined). * * @param parameterTypeId * The identifier to find; must not be <code>null</code> and * must not be zero-length. * @return The {@link ParameterType} with the given identifier; this value * will never be <code>null</code>, but it might be undefined. * @since 3.2 */ public ParameterType getParameterType(final String parameterTypeId) { checkId(parameterTypeId); ParameterType parameterType = parameterTypesById.get(parameterTypeId); if (parameterType == null) { parameterType = new ParameterType(parameterTypeId); parameterTypesById.put(parameterTypeId, parameterType); parameterType.addListener(this); } return parameterType; }
/** * Gets the command with the given identifier. If no such command currently * exists, then the command will be created (but will be undefined). * * @param commandId * The identifier to find; must not be <code>null</code> and * must not be zero-length. * @return The command with the given identifier; this value will never be * <code>null</code>, but it might be undefined. * @see Command */ public Command getCommand(final String commandId) { checkId(commandId); Command command = (Command) handleObjectsById.get(commandId); if (command == null) { command = new Command(commandId); command.shouldFireEvents = shouldCommandFireEvents; handleObjectsById.put(commandId, command); command.addCommandListener(this); if (executionListener != null) { command.addExecutionListener(executionListener); } } return command; }
/** * 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 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 command with the given identifier. If no such command currently * exists, then the command will be created (but will be undefined). * * @param commandId * The identifier to find; must not be <code>null</code> and * must not be zero-length. * @return The command with the given identifier; this value will never be * <code>null</code>, but it might be undefined. * @see Command */ public final Command getCommand(final String commandId) { checkId(commandId); Command command = (Command) handleObjectsById.get(commandId); if (command == null) { command = new Command(commandId); command.shouldFireEvents = shouldCommandFireEvents; handleObjectsById.put(commandId, command); command.addCommandListener(this); if (executionListener != null) { command.addExecutionListener(executionListener); } } return command; }
/** * Gets the command with the given identifier. If no such command currently * exists, then the command will be created (but will be undefined). * * @param commandId * The identifier to find; must not be <code>null</code> and * must not be zero-length. * @return The command with the given identifier; this value will never be * <code>null</code>, but it might be undefined. * @see Command */ public final Command getCommand(final String commandId) { checkId(commandId); Command command = (Command) handleObjectsById.get(commandId); if (command == null) { command = new Command(commandId); command.shouldFireEvents = shouldCommandFireEvents; handleObjectsById.put(commandId, command); command.addCommandListener(this); if (executionListener != null) { command.addExecutionListener(executionListener); } } return command; }
/** * 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; }