Package com.google.gwt.dom.client.Style

Examples of com.google.gwt.dom.client.Style.Unit


  public void parse(XMLElement elem, String fieldName, JClassType type,
      UiBinderWriter writer) throws UnableToCompleteException {
    // Generate instantiation (requires a 'unit' ctor param).
    // (Don't generate a ctor for the SplitLayoutPanel; it's implicitly PX).
    if (type != getSplitLayoutPanelType(writer)) {
      Unit unit = elem.consumeEnumAttribute("unit", Unit.class);
      writer.setFieldInitializerAsConstructor(fieldName,
          writer.getOracle().findType(DockLayoutPanel.class.getName()),
          getFullyQualifiedEnumName(unit));
    }
View Full Code Here


  private static final String STACK_ELEM = "stack";

  public void parse(XMLElement elem, String fieldName, JClassType type,
      UiBinderWriter writer) throws UnableToCompleteException {
    // StackLayoutPanel requires a unit ctor.
    Unit unit = elem.consumeEnumAttribute("unit", Unit.class);
    writer.setFieldInitializerAsConstructor(fieldName,
        writer.getOracle().findType(StackLayoutPanel.class.getName()),
        DockLayoutPanelParser.getFullyQualifiedEnumName(unit));

    // Parse children.
View Full Code Here

      protected DockLayoutPanel instanciate(Class<? extends DockLayoutPanel> clazz,
               Map<String, Object> attributes, Object owner) {

         if (clazz == DockLayoutPanel.class) {
            String unit = (String) attributes.get("unit");
            Unit styleUnit = unit != null ? Unit.valueOf(unit) : Unit.PX;

            return new DockLayoutPanel(styleUnit);
         } else if (clazz == SplitLayoutPanel.class) {

            String splitterSize = (String) attributes.get("splitterSize");
View Full Code Here

            // use default instanciation system
            return super.instanciate(clazz, attributes, owner);
         }

         String unit = (String) attributes.get("unit");
         Unit styleUnit = unit != null ? Unit.valueOf(unit) : Unit.PX;

         return new StackLayoutPanel(styleUnit);
      }
View Full Code Here

                        "Missing mandatory attribute 'barHeight' in a TabLayoutPanel declared in "
                                 + owner.getClass().getSimpleName() + ".ui.xml file");
            }

            String unit = (String) attributes.get("unit");
            Unit styleUnit = unit != null ? Unit.valueOf(unit) : Unit.PX;

            return new TabLayoutPanel(Double.valueOf(barHeight), styleUnit);
         }

         // use default instanciation system
View Full Code Here

    }
    return unitConverter;
  }

  int toPixelSize(final ParsedSize parsedSize, final boolean useWidthAttribute) {
    final Unit unit = parsedSize.getUnit();
    if (unit == Unit.CM) {
      return getUnitConverter().centimeterAsPixel(parsedSize.getSize());
    } else if (unit == Unit.EM) {
      return getUnitConverter().fontSizeAsPixel(parsedSize.getSize());
    } else if (unit == Unit.EX) {
View Full Code Here

import com.google.gwt.dom.client.Style.Unit;

public class UnitParser {

  public static Unit parseUnit(String str, Unit defaultValue) {
    final Unit result = parseUnit(str);
    return result != null ? result : defaultValue;
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.Style.Unit

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.