1 |
1d9ed6ce
|
n.hoffmann
|
// $Id$
|
2 |
|
|
/**
|
3 |
|
|
* Copyright (C) 2007 EDIT
|
4 |
|
|
* European Distributed Institute of Taxonomy
|
5 |
|
|
* http://www.e-taxonomy.eu
|
6 |
|
|
*
|
7 |
|
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9 |
|
|
*/
|
10 |
|
|
|
11 |
f211dd28
|
n.hoffmann
|
package eu.etaxonomy.taxeditor.ui.forms;
|
12 |
1d9ed6ce
|
n.hoffmann
|
|
13 |
|
|
import java.util.ArrayList;
|
14 |
|
|
import java.util.List;
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
/**
|
18 |
3be6ef3e
|
n.hoffmann
|
* <p>Abstract AbstractCdmFormElementWithErrors class.</p>
|
19 |
|
|
*
|
20 |
1d9ed6ce
|
n.hoffmann
|
* @author n.hoffmann
|
21 |
|
|
* @created Oct 26, 2010
|
22 |
|
|
* @version 1.0
|
23 |
|
|
*/
|
24 |
|
|
public abstract class AbstractCdmFormElementWithErrors extends AbstractCdmFormElement implements IErrorIntolerableElement {
|
25 |
|
|
|
26 |
|
|
private List<IExceptionHandler> exceptionHandlers = new ArrayList<IExceptionHandler>();
|
27 |
|
|
|
28 |
|
|
/**
|
29 |
3be6ef3e
|
n.hoffmann
|
* <p>Constructor for AbstractCdmFormElementWithErrors.</p>
|
30 |
|
|
*
|
31 |
f211dd28
|
n.hoffmann
|
* @param formFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
|
32 |
|
|
* @param formElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
|
33 |
1d9ed6ce
|
n.hoffmann
|
*/
|
34 |
|
|
public AbstractCdmFormElementWithErrors(CdmFormFactory formFactory,
|
35 |
|
|
ICdmFormElement formElement) {
|
36 |
|
|
super(formFactory, formElement);
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
/* (non-Javadoc)
|
40 |
|
|
* @see eu.etaxonomy.taxeditor.forms.IErrorIntolerableElement#addExceptionHandler(eu.etaxonomy.taxeditor.forms.IExceptionHandler)
|
41 |
|
|
*/
|
42 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
43 |
1d9ed6ce
|
n.hoffmann
|
@Override
|
44 |
|
|
public void addExceptionHandler(IExceptionHandler handler) {
|
45 |
|
|
exceptionHandlers.add(handler);
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
/* (non-Javadoc)
|
49 |
|
|
* @see eu.etaxonomy.taxeditor.forms.IErrorIntolerableElement#removeExceptionHandler(eu.etaxonomy.taxeditor.forms.IExceptionHandler)
|
50 |
|
|
*/
|
51 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
52 |
1d9ed6ce
|
n.hoffmann
|
@Override
|
53 |
|
|
public void removeExceptionHandler(IExceptionHandler handler) {
|
54 |
|
|
exceptionHandlers.remove(handler);
|
55 |
|
|
}
|
56 |
|
|
|
57 |
|
|
/* (non-Javadoc)
|
58 |
|
|
* @see eu.etaxonomy.taxeditor.forms.IErrorIntolerableElement#exceptionOccurred()
|
59 |
|
|
*/
|
60 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
61 |
1d9ed6ce
|
n.hoffmann
|
@Override
|
62 |
|
|
public void exceptionOccurred(CdmPropertyChangeEvent event) {
|
63 |
|
|
for(IExceptionHandler handler : exceptionHandlers){
|
64 |
|
|
handler.handleException(event);
|
65 |
|
|
}
|
66 |
|
|
}
|
67 |
|
|
|
68 |
|
|
}
|