Package org.jboss.errai.ui.nav.client.local

Examples of org.jboss.errai.ui.nav.client.local.Page


    for (MetaClass pageClass : pages) {
      if (!pageClass.isAssignableTo(IsWidget.class)) {
        throw new GenerationException(
            "Class " + pageClass.getFullyQualifiedName() + " is annotated with @Page, so it must implement IsWidget");
      }
      Page annotation = pageClass.getAnnotation(Page.class);
      String pageName = getPageName(pageClass);
      List<Class<? extends PageRole>> annotatedPageRoles = Arrays.asList(annotation.role());

      MetaClass prevPageWithThisName = pageNames.put(pageName, pageClass);
      if (prevPageWithThisName != null) {
        throw new GenerationException(
            "Page names must be unique, but " + prevPageWithThisName + " and " + pageClass +
                " are both named [" + pageName + "]");
      }
      Statement pageImplStmt = generateNewInstanceOfPageImpl(pageClass, pageName);
      if (annotation.startingPage() || annotatedPageRoles.contains(DefaultPage.class)) {
        if (annotation.startingPage()) {
          pageRoles.put(DefaultPage.class, pageClass);
          logger.log(TreeLogger.Type.WARN, "You are using the deprecated statingPage place change to role = DefaultPage.class");
        }

        // need to assign the page impl to a variable and add it to the map twice
View Full Code Here


    return classBuilder.toJavaString();
  }

  private String getPageName(MetaClass pageClass) {
    final Page annotation = pageClass.getAnnotation(Page.class);
    return annotation.path().equals("") ? pageClass.getName() : annotation.path();
  }
View Full Code Here

        MetaClass pageClass = entry.getValue();

        // entry for the node itself
        out.print("\"" + pageName + "\"");

        Page pageAnnotation = pageClass.getAnnotation(Page.class);
        List<Class<? extends PageRole>> roles = Arrays.asList(pageAnnotation.role());
        if (pageAnnotation.startingPage() == true || roles.contains(DefaultPage.class)) {
          out.print(" [penwidth=3]");
        }
        out.println();

        for (MetaField field : getAllFields(pageClass)) {
View Full Code Here

TOP

Related Classes of org.jboss.errai.ui.nav.client.local.Page

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.