use of org.springframework.roo.obr.addon.search.model.ObrBundle in project spring-roo by spring-projects.
the class ObrAddonSearchOperationsImpl method printResultList.
private void printResultList(List<ObrBundle> bundles) {
final StringBuilder sb = new StringBuilder();
int bundleId = 1;
int maxSymbolicNameLength = getSymbolicNameMaxLength(bundles);
LOGGER.warning(String.format("ID BUNDLE SYMBOLIC NAME%s DESCRIPTION", printSpaces(maxSymbolicNameLength - "BUNDLE SYMBOLIC NAME".length())));
LOGGER.warning("--------------------------------------------------------------------------------");
for (final ObrBundle bundle : bundles) {
final String bundleKey = String.format("%02d", bundleId++);
sb.append(bundleKey);
sb.append(" ");
sb.append(bundle.getSymbolicName());
sb.append(String.format("%s ", printSpaces(maxSymbolicNameLength - bundle.getSymbolicName().length())));
sb.append(bundle.getPresentationName());
if (sb.toString().trim().length() > 0) {
LOGGER.info(sb.toString());
}
sb.setLength(0);
}
LOGGER.warning("--------------------------------------------------------------------------------");
LOGGER.info("[HINT] use 'addon info bundle --bundleSymbolicName' to see details about a search result");
LOGGER.info("[HINT] use 'addon install bundle --bundleSymbolicName' to install a specific add-on version");
}
use of org.springframework.roo.obr.addon.search.model.ObrBundle in project spring-roo by spring-projects.
the class ObrAddonSearchOperationsImpl method addOnInfo.
@Override
public void addOnInfo(String bundleId) {
Validate.notBlank(bundleId, "A valid bundle ID is required");
synchronized (mutex) {
ObrBundle bundle = null;
if (searchResultCache != null) {
bundle = searchResultCache.get(String.format("%02d", Integer.parseInt(bundleId)));
}
if (bundle == null) {
LOGGER.warning("A valid bundle ID is required");
return;
}
addOnInfo(bundle, bundle.getVersion());
}
}
use of org.springframework.roo.obr.addon.search.model.ObrBundle in project spring-roo by spring-projects.
the class ObrAddOnBundleSymbolicNameConverter method getAllPossibleValues.
public boolean getAllPossibleValues(final List<Completion> completions, final Class<?> requiredType, final String originalUserInput, final String optionContext, final MethodTarget target) {
final Map<String, ObrBundle> bundles = operations.getAddOnCache();
for (final Entry<String, ObrBundle> entry : bundles.entrySet()) {
final String bsn = entry.getKey();
final ObrBundle bundle = entry.getValue();
completions.add(new Completion(bsn));
}
return false;
}
Aggregations