Package org.jboss.errai.workspaces.client.api.annotations

Examples of org.jboss.errai.workspaces.client.api.annotations.LoadTool


                                && (!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() + "());");
                        }
View Full Code Here


            if (clazz.isAnnotationPresent(DefaultBundle.class)) {
              bundleClass = clazz.getAnnotation(DefaultBundle.class).value();
            }
            else if(clazz.isAnnotationPresent(LoadTool.class))
            {
              LoadTool lt = clazz.getAnnotation(LoadTool.class);
              if(!"".equals(lt.icon()))
                tool2imageRes.put(lt.name(), lt.icon());
            }
          }
        }
    );
   
View Full Code Here

      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);
View Full Code Here

      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);
View Full Code Here

     * This will be used to reference the icon though the ResourceFactory
     */
    Set<Class<?>> tools = scanner.getTypesAnnotatedWith(LoadTool.class);
    for(Class<?> tool : tools)
    {
      LoadTool lt = tool.getAnnotation(LoadTool.class);
      if (!"".equals(lt.icon()))
        tool2imageRes.put(lt.name(), lt.icon());

    }

    // generator constructor source code
    generateFactoryClass(context, logger, sourceWriter);
View Full Code Here

TOP

Related Classes of org.jboss.errai.workspaces.client.api.annotations.LoadTool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.