View Javadoc
1   /**
2    * Copyright 2005-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.uif;
17  
18  import java.text.MessageFormat;
19  
20  /**
21   * Constants for CSS style strings
22   *
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class CssConstants {
26  
27      public static final String DISPLAY = "display: ";
28  
29      public static class Displays {
30          public static final String BLOCK = DISPLAY + "block;";
31          public static final String INLINE = DISPLAY + "inline;";
32          public static final String INLINE_BLOCK = DISPLAY + "inline-block;";
33          public static final String NONE = DISPLAY + "none;";
34      }
35  
36      public static final String TEXT_ALIGN = "text-align: ";
37  
38      public static class TextAligns {
39          public static final String LEFT = TEXT_ALIGN + "left;";
40          public static final String RIGHT = TEXT_ALIGN + "right;";
41          public static final String CENTER = TEXT_ALIGN + "center;";
42          public static final String JUSTIFY = TEXT_ALIGN + "justify;";
43          public static final String INHERIT = TEXT_ALIGN + "inherit;";
44      }
45  
46      public static final String VERTICAL_ALIGN = "vertical-align: ";
47  
48      public static class VerticalAligns {
49          public static final String BASELINE = VERTICAL_ALIGN + "Baseline;";
50          public static final String BOTTOM = VERTICAL_ALIGN + "bottom;";
51          public static final String MIDDLE = VERTICAL_ALIGN + "middle;";
52          public static final String TOP = VERTICAL_ALIGN + "top;";
53      }
54  
55      public static class Margins {
56          public static final String MARGIN_LEFT = "margin-left: {0};";
57          public static final String MARGIN_RIGHT = "margin-right: {0};";
58          public static final String MARGIN_TOP = "margin-top: {0};";
59          public static final String MARGIN_BOTTOM = "margin-bottom: {0};";
60      }
61  
62      public static class Padding {
63          public static final String PADDING_LEFT = "padding-left: {0};";
64          public static final String PADDING_RIGHT = "padding-right: {0};";
65          public static final String PADDING_TOP = "padding-top: {0};";
66          public static final String PADDING_BOTTOM = "padding-bottom: {0};";
67      }
68  
69      public static final String WIDTH = "width: ";
70      public static final String HEIGHT = "height: ";
71      public static final String OVERFLOW = "overflow: ";
72  
73      /**
74       * Replaces parameters in the given CSS string with the corresponding
75       * parameter values given
76       *
77       * @param style string with parameters to replace
78       * @param parameters one or more parameter values
79       * @return given string with filled parameters
80       */
81      public static final String getCssStyle(String style, String... parameters) {
82          MessageFormat cssStyle = new MessageFormat(style);
83  
84          return cssStyle.format(parameters);
85      }
86  
87      public static class Classes {
88          public static final String SUPPORT_TITLE_STYLE_CLASS = "uif-viewHeader-supportTitle";
89          public static final String HIDE_HEADER_TEXT_STYLE_CLASS = "uif-hideHeaderText";
90          public static final String HAS_ADD_LINE = "uif-hasAddLine";
91          public static final String SELECT_FIELD_STYLE_CLASS = "uif-select-line";
92          public static final String ACTION_COLUMN_STYLE_CLASS = "uif-collection-column-action";
93          public static final String HAS_HELPER = "has-helper";
94          public static final String IGNORE_VALID = "ignoreValid";
95          public static final String NEW_COLLECTION_ITEM = "uif-newCollectionItem";
96          public static final String TOOLTIP = "uif-tooltip";
97          public static final String BTN = "btn";
98          public static final String BTN_DEFAULT = "btn-default";
99          public static final String ICON_ONLY_BUTTON = "uif-iconOnly";
100         public static final String TRUNCATE = "uif-truncate";
101     }
102 
103     public static class ProgressBar {
104         public static final String VERTICAL_STEP_PROGRESS_BAR = "uif-stepProgressBar-vertical";
105         public static final String PROGRESS_BAR = "progress-bar";
106         public static final String SUCCESS_PROGRESS_BAR = "progress-bar-success";
107         public static final String WARNING_PROGRESS_BAR = "progress-bar-warning";
108         public static final String INFO_PROGRESS_BAR = "progress-bar-info";
109         public static final String EMPTY_PROGRESS_BAR = "progress-bar-empty";
110         public static final String STEP_LABEL = "uif-step";
111         public static final String ACTIVE = "active";
112         public static final String COMPLETE = "complete";
113     }
114 
115     public static class Tabs {
116         public static final String TABS_LEFT = "tabs-left";
117         public static final String TABS_RIGHT = "tabs-right";
118         public static final String TABS_BOTTOM = "tabs-below";
119     }
120 
121     public static class CssGrid {
122         public static final String CONTAINER = "container";
123         public static final String ROW = "row";
124 
125         public static final String XS_COL_PREFIX = "col-xs-";
126         public static final String SM_COL_PREFIX = "col-sm-";
127         public static final String MD_COL_PREFIX = "col-md-";
128         public static final String LG_COL_PREFIX = "col-lg-";
129 
130         public static final String SM_OFFSET_PREFIX = "col-sm-offset-";
131         public static final String MD_OFFSET_PREFIX = "col-md-offset-";
132         public static final String LG_OFFSET_PREFIX = "col-lg-offset-";
133 
134         public static final String XS_FLOAT_RIGHT = "xs-float-right";
135         public static final String SM_FLOAT_RIGHT = "sm-float-right";
136         public static final String MD_FLOAT_RIGHT = "md-float-right";
137         public static final String LG_FLOAT_RIGHT = "lg-float-right";
138 
139         public static final String XS_CLEAR_LEFT = "xs-clear-left";
140         public static final String SM_CLEAR_LEFT = "sm-clear-left";
141         public static final String MD_CLEAR_LEFT = "md-clear-left";
142         public static final String LG_CLEAR_LEFT = "lg-clear-left";
143     }
144 }