Skip to content

Package: ECPRendererTester

ECPRendererTester

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 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 - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.model.common;
15:
16: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
17: import org.eclipse.emf.ecp.view.spi.model.VElement;
18:
19: /**
20: * EPCRendererTester is used by the framework to find the best fitting renderer for a specific {@link ViewModelContext}.
21: *
22: * @author Eugen Neufeld
23: *
24: */
25: public interface ECPRendererTester {
26:
27:         /**
28:          * Return this whenever the renderer should not be used for the tested {@link ViewModelContext}.
29:          */
30:         int NOT_APPLICABLE = -1;
31:
32:         /**
33:          * Check whether the provided {@link VElement} and {@link ViewModelContext} are fitting for the provided renderer.
34:          *
35:          * @param vElement the {@link VElement} to check
36:          * @param viewModelContext the {@link ViewModelContext} to check
37:          * @return {@link #NOT_APPLICABLE} if the corresponding renderer should not be used, a positive integer value
38:          * otherwise. The renderer with the highest priority will be taken.
39:          */
40:         int isApplicable(VElement vElement, ViewModelContext viewModelContext);
41: }