Skip to content

Package: ECPSWTViewRenderer

ECPSWTViewRenderer

nameinstructionbranchcomplexitylinemethod
static {...}
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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: * Jonas - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.ui.view.swt;
15:
16: import java.util.Map;
17:
18: import org.eclipse.emf.ecore.EObject;
19: import org.eclipse.emf.ecp.ui.view.ECPRendererException;
20: import org.eclipse.emf.ecp.view.internal.swt.ECPSWTViewRendererImpl;
21: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
22: import org.eclipse.emf.ecp.view.spi.model.VView;
23: import org.eclipse.emf.ecp.view.spi.model.VViewModelProperties;
24: import org.eclipse.swt.widgets.Composite;
25:
26: /**
27: * Renders a view which displays the attributes of an domain objects.
28: *
29: * @author Jonas
30: * @noimplement This interface is not intended to be implemented by clients.
31: * @noextend This interface is not intended to be extended by clients.
32: */
33: public interface ECPSWTViewRenderer {
34:
35:         /** Provides access to the stateless renderer. */
36:         ECPSWTViewRenderer INSTANCE = new ECPSWTViewRendererImpl();
37:
38:         /**
39:          * Creates a view with the attributes of the domain object. The layout of the view can either be describes by a
40:          * registered view model, or, if none view model is registered for the domainObject, will be the default layout.
41:          *
42:          * @param parent the parent SWT composite to render the view on
43:          * @param domainObject The domainObject to show in the view
44:          * @return an ECPSWTView providing an interface to the rendered view
45:          * @throws ECPRendererException if there is an exception during rendering
46:          */
47:         ECPSWTView render(Composite parent, EObject domainObject) throws ECPRendererException;
48:
49:         /**
50:          * Creates a view with the attributes of the domain object. The layout of the view is specified by the given view
51:          * model.
52:          *
53:          * @param parent the parent SWT composite to render the view on
54:          * @param domainObject The domainObject to show in the view
55:          * @param viewModel the view model describing the layout of the view
56:          * @return an ECPSWTView providing an interface to the rendered view
57:          * @throws ECPRendererException if there is an exception during rendering
58:          * @since 1.2
59:          */
60:         ECPSWTView render(Composite parent, EObject domainObject, VView viewModel) throws ECPRendererException;
61:
62:         /**
63:          * Creates a view with the attributes of the domain object. The layout of the view is specified by the view
64:          * model set in the view model context.
65:          *
66:          * @param parent the parent SWT composite to render the view on
67:          * @param viewModelContext the {@link ViewModelContext} to use
68:          * @return an ECPSWTView providing an interface to the rendered view
69:          * @throws ECPRendererException if there is an exception during rendering
70:          * @since 1.2
71:          */
72:         ECPSWTView render(Composite parent, ViewModelContext viewModelContext) throws ECPRendererException;
73:
74:         /**
75:          * <p>
76:          * Creates a view with the attributes of the domain object. The layout of the view can either be describes by a
77:          * registered view model, or, if none view model is registered for the domainObject, will be the default layout.
78:          * </p>
79:          * <p>
80:          * <b>The given context map will be used to create
81:          * {@link VViewModelProperties#addNonInheritableProperty(String, Object)
82:          * non-inheritable properties}. The rendering will be delegated to
83:          * {@link #render(Composite, EObject, VViewModelProperties)}, which should be used instead of this method </b>
84:          * </p>
85:          *
86:          * @param parent the parent SWT composite to render the view on
87:          * @param domainObject The domainObject to show in the view
88:          * @param context a key-value-map from String to Object
89:          * @return an ECPSWTView providing an interface to the rendered view
90:          * @throws ECPRendererException if there is an exception during rendering
91:          * @since 1.4
92:          * @deprecated use {@link #render(Composite, EObject, VViewModelProperties)} instead
93:          */
94:         @Deprecated
95:         ECPSWTView render(Composite parent, EObject domainObject, Map<String, Object> context) throws ECPRendererException;
96:
97:         /**
98:          * Creates a view with the attributes of the domain object. The layout of the view can either be describes by a
99:          * registered view model, or, if none view model is registered for the domainObject, will be the default layout.
100:          *
101:          * @param parent the parent SWT composite to render the view on
102:          * @param domainObject The domainObject to show in the view
103:          * @param properties the {@link VViewModelProperties properties}. May be <code>null</code>
104:          * @return an ECPSWTView providing an interface to the rendered view
105:          * @throws ECPRendererException if there is an exception during rendering
106:          * @since 1.7
107:          */
108:         ECPSWTView render(Composite parent, EObject domainObject, VViewModelProperties properties)
109:                 throws ECPRendererException;
110: }