/*
 * Copyright 2011, The gwtquery team.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.google.gwt.query.client.css;

/**
 * <p>
 * If the property is set on a block-level element whose content is composed of
 * inline-level elements, it specifies the minimal height of each generated
 * inline box.
 * </p>
 *
 * <p>
 * If the property is set on an inline-level element, it specifies the exact
 * height of each box generated by the element. (Except for inline replaced
 * elements, where the height of the box is given by the <i>height</i>
 * property.)
 * </p>
 */
public class LineHeightProperty extends CssProperty<Length> implements
    TakesNumber {

  private static final String CSS_PROPERTY = "lineHeight";

  public static void init() {
    CSS.LINE_HEIGHT = new LineHeightProperty();
  }

  private LineHeightProperty() {
    super(CSS_PROPERTY);
  }

  /**
   * The used value of the property is this <code>value</code> multiplied by the
   * element's font size. Negative values are illegal.
   */
  public CssSetter with(Integer value) {
    return new SimpleCssSetter(CSS_PROPERTY, value != null ? "" + value : null);
  }

  /**
   * The used value of the property is this <code>value</code> multiplied by the
   * element's font size. Negative values are illegal.
   */
  public CssSetter with(Double value) {
    return new SimpleCssSetter(CSS_PROPERTY, value != null ? "" + value : null);
  }
}
