}
iocGenerator.generateAllProviders();
final boolean applyFilter = in != null;
MetaDataScanner scanner = ScannerSingleton.getOrCreateInstance();
/**
* LoadToolSet
*/
Set<Class<?>> toolsets = scanner.getTypesAnnotatedWith(LoadToolSet.class);
for(Class<?> toolSetClass : toolsets)
{
JClassType clazz = typeOracle.findType(toolSetClass.getName());
if ((!applyFilter || enabledTools.contains(clazz.getQualifiedSourceName())))
{
iocGenerator.addType(clazz);
String instance = iocGenerator.generateInjectors(clazz);
sourceWriter.println("workspace.addToolSet(" + instance + ");");
logger.log(TreeLogger.Type.INFO, "Adding Errai Toolset: " + clazz.getQualifiedSourceName());
}
}
/**
* LoadTool
*/
Set<Class<?>> tools = scanner.getTypesAnnotatedWith(LoadTool.class);
for(Class<?> toolClass : tools)
{
JClassType clazz = typeOracle.findType(toolClass.getName());
if ((!applyFilter || enabledTools.contains(clazz.getQualifiedSourceName())))
{
iocGenerator.addType(clazz);
LoadTool loadTool = clazz.getAnnotation(LoadTool.class);
logger.log(TreeLogger.Type.INFO, "Adding Errai Tool: " + clazz.getQualifiedSourceName());
if (clazz.isAnnotationPresent(RequireRoles.class)) {
RequireRoles requireRoles = clazz.getAnnotation(RequireRoles.class);
StringBuilder rolesBuilder = new StringBuilder("new String[] {");
String[] roles = requireRoles.value();
for (int i = 0; i < roles.length; i++) {
rolesBuilder.append("\"").append(roles[i].trim()).append("\"");
if ((i + 1) < roles.length) rolesBuilder.append(", ");
}
rolesBuilder.append("}");
generateWidgetProvisioning(context, clazz.getQualifiedSourceName(), loadTool, rolesBuilder, logger, sourceWriter);
} else {
generateWidgetProvisioning(context, clazz.getQualifiedSourceName(), loadTool, null, logger, sourceWriter);
}
}
else if (clazz.isAnnotationPresent(LoginComponent.class))
{
sourceWriter.println("workspace.setLoginComponent(new " + clazz.getQualifiedSourceName() + "());");
}
}
/**
* Group order
*/
Set<Class<?>> groupOrderClasses = scanner.getTypesAnnotatedWith(GroupOrder.class);
for(Class<?> clazz : groupOrderClasses)
{
GroupOrder groupOrder = clazz.getAnnotation(GroupOrder.class);
if ("".equals(groupOrder.value().trim())) return;