toolbarseparator.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. * @fileoverview A toolbar separator control.
  16. *
  17. * @author attila@google.com (Attila Bodis)
  18. */
  19. goog.provide('goog.ui.ToolbarSeparator');
  20. goog.require('goog.ui.Separator');
  21. goog.require('goog.ui.ToolbarSeparatorRenderer');
  22. goog.require('goog.ui.registry');
  23. /**
  24. * A separator control for a toolbar.
  25. *
  26. * @param {goog.ui.ToolbarSeparatorRenderer=} opt_renderer Renderer to render or
  27. * decorate the separator; defaults to
  28. * {@link goog.ui.ToolbarSeparatorRenderer}.
  29. * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper, used for
  30. * document interaction.
  31. * @constructor
  32. * @extends {goog.ui.Separator}
  33. * @final
  34. */
  35. goog.ui.ToolbarSeparator = function(opt_renderer, opt_domHelper) {
  36. goog.ui.Separator.call(
  37. this, opt_renderer || goog.ui.ToolbarSeparatorRenderer.getInstance(),
  38. opt_domHelper);
  39. };
  40. goog.inherits(goog.ui.ToolbarSeparator, goog.ui.Separator);
  41. // Registers a decorator factory function for toolbar separators.
  42. goog.ui.registry.setDecoratorByClassName(
  43. goog.ui.ToolbarSeparatorRenderer.CSS_CLASS,
  44. function() { return new goog.ui.ToolbarSeparator(); });