Skip to content

Package: EMFFormsRendererFactory

EMFFormsRendererFactory

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.swt.core;
15:
16: import java.util.Collection;
17:
18: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
19: import org.eclipse.emf.ecp.view.spi.model.VElement;
20:
21: /**
22: * This is the factory which selects the most fitting renderer for the provided {@link VElement} and
23: * {@link ViewModelContext}.
24: *
25: * @author Eugen Neufeld
26: * @noimplement This interface is not intended to be implemented by clients.
27: * @noextend This interface is not intended to be extended by clients.
28: */
29: public interface EMFFormsRendererFactory {
30:
31:         /**
32:          * Returns the renderer which fits the provided {@link VElement} and {@link ViewModelContext} the most.
33:          *
34:          * @param vElement the {@link VElement} to find the renderer for
35:          * @param viewModelContext the {@link ViewModelContext} to find the renderer for
36:          * @param <VELEMENT> The VElement type
37:          * @return the renderer
38:          * @throws EMFFormsNoRendererException is thrown when no renderer can be found
39:          */
40:         <VELEMENT extends VElement> AbstractSWTRenderer<VElement> getRendererInstance(VELEMENT vElement,
41:                 ViewModelContext viewModelContext) throws EMFFormsNoRendererException;
42:
43:         /**
44:          * Returns a collection of all additional renderer which contribute controls for the provided {@link VElement}.
45:          *
46:          * @param vElement the {@link VElement} to get additional renderer for
47:          * @param viewModelContext the {@link ViewModelContext} to check
48:          * @param <VELEMENT> The VElement type
49:          * @return the Collection of additional renderer
50:          */
51:         <VELEMENT extends VElement> Collection<AbstractAdditionalSWTRenderer<VElement>> getAdditionalRendererInstances(
52:                 VELEMENT vElement, ViewModelContext viewModelContext);
53: }