Skip to content

Package: EMFFormsControlProcessorService

EMFFormsControlProcessorService

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: * Stefan Dirix - 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.context.ViewModelService;
20: import org.eclipse.emf.ecp.view.spi.model.VControl;
21: import org.eclipse.emfforms.spi.swt.core.data.ReferenceObjectPair;
22: import org.eclipse.swt.widgets.Control;
23:
24: /**
25: * <p>
26: * A service which should be called while controls are initially rendered.
27: * While this service is generically supported within the {@link AbstractSWTRenderer}, extenders of
28: * {@link AbstractSWTRenderer} or custom controls should call this service for each generated SWT control which relates
29: * to a {@link org.eclipse.emf.ecp.view.spi.model.VDomainModelReference VDomainModelReference}.
30: * </p>
31: * <p>
32: * Note: Since all generated controls are potentially exposed, the possibilities of this service are practically
33: * limitless. But with power comes great responsibility: Too liberal modifications of the given {@link Control}s can
34: * lead to undefined and unwanted behavior, including unresponsive controls, misaligned layouts or even cancellation of
35: * the whole rendering process.
36: * </p>
37: *
38: * @author Stefan Dirix
39: * @since 1.8
40: *
41: */
42: public interface EMFFormsControlProcessorService extends ViewModelService {
43:
44:         /**
45:          * Process the given {@code control} rendered by the given {@code vControl}.
46:          *
47:          * @param control
48:          * The {@link Control} which will be processed by this service.
49:          * @param vControl
50:          * The {@link VControl} responsible for the given {@code control}.
51:          * @param controlViewModelContext
52:          * The {@link ViewModelContext} of the control.
53:          */
54:         void process(Control control, VControl vControl, ViewModelContext controlViewModelContext);
55:
56:         /**
57:          * Process the given {@code control} which relates to the given {@code references}.
58:          *
59:          * @param control
60:          * The {@link Control} which will be processed by this service.
61:          * @param references
62:          * The {@link org.eclipse.emf.ecp.view.spi.model.VDomainModelReference VDomainModelReference}s with their
63:          * corresponding context {@link org.eclipse.emf.ecore.EObject EObject}s which relate to the given
64:          * {@code control}.
65:          */
66:         void process(Control control, Collection<ReferenceObjectPair> references);
67: }