You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ColorPickerArea.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.v7.ui;
  17. import com.vaadin.v7.shared.ui.colorpicker.Color;
  18. /**
  19. * A class that defines area-like implementation for a color picker component.
  20. *
  21. * @since 7.0.0
  22. *
  23. * @see ColorPicker
  24. *
  25. */
  26. @Deprecated
  27. public class ColorPickerArea extends AbstractColorPicker {
  28. /**
  29. * Instantiates a new color picker.
  30. */
  31. public ColorPickerArea() {
  32. super();
  33. }
  34. /**
  35. * Instantiates a new color picker.
  36. *
  37. * @param popupCaption
  38. * caption of the color select popup
  39. */
  40. public ColorPickerArea(String popupCaption) {
  41. super(popupCaption);
  42. }
  43. /**
  44. * Instantiates a new color picker.
  45. *
  46. * @param popupCaption
  47. * caption of the color select popup
  48. * @param initialColor
  49. * the initial color
  50. */
  51. public ColorPickerArea(String popupCaption, Color initialColor) {
  52. super(popupCaption, initialColor);
  53. setDefaultCaptionEnabled(false);
  54. }
  55. @Override
  56. protected void setDefaultStyles() {
  57. // state already has correct default
  58. }
  59. @Override
  60. public void beforeClientResponse(boolean initial) {
  61. super.beforeClientResponse(initial);
  62. if ("".equals(getState().height)) {
  63. getState().height = "30px";
  64. }
  65. if ("".equals(getState().width)) {
  66. getState().width = "30px";
  67. }
  68. }
  69. }