Skip to content

Package: StructuralChangeTesterInternal

StructuralChangeTesterInternal

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 - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.core.services.structuralchange;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecp.view.spi.model.ModelChangeNotification;
18: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
19:
20: /**
21: * A concrete structural change listener for a type of {@link VDomainModelReference}.
22: *
23: * @author Lucas Koehler
24: * @since 1.8
25: *
26: */
27: public interface StructuralChangeTesterInternal {
28:
29:         /**
30:          * The value that expresses that a {@link StructuralChangeTesterInternal} is not applicable for a
31:          * {@link VDomainModelReference}.
32:          */
33:         double NOT_APPLICABLE = Double.NEGATIVE_INFINITY;
34:
35:         /**
36:          * Returns a double that expresses if and how suitable this tester is for the given {@link VDomainModelReference}.
37:          *
38:          * @param reference The {@link VDomainModelReference}
39:          * @return The value indicating how suitable this tester is, negative infinity if it can't work with the given
40:          * {@link VDomainModelReference}.
41:          */
42:         double isApplicable(VDomainModelReference reference);
43:
44:         /**
45:          * Checks whether the domain structure of the given {@link VDomainModelReference} has changed for the changes
46:          * indicated by the given {@link ModelChangeNotification}.
47:          *
48:          * @param reference The {@link VDomainModelReference}
49:          * @param domainRootObject The root object of the {@link VDomainModelReference}.
50:          * @param notification The {@link ModelChangeNotification}
51:          * @return true if the domain structure has changed, false otherwise
52:          */
53:         boolean isStructureChanged(VDomainModelReference reference, EObject domainRootObject,
54:                 ModelChangeNotification notification);
55: }