Skip to content

Package: EMFFormsSpreadsheetRendererService

EMFFormsSpreadsheetRendererService

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.spreadsheet.core;
15:
16: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
17: import org.eclipse.emf.ecp.view.spi.model.VElement;
18:
19: /**
20: * The EMFFormsRendererService encapsulates the tester and the access to the
21: * {@link EMFFormsAbstractSpreadsheetRenderer}.
22: *
23: * @author Eugen Neufeld
24: *
25: * @param <VELEMENT>
26: */
27: public interface EMFFormsSpreadsheetRendererService<VELEMENT extends VElement> {
28:
29:         /**
30:          * Constant for {@link #isApplicable(VElement, ViewModelContext)} to indicate, that the EMFFormsRendererService
31:          * cannot provide a
32:          * fitting renderer for the provided VElement.
33:          */
34:         double NOT_APPLICABLE = Double.NaN;
35:
36:         /**
37:          * Check whether the provided {@link VElement} can be rendered by the {@link EMFFormsAbstractSpreadsheetRenderer}
38:          * provided
39:          * by {@link #getRendererInstance(VElement, ViewModelContext)}.
40:          *
41:          * @param vElement The {@link VElement} to check
42:          * @param viewModelContext The {@link ViewModelContext} to use for the renderer instance
43:          * @return {@link #NOT_APPLICABLE} if the renderer doesn't fit, a positive value otherwise
44:          */
45:         double isApplicable(VElement vElement, ViewModelContext viewModelContext);
46:
47:         /**
48:          * Returns a renderer.
49:          *
50:          * @param vElement The {@link VElement} to create the renderer instance for
51:          * @param viewModelContext The {@link ViewModelContext} to use for the renderer instance
52:          * @return The AbstractSWTRenderer
53:          */
54:         EMFFormsAbstractSpreadsheetRenderer<VELEMENT> getRendererInstance(VELEMENT vElement,
55:                 ViewModelContext viewModelContext);
56: }