CSelectionDefaultStyles.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2014
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. function CSelectionDefaultStyles( selectionController )
  13. {
  14. this.m_primarySelectionColor = null;
  15. this.m_highContrastBorderStyle = "solid";
  16. this.m_secondarySelectionIsDisabled = false;
  17. if (selectionController )
  18. {
  19. this.m_selectionController = selectionController;
  20. this.m_oCognosViewer = selectionController.m_oCognosViewer;
  21. if( this.m_oCognosViewer )
  22. {
  23. var configUI = this.m_oCognosViewer.getUIConfig();
  24. if (configUI)
  25. {
  26. if (configUI.getPrimarySelectionColor()) {
  27. this.m_primarySelectionColor = configUI.getPrimarySelectionColor();
  28. }
  29. if (!configUI.getShowSecondarySelection()) {
  30. this.m_secondarySelectionIsDisabledConfig = true;
  31. }
  32. else if (configUI.getSeondarySelectionColor()) {
  33. this.m_secondarySelectionColor = configUI.getSeondarySelectionColor();
  34. }
  35. }
  36. }
  37. }
  38. };
  39. CSelectionDefaultStyles.prototype.getPrimarySelectionColor = function(contextIds)
  40. {
  41. return this.m_primarySelectionColor;
  42. };
  43. CSelectionDefaultStyles.prototype.getSecondarySelectionColor = function()
  44. {
  45. return this.m_secondarySelectionColor;
  46. };
  47. CSelectionDefaultStyles.prototype.getHighContrastBorderStyle = function()
  48. {
  49. return this.m_highContrastBorderStyle;
  50. };
  51. CSelectionDefaultStyles.prototype.canApplyToSelection = function( contextIds )
  52. {
  53. return true;
  54. };
  55. CSelectionDefaultStyles.prototype.secondarySelectionIsDisabled = function()
  56. {
  57. return this.m_secondarySelectionIsDisabled;
  58. };
  59. CSelectionDefaultStyles.prototype.setStyleForSelection = function()
  60. {
  61. //do nothing for default style
  62. };