Examples of JEnumType


Examples of com.google.gwt.core.ext.typeinfo.JEnumType

  private static final String HEADER_ELEM = "header";
  private static final String STACK_ELEM = "stack";

  public void parse(XMLElement elem, String fieldName, JClassType type,
      UiBinderWriter writer) throws UnableToCompleteException {
    JEnumType unitEnumType = writer.getOracle().findType(
        Unit.class.getCanonicalName()).isEnum();
    String unit = elem.consumeAttribute("unit", unitEnumType);
    writer.setFieldInitializerAsConstructor(fieldName,
        writer.getOracle().findType(StackLayoutPanel.class.getName()),
        unit);
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JEnumType

      JGenericType jgenericType = new JGenericType(typeOracle, pkg,
          enclosingType, isLocalType, className, isIntf, jtypeParameters);

      resultType = jgenericType;
    } else if (binding.isEnum()) {
      resultType = new JEnumType(typeOracle, pkg, enclosingType, isLocalType,
          className, isIntf);
    } else {
      resultType = new JRealClassType(typeOracle, pkg, enclosingType,
          isLocalType, className, isIntf);
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JEnumType

          toReturn.keyType = parameterizations[0];
          toReturn.valueType = parameterizations[1];
        }
      }

      JEnumType enumType = method.getReturnType().isEnum();
      if (enumType != null) {
        Map<JEnumConstant, String> map = new LinkedHashMap<JEnumConstant, String>();
        for (JEnumConstant e : enumType.getEnumConstants()) {
          String name;
          PropertyName annotation = e.getAnnotation(PropertyName.class);
          if (annotation == null) {
            name = e.getName();
          } else {
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JEnumType

      JGenericType jgenericType = new JGenericType(typeOracle, pkg,
          enclosingType, isLocalType, className, isIntf, jtypeParameters);

      resultType = jgenericType;
    } else if (binding.isEnum()) {
      resultType = new JEnumType(typeOracle, pkg, enclosingType, isLocalType,
          className, isIntf);
    } else {
      resultType = new JRealClassType(typeOracle, pkg, enclosingType,
          isLocalType, className, isIntf);
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JEnumType

      // Don't generate EnumValue elements for hidden preferences
      logger.log(TreeLogger.DEBUG, "No, not generating enumvalue elements for hidden pref", null);
      return;
    }

    JEnumType enumType = getEnumType(preferenceType);
    assert enumType != null;

    // Order the JEnumConstants by ordinal value
    SortedSet<JEnumConstant> constants = new TreeSet<JEnumConstant>(
        new Comparator<JEnumConstant>() {
          public int compare(JEnumConstant o1, JEnumConstant o2) {
            return o1.getOrdinal() - o2.getOrdinal();
          }
        });
    constants.addAll(Arrays.asList(enumType.getEnumConstants()));

    for (JEnumConstant constant : constants) {
      Element enumValue = (Element) userPref.appendChild(d.createElement("EnumValue"));
      enumValue.setAttribute("value", constant.getName());
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JEnumType

    sw.println("new "
        + extendsPreferenceType.getParameterizedQualifiedSourceName() + "() {");
    sw.indent();

    // public MyEnum getValue() { return MyEnum.valueOf(...); }
    JEnumType enumType = getEnumType(extendsPreferenceType);
    assert enumType != null;
    sw.println("public " + enumType.getQualifiedSourceName() + " getValue() {");
    sw.indent();
    sw.println("return " + enumType.getQualifiedSourceName()
        + ".valueOf(PreferencesProvider.get().getString(getName()));");
    sw.outdent();
    sw.println("}");

    sw.println("public String getName() {return \"" + prefMethod.getName()
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JEnumType

                  String property = staticReference.group(2);
                  //System.out.println("Static reference: "+className+" property "+property);
          try {
            JClassType staticType = types.getType(className);
                    JField field = staticType.getField(property);
                    JEnumType enum1 = staticType.isEnum();
                    if(field != null && field.isStatic()) {
              return new ExpressionInfo(path, path, field.getType(), field.isFinal() || enum1!=null);
                    }
                    if(enum1 != null && property.equals("values()")) {
                      return new ExpressionInfo(path, path, types.getArrayType(enum1), true);
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JEnumType

      // The custom field serializer already defined it.
      return;
    }

    JArrayType isArray = serializableClass.isArray();
    JEnumType isEnum = serializableClass.isEnum();
    JClassType isClass = serializableClass.isClass();

    boolean useViolator = false;
    boolean isAccessible = true;
    if (isEnum == null && isClass != null) {
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JEnumType

    public GenericSelector(TreeLogger logger, JMethod m, int i,
        JParameter[] params) throws UnableToCompleteException {
      super(logger, i, params);
      JPrimitiveType primType = argType.isPrimitive();
      JClassType classType = argType.isClass();
      JEnumType tempEnumType = null;
      boolean tempIsBoolean = false;
      boolean tempIsString = false;
      boolean tempNeedsIf = false;
      if (primType != null) {
        if (primType == JPrimitiveType.DOUBLE
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JEnumType

       */
      return;
    }

    JArrayType isArray = serializableClass.isArray();
    JEnumType isEnum = serializableClass.isEnum();
    boolean isNative = (isArray == null) && (isEnum == null);

    sourceWriter.print("public static" + (isNative ? " native " : " "));
    String qualifiedSourceName = serializableClass.getQualifiedSourceName();
    sourceWriter.print(qualifiedSourceName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.