Skip to content

Package: EMFFormsAdditionalRendererService

EMFFormsAdditionalRendererService

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: * The EMFFormsAdditionalRendererService encapsulates the tester and the access to the
23: * {@link AbstractAdditionalSWTRenderer}.
24: *
25: * @author Eugen Neufeld
26: *
27: * @param <VELEMENT>
28: */
29: public interface EMFFormsAdditionalRendererService<VELEMENT extends VElement> {
30:
31:         /**
32:          * Check whether the provided {@link VElement} can be rendered by the {@link AbstractAdditionalSWTRenderer} provided
33:          * by {@link #getRendererInstances(VElement, ViewModelContext)}.
34:          *
35:          * @param vElement The {@link VElement} to check
36:          * @param viewModelContext The {@link ViewModelContext} to use
37:          * @return true if the AbstractAdditionalSWTRenderer fits, false otherwise
38:          */
39:         boolean isApplicable(VElement vElement, ViewModelContext viewModelContext);
40:
41:         /**
42:          * Returns a collection of renderers.
43:          *
44:          * @param vElement The {@link VElement} to create the renderer instance for
45:          * @param viewModelContext The {@link ViewModelContext} to use for the renderer instance
46:          * @return The collection of AbstractAdditionalSWTRenderers
47:          */
48:         Collection<AbstractAdditionalSWTRenderer<VELEMENT>> getRendererInstances(VELEMENT vElement,
49:                 ViewModelContext viewModelContext);
50: }