0874465d68fba3c22c8a64f7606af61c4d5aa0ca
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / preference / matching / NonViralNameMatchingPreference.java
1 // $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 package eu.etaxonomy.taxeditor.preference.matching;
12
13 import org.eclipse.ui.IWorkbench;
14
15 import eu.etaxonomy.cdm.model.name.NonViralName;
16 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
17 import eu.etaxonomy.cdm.strategy.match.MatchException;
18 import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
19 import eu.etaxonomy.taxeditor.store.StoreUtil;
20
21 /**
22 * <p>NonViralNameMatchingPreference class.</p>
23 *
24 * @author n.hoffmann
25 * @created Jan 22, 2010
26 * @version 1.0
27 */
28 public class NonViralNameMatchingPreference extends AbstractMatchingPreferences<NonViralName>{
29
30 /* (non-Javadoc)
31 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
32 */
33 /** {@inheritDoc} */
34 public void init(IWorkbench workbench) {
35 clazz = NonViralName.class;
36
37 try {
38 matchStrategy = MatchStrategyConfigurator.NonViralNameMatchStrategy();
39 } catch (MatchException e) {
40 StoreUtil.error(this.getClass(), e);
41 throw new RuntimeException(e);
42 }
43 }
44
45 /* (non-Javadoc)
46 * @see eu.etaxonomy.taxeditor.preference.matching.AbstractMatchingPreferences#getDefaultMatchStrategy()
47 */
48 /** {@inheritDoc} */
49 @Override
50 protected IMatchStrategy getDefaultMatchStrategy() throws MatchException {
51 return MatchStrategyConfigurator.getDefaultNonViralNameMatchStrategy();
52 }
53 }