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.

ColorPickerAreaConnector.java 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.client.ui.colorpicker;
  17. import com.google.gwt.core.client.GWT;
  18. import com.google.gwt.event.dom.client.ClickEvent;
  19. import com.google.gwt.user.client.ui.Widget;
  20. import com.vaadin.client.VCaption;
  21. import com.vaadin.client.communication.RpcProxy;
  22. import com.vaadin.client.ui.VColorPickerArea;
  23. import com.vaadin.shared.ui.Connect;
  24. import com.vaadin.shared.ui.Connect.LoadStyle;
  25. import com.vaadin.v7.shared.ui.colorpicker.ColorPickerServerRpc;
  26. /**
  27. * A class that defines an implementation for a color picker connector. Connects
  28. * the server side {@link com.vaadin.ui.ColorPickerArea} with the client side
  29. * counterpart {@link VColorPickerArea}
  30. *
  31. * @since 7.0.0
  32. */
  33. @Deprecated
  34. @Connect(value = com.vaadin.v7.ui.ColorPickerArea.class, loadStyle = LoadStyle.LAZY)
  35. public class ColorPickerAreaConnector extends AbstractColorPickerConnector {
  36. private ColorPickerServerRpc rpc = RpcProxy
  37. .create(ColorPickerServerRpc.class, this);
  38. @Override
  39. protected Widget createWidget() {
  40. return GWT.create(VColorPickerArea.class);
  41. }
  42. @Override
  43. public VColorPickerArea getWidget() {
  44. return (VColorPickerArea) super.getWidget();
  45. }
  46. @Override
  47. public void onClick(ClickEvent event) {
  48. rpc.openPopup(getWidget().isOpen());
  49. }
  50. @Override
  51. protected void setCaption(String caption) {
  52. VCaption.setCaptionText(getWidget(), getState());
  53. }
  54. @Override
  55. protected void refreshColor() {
  56. getWidget().refreshColor();
  57. }
  58. }