Debian Codegraph @

closure-library/closure/goog/ui/menubar.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 A base menu bar factory. Can be bound to an existing
17 * HTML structure or can generate its own DOM.
18 *
19 * To decorate, the menu bar should be bound to an element containing children
20 * with the classname 'goog-menu-button'. See menubar.html for example.
21 *
22 * @see ../demos/menubar.html
23 */
24
25 goog.provide('goog.ui.menuBar');
26
27 goog.require('goog.ui.Container');
28 goog.require('goog.ui.MenuBarRenderer');
29
30
31 /**
32 * The menuBar factory creates a new menu bar.
33 * @param {goog.ui.ContainerRenderer=} opt_renderer Renderer used to render or
34 * decorate the menu bar; defaults to {@link goog.ui.MenuBarRenderer}.
35 * @param {goog.dom.DomHelper=} opt_domHelper DOM helper, used for document
36 * interaction.
37 * @return {!goog.ui.Container} The created menu bar.
38 */
39 goog.ui.menuBar.create = function(opt_renderer, opt_domHelper) {
40 return new goog.ui.Container(
41 null, opt_renderer ? opt_renderer : goog.ui.MenuBarRenderer.getInstance(),
42 opt_domHelper);
43 };