Skip to content

Package: EMFFormsViewService

EMFFormsViewService

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 - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.spi.provider;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecp.view.spi.model.VView;
18: import org.eclipse.emf.ecp.view.spi.model.VViewModelProperties;
19:
20: /**
21: * The EMFFormsViewService allows to add and remove {@link IViewProvider} as well as to retrieve a {@link VView} based
22: * on an {@link EObject} and a {@link VViewModelProperties}.
23: *
24: * @author Eugen Neufeld
25: * @since 1.7
26: *
27: */
28: public interface EMFFormsViewService {
29:
30:         /**
31:          * Add an {@link IViewProvider}.
32:          *
33:          * @param viewProvider The {@link IViewProvider} to be added
34:          */
35:         void addProvider(IViewProvider viewProvider);
36:
37:         /**
38:          * Remove an {@link IViewProvider}.
39:          *
40:          * @param viewProvider The {@link IViewProvider} to be removed
41:          */
42:         void removeProvider(IViewProvider viewProvider);
43:
44:         /**
45:          * This allows to retrieve a {@link VView} based on an {@link EObject}. This method reads all {@link IViewProvider
46:          * IViewProviders} and searches for the best fitting. If none can be found, then null is returned.
47:          *
48:          * @param eObject the {@link EObject} to find a {@link VView} for
49:          * @param properties the {@link VViewModelProperties properties}
50:          * @return a view model for the given {@link EObject} or null if no suited provider could be found
51:          */
52:         VView getView(EObject eObject, VViewModelProperties properties);
53:
54: }