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.

AbstractLegacyComponentConnector.java 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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.client.ui;
  17. import com.vaadin.client.ui.AbstractComponentConnector;
  18. import com.vaadin.client.ui.AbstractConnector;
  19. import com.vaadin.shared.communication.ServerRpc;
  20. import com.vaadin.v7.client.ComponentConnector;
  21. import com.vaadin.v7.shared.AbstractLegacyComponentState;
  22. /**
  23. * Legacy connector for Vaadin 7 compatibility connectors. Needed because
  24. * <code>immediate</code> has been removed from {@link AbstractConnector} in
  25. * Vaadin 8.
  26. *
  27. * @author Vaadin Ltd
  28. * @since 8.0
  29. * @deprecated only used for Vaadin 7 compatiblity components
  30. */
  31. @Deprecated
  32. public class AbstractLegacyComponentConnector extends AbstractComponentConnector
  33. implements ComponentConnector {
  34. // overridden to be visible to VUpload in the same package. Without making
  35. // it public in VUploadConnector
  36. @Override
  37. protected <T extends ServerRpc> T getRpcProxy(Class<T> rpcInterface) {
  38. return super.getRpcProxy(rpcInterface);
  39. }
  40. @Override
  41. public AbstractLegacyComponentState getState() {
  42. return (AbstractLegacyComponentState) super.getState();
  43. }
  44. @Override
  45. public boolean isReadOnly() {
  46. return getState().readOnly;
  47. }
  48. @Override
  49. protected void updateWidgetStyleNames() {
  50. super.updateWidgetStyleNames();
  51. // add / remove read-only style name
  52. setWidgetStyleName("v-readonly", isReadOnly());
  53. }
  54. }