Skip to content

Package: ECPValidationResultService$ECPValidationResultServiceListener

ECPValidationResultService$ECPValidationResultServiceListener

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 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: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.ui.validation;
15:
16: import java.util.List;
17: import java.util.Set;
18:
19: import org.eclipse.emf.common.util.Diagnostic;
20: import org.eclipse.emf.ecore.EClassifier;
21:
22: /**
23: * Service for propagating validation results.
24: *
25: * @author jfaltermeier
26: *
27: */
28: public interface ECPValidationResultService {
29:
30:         /**
31:          * Passes the given diagnostic to all registered {@link ECPValidationResultServiceListener}s.
32:          *
33:          * @param diagnostic the diagnostic to display
34:          */
35:         void setResult(Diagnostic diagnostic);
36:
37:         /**
38:          * Passes the given diagnostics to all registered {@link ECPValidationResultServiceListener}s.
39:          *
40:          * @param diagnostic the diagnostics to display
41:          */
42:         void setResult(Diagnostic[] diagnostic);
43:
44:         /**
45:          * Passes the given diagnostics to all registered {@link ECPValidationResultServiceListener}s.
46:          *
47:          * @param diagnostic the diagnostics to display
48:          */
49:         void setResult(List<Diagnostic> diagnostic);
50:
51:         /**
52:          * Registers a listener that gets informed whenever the input changes.
53:          *
54:          * @param listener the listener to be registered
55:          */
56:         void register(ECPValidationResultServiceListener listener);
57:
58:         /**
59:          * Registers a listener that gets informed whenever there is a validation result for an object of a type from the
60:          * given set of {@link EClassifier}s.
61:          *
62:          * @param listener the listener to be registered
63:          * @param classifiersOfInterest the set of {@link EClassifier}s
64:          */
65:         void register(ECPValidationResultServiceListener listener, Set<EClassifier> classifiersOfInterest);
66:
67:         /**
68:          * Deregisters a listener.
69:          *
70:          * @param listener the listener to be deregistered
71:          */
72:         void deregister(ECPValidationResultServiceListener listener);
73:
74:         /**
75:          * Listener interface for getting informed on input changes of the validation view.
76:          *
77:          * @author jfaltermeier
78:          *
79:          */
80:         public interface ECPValidationResultServiceListener {
81:                 /**
82:                  * Called whenever the input changes.
83:                  *
84:                  * @param diagnostic the diagnostic. May be an array a list or a single Diagnostic.
85:                  */
86:                 void resultChanged(Object diagnostic);
87:         }
88:
89: }