Debian Codegraph @

closure-library/closure/goog/ui/menubarrenderer.js

raw
1 // Copyright 2012 The Closure Library Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 /**
16 * @fileoverview Renderer for {@link goog.ui.menuBar}.
17 *
18 */
19
20 goog.provide('goog.ui.MenuBarRenderer');
21
22 goog.require('goog.a11y.aria.Role');
23 goog.require('goog.ui.Container');
24 goog.require('goog.ui.ContainerRenderer');
25
26
27
28 /**
29 * Default renderer for {@link goog.ui.menuBar}s, based on {@link
30 * goog.ui.ContainerRenderer}.
31 * @constructor
32 * @extends {goog.ui.ContainerRenderer}
33 * @final
34 */
35 goog.ui.MenuBarRenderer = function() {
36 goog.ui.MenuBarRenderer.base(
37 this, 'constructor', goog.a11y.aria.Role.MENUBAR);
38 };
39 goog.inherits(goog.ui.MenuBarRenderer, goog.ui.ContainerRenderer);
40 goog.addSingletonGetter(goog.ui.MenuBarRenderer);
41
42
43 /**
44 * Default CSS class to be applied to the root element of elements rendered
45 * by this renderer.
46 * @type {string}
47 */
48 goog.ui.MenuBarRenderer.CSS_CLASS = goog.getCssName('goog-menubar');
49
50
51 /**
52 * @override
53 */
54 goog.ui.MenuBarRenderer.prototype.getCssClass = function() {
55 return goog.ui.MenuBarRenderer.CSS_CLASS;
56 };
57
58
59 /**
60 * Returns the default orientation of containers rendered or decorated by this
61 * renderer. This implementation returns {@code HORIZONTAL}.
62 * @return {goog.ui.Container.Orientation} Default orientation for containers
63 * created or decorated by this renderer.
64 * @override
65 */
66 goog.ui.MenuBarRenderer.prototype.getDefaultOrientation = function() {
67 return goog.ui.Container.Orientation.HORIZONTAL;
68 };