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.

ConnectorStateFactory.java 904B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client.ui;
  5. import com.google.gwt.core.client.GWT;
  6. import com.vaadin.shared.Connector;
  7. import com.vaadin.shared.communication.SharedState;
  8. public abstract class ConnectorStateFactory extends
  9. ConnectorClassBasedFactory<SharedState> {
  10. private static ConnectorStateFactory impl = null;
  11. /**
  12. * Creates a SharedState using GWT.create for the given connector, based on
  13. * its {@link AbstractComponentConnector#getSharedState ()} return type.
  14. *
  15. * @param connector
  16. * @return
  17. */
  18. public static SharedState createState(Class<? extends Connector> connector) {
  19. return getImpl().create(connector);
  20. }
  21. private static ConnectorStateFactory getImpl() {
  22. if (impl == null) {
  23. impl = GWT.create(ConnectorStateFactory.class);
  24. }
  25. return impl;
  26. }
  27. }