Skip to content

Package: EMFFormsDatabinding

EMFFormsDatabinding

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: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.core.services.databinding;
15:
16: import org.eclipse.core.databinding.observable.list.IObservableList;
17: import org.eclipse.core.databinding.observable.value.IObservableValue;
18: import org.eclipse.core.databinding.property.list.IListProperty;
19: import org.eclipse.core.databinding.property.value.IValueProperty;
20: import org.eclipse.emf.ecore.EObject;
21: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
22:
23: /**
24: * {@link EMFFormsDatabinding} provides a databinding service. It provides four methods for getting an
25: * {@link IValueProperty} or an {@link IListProperty} from a {@link VDomainModelReference} and getting an
26: * {@link IObservableValue} or an {@link IObservableList} from a {@link VDomainModelReference} and an {@link EObject}.
27: *
28: * @author Lucas Koehler
29: *
30: */
31: public interface EMFFormsDatabinding {
32:
33:         /**
34:          * Returns an {@link IObservableValue} by observing the value described by the given {@link VDomainModelReference}
35:          * of the given {@link EObject}.
36:          *
37:          * @param domainModelReference The domain model reference pointing to the desired value
38:          * @param object The root object of the rendered form. If the {@link VDomainModelReference} contains a path, the
39:          * object is the first node of the path. Therefore, the {@link IObservableValue} can be bound to a
40:          * feature of a sub element in case of a path.
41:          * @return The resulting {@link IObservableValue}, does not return <code>null</code>.
42:          * @throws DatabindingFailedException if the databinding could not be executed successfully.
43:          */
44:         IObservableValue getObservableValue(VDomainModelReference domainModelReference, EObject object)
45:                 throws DatabindingFailedException;
46:
47:         /**
48:          * Returns an {@link IObservableList} by observing the list described by the given {@link VDomainModelReference} of
49:          * the given {@link EObject}.
50:          *
51:          * @param domainModelReference The domain model reference pointing to the desired list
52:          * @param object The root object of the rendered form. If the {@link VDomainModelReference} contains a path, the
53:          * object is the first node of the path. Therefore, the {@link IObservableValue} can be bound to a
54:          * feature of a sub element in case of a path.
55:          * @return The resulting {@link IObservableList}, does not return <code>null</code>
56:          * @throws DatabindingFailedException if the databinding could not be executed successfully.
57:          */
58:         IObservableList getObservableList(VDomainModelReference domainModelReference, EObject object)
59:                 throws DatabindingFailedException;
60:
61:         /**
62:          * Returns an {@link IValueProperty} described by the given {@link VDomainModelReference}.
63:          *
64:          * @param domainModelReference The domain model reference pointing to the desired value
65:          * @param object The root object of the rendered form. If the {@link VDomainModelReference} contains a path, the
66:          * object is the first node of the path. Therefore, the {@link IValueProperty} can be bound to a feature
67:          * of a sub element in case of a path.
68:          * @return The resulting {@link IValueProperty}, does not return <code>null</code>.
69:          * @throws DatabindingFailedException if the databinding could not be executed successfully.
70:          */
71:         IValueProperty getValueProperty(VDomainModelReference domainModelReference, EObject object)
72:                 throws DatabindingFailedException;
73:
74:         /**
75:          * Returns an {@link IListProperty} described by the given {@link VDomainModelReference}.
76:          *
77:          * @param domainModelReference The domain model reference pointing to the desired list
78:          * @param object The root object of the rendered form. If the {@link VDomainModelReference} contains a path, the
79:          * object is the first node of the path. Therefore, the {@link IValueProperty} can be bound to a feature
80:          * of a sub element in case of a path.
81:          * @return The resulting {@link IListProperty}, does not return <code>null</code>.
82:          * @throws DatabindingFailedException if the databinding could not be executed successfully.
83:          */
84:         IListProperty getListProperty(VDomainModelReference domainModelReference, EObject object)
85:                 throws DatabindingFailedException;
86: }