&& (!applyFilter || enabledTools.contains(clazz.getName()))) {
writer.println("workspace.addToolSet(new " + clazz.getName() + "());");
logger.log(TreeLogger.Type.INFO, "Adding Errai Toolset: " + clazz.getName());
} else if (clazz.isAnnotationPresent(LoadTool.class)
&& (!applyFilter || enabledTools.contains(clazz.getName()))) {
LoadTool loadTool = clazz.getAnnotation(LoadTool.class);
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("}");
writer.println("workspace.addTool(\"" + loadTool.group() + "\"," +
" \"" + loadTool.name() + "\", \"" + loadTool.icon() + "\", " + loadTool.multipleAllowed()
+ ", " + loadTool.priority() + ", new " + clazz.getName() + "(), " + rolesBuilder.toString() + ");");
} else {
writer.println("workspace.addTool(\"" + loadTool.group() + "\"," +
" \"" + loadTool.name() + "\", \"" + loadTool.icon() + "\", " + loadTool.multipleAllowed()
+ ", " + loadTool.priority() + ", new " + clazz.getName() + "());");
}
} else if (clazz.isAnnotationPresent(LoginComponent.class)) {
writer.println("workspace.setLoginComponent(new " + clazz.getName() + "());");
}