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.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright 2000-2018 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. * @see ColorPicker
  23. * @author Vaadin Ltd
  24. *
  25. * @deprecated As of 8.0 replaced by {@link com.vaadin.ui.ColorPickerArea} based
  26. * on new data binding API
  27. */
  28. @Deprecated
  29. public class ColorPickerArea extends AbstractColorPicker {
  30. /**
  31. * Instantiates a new color picker.
  32. */
  33. public ColorPickerArea() {
  34. super();
  35. }
  36. /**
  37. * Instantiates a new color picker.
  38. *
  39. * @param popupCaption
  40. * caption of the color select popup
  41. */
  42. public ColorPickerArea(String popupCaption) {
  43. super(popupCaption);
  44. }
  45. /**
  46. * Instantiates a new color picker.
  47. *
  48. * @param popupCaption
  49. * caption of the color select popup
  50. * @param initialColor
  51. * the initial color
  52. */
  53. public ColorPickerArea(String popupCaption, Color initialColor) {
  54. super(popupCaption, initialColor);
  55. setDefaultCaptionEnabled(false);
  56. }
  57. @Override
  58. protected void setDefaultStyles() {
  59. // state already has correct default
  60. }
  61. @Override
  62. public void beforeClientResponse(boolean initial) {
  63. super.beforeClientResponse(initial);
  64. if ("".equals(getState().height)) {
  65. getState().height = "30px";
  66. }
  67. if ("".equals(getState().width)) {
  68. getState().width = "30px";
  69. }
  70. }
  71. }