| 1 |
// Copyright 2008 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 toolbar buttons. |
| 17 |
* |
| 18 |
* @author [email protected] (Attila Bodis) |
| 19 |
*/ |
| 20 |
|
| 21 |
goog.provide('goog.ui.ToolbarButtonRenderer'); |
| 22 |
|
| 23 |
goog.require('goog.ui.CustomButtonRenderer'); |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
/** |
| 28 |
* Toolbar-specific renderer for {@link goog.ui.Button}s, based on {@link |
| 29 |
* goog.ui.CustomButtonRenderer}. |
| 30 |
* @constructor |
| 31 |
* @extends {goog.ui.CustomButtonRenderer} |
| 32 |
*/ |
| 33 |
goog.ui.ToolbarButtonRenderer = function() { |
| 34 |
goog.ui.CustomButtonRenderer.call(this); |
| 35 |
}; |
| 36 |
goog.inherits(goog.ui.ToolbarButtonRenderer, goog.ui.CustomButtonRenderer); |
| 37 |
goog.addSingletonGetter(goog.ui.ToolbarButtonRenderer); |
| 38 |
|
| 39 |
|
| 40 |
/** |
| 41 |
* Default CSS class to be applied to the root element of buttons rendered |
| 42 |
* by this renderer. |
| 43 |
* @type {string} |
| 44 |
*/ |
| 45 |
goog.ui.ToolbarButtonRenderer.CSS_CLASS = |
| 46 |
goog.getCssName('goog-toolbar-button'); |
| 47 |
|
| 48 |
|
| 49 |
/** |
| 50 |
* Returns the CSS class to be applied to the root element of buttons rendered |
| 51 |
* using this renderer. |
| 52 |
* @return {string} Renderer-specific CSS class. |
| 53 |
* @override |
| 54 |
*/ |
| 55 |
goog.ui.ToolbarButtonRenderer.prototype.getCssClass = function() { |
| 56 |
return goog.ui.ToolbarButtonRenderer.CSS_CLASS; |
| 57 |
}; |