001    /*
002     * Copyright 2006 Google Inc.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005     * use this file except in compliance with the License. You may obtain a copy of
006     * the License at
007     * 
008     * http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012     * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013     * License for the specific language governing permissions and limitations under
014     * the License.
015     */
016    package com.google.gwt.user.client.ui;
017    
018    /**
019     * Characteristic interface which indicates that a widget has an associated
020     * vertical alignment.
021     */
022    public interface HasVerticalAlignment {
023    
024      /**
025       * Horizontal alignment constant.
026       */
027      public static class VerticalAlignmentConstant {
028        private String verticalAlignString;
029    
030        private VerticalAlignmentConstant(String verticalAlignString) {
031          this.verticalAlignString = verticalAlignString;
032        }
033    
034        /**
035         * Gets the CSS 'vertical-align' string associated with this constant.
036         * 
037         * @return the CSS 'vertical-align' value
038         */
039        public String getVerticalAlignString() {
040          return verticalAlignString;
041        }
042      }
043    
044      /**
045       * Specifies that the widget's contents should be aligned to the bottom.
046       */
047      public static final VerticalAlignmentConstant ALIGN_BOTTOM = new VerticalAlignmentConstant(
048        "bottom");
049    
050      /**
051       * Specifies that the widget's contents should be aligned in the middle.
052       */
053      public static final VerticalAlignmentConstant ALIGN_MIDDLE = new VerticalAlignmentConstant(
054        "middle");
055    
056      /**
057       * Specifies that the widget's contents should be aligned to the top.
058       */
059      public static final VerticalAlignmentConstant ALIGN_TOP = new VerticalAlignmentConstant(
060        "top");
061    
062      /**
063       * Gets the vertical alignment.
064       * 
065       * @return the current vertical alignment.
066       */
067      public VerticalAlignmentConstant getVerticalAlignment();
068    
069      /**
070       * Sets the vertical alignment.
071       * 
072       * @param align the vertical alignment (
073       *          {@link HasVerticalAlignment#ALIGN_TOP},
074       *          {@link HasVerticalAlignment#ALIGN_MIDDLE}, or
075       *          {@link HasVerticalAlignment#ALIGN_BOTTOM}).
076       */
077      public void setVerticalAlignment(VerticalAlignmentConstant align);
078    }