01: /*
02: * Copyright 2006 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.user.client.ui;
17:
18: /**
19: * Characteristic interface which indicates that a widget has an associated
20: * vertical alignment.
21: */
22: public interface HasVerticalAlignment {
23:
24: /**
25: * Horizontal alignment constant.
26: */
27: public static class VerticalAlignmentConstant {
28: private String verticalAlignString;
29:
30: private VerticalAlignmentConstant(String verticalAlignString) {
31: this .verticalAlignString = verticalAlignString;
32: }
33:
34: /**
35: * Gets the CSS 'vertical-align' string associated with this constant.
36: *
37: * @return the CSS 'vertical-align' value
38: */
39: public String getVerticalAlignString() {
40: return verticalAlignString;
41: }
42: }
43:
44: /**
45: * Specifies that the widget's contents should be aligned to the bottom.
46: */
47: public static final VerticalAlignmentConstant ALIGN_BOTTOM = new VerticalAlignmentConstant(
48: "bottom");
49:
50: /**
51: * Specifies that the widget's contents should be aligned in the middle.
52: */
53: public static final VerticalAlignmentConstant ALIGN_MIDDLE = new VerticalAlignmentConstant(
54: "middle");
55:
56: /**
57: * Specifies that the widget's contents should be aligned to the top.
58: */
59: public static final VerticalAlignmentConstant ALIGN_TOP = new VerticalAlignmentConstant(
60: "top");
61:
62: /**
63: * Gets the vertical alignment.
64: *
65: * @return the current vertical alignment.
66: */
67: public VerticalAlignmentConstant getVerticalAlignment();
68:
69: /**
70: * Sets the vertical alignment.
71: *
72: * @param align the vertical alignment (
73: * {@link HasVerticalAlignment#ALIGN_TOP},
74: * {@link HasVerticalAlignment#ALIGN_MIDDLE}, or
75: * {@link HasVerticalAlignment#ALIGN_BOTTOM}).
76: */
77: public void setVerticalAlignment(VerticalAlignmentConstant align);
78: }
|