blob: 130ff15374066a5d17b752597cb5b31ad213c726 [file] [log] [blame]
/**
* Copyright (c) 2011, 2014 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.runtime.web.vaadin.osgi.tests.context.helper;
import org.eclipse.osbp.runtime.web.vaadin.osgi.common.CustomOSGiUiProvider;
import org.eclipse.osbp.runtime.web.vaadin.osgi.common.IOSGiUiProviderFactory;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.UI;
/**
* Registered for vaadin application "providerFactoryTest".
*/
@SuppressWarnings({ "restriction", "serial" })
public class UI_WithProviderFactory extends UI {
@Override
protected void init(VaadinRequest request) {
}
/**
* An OSGi service that provides UiProvider.
*/
public static class ProviderFactory implements IOSGiUiProviderFactory {
public ProviderFactory() {
}
@Override
public CustomOSGiUiProvider createUiProvider(String vaadinApplication,
Class<? extends UI> uiClass) {
return vaadinApplication.equals("providerFactoryTest") ? new UiProvider(
vaadinApplication, uiClass) : null;
}
}
/**
* The custom UIProvider.
*/
public static class UiProvider extends CustomOSGiUiProvider {
public UiProvider(String vaadinApplication, Class<? extends UI> uiClass) {
super(vaadinApplication, uiClass);
}
}
}