renderoptions.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. * @fileoverview Options for rendering matches.
  16. *
  17. */
  18. goog.provide('goog.ui.ac.RenderOptions');
  19. /**
  20. * A simple class that contains options for rendering a set of autocomplete
  21. * matches. Used as an optional argument in the callback from the matcher.
  22. * @constructor
  23. */
  24. goog.ui.ac.RenderOptions = function() {};
  25. /**
  26. * Whether the current highlighting is to be preserved when displaying the new
  27. * set of matches.
  28. * @type {boolean}
  29. * @private
  30. */
  31. goog.ui.ac.RenderOptions.prototype.preserveHilited_ = false;
  32. /**
  33. * Whether the first match is to be highlighted. When undefined the autoHilite
  34. * flag of the autocomplete is used.
  35. * @type {boolean|undefined}
  36. * @private
  37. */
  38. goog.ui.ac.RenderOptions.prototype.autoHilite_;
  39. /**
  40. * @param {boolean} flag The new value for the preserveHilited_ flag.
  41. */
  42. goog.ui.ac.RenderOptions.prototype.setPreserveHilited = function(flag) {
  43. this.preserveHilited_ = flag;
  44. };
  45. /**
  46. * @return {boolean} The value of the preserveHilited_ flag.
  47. */
  48. goog.ui.ac.RenderOptions.prototype.getPreserveHilited = function() {
  49. return this.preserveHilited_;
  50. };
  51. /**
  52. * @param {boolean} flag The new value for the autoHilite_ flag.
  53. */
  54. goog.ui.ac.RenderOptions.prototype.setAutoHilite = function(flag) {
  55. this.autoHilite_ = flag;
  56. };
  57. /**
  58. * @return {boolean|undefined} The value of the autoHilite_ flag.
  59. */
  60. goog.ui.ac.RenderOptions.prototype.getAutoHilite = function() {
  61. return this.autoHilite_;
  62. };