Moved all logging and dialog functionality to the new class MessagingUtils.
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / preference / matching / TeamOrPersonMatchingPreference.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.agent.TeamOrPersonBase;
16 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
17 import eu.etaxonomy.cdm.strategy.match.MatchException;
18 import eu.etaxonomy.taxeditor.model.MessagingUtils;
19 import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
20
21 /**
22 * <p>TeamOrPersonMatchingPreference class.</p>
23 *
24 * @author n.hoffmann
25 * @created Jan 22, 2010
26 * @version 1.0
27 */
28 public class TeamOrPersonMatchingPreference extends
29 AbstractMatchingPreferences<TeamOrPersonBase> {
30
31 /* (non-Javadoc)
32 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
33 */
34 /** {@inheritDoc} */
35 public void init(IWorkbench workbench) {
36
37 clazz = TeamOrPersonBase.class;
38
39 try {
40 matchStrategy = MatchStrategyConfigurator.TeamOrPersonMatchStrategy();
41 } catch (MatchException e) {
42 MessagingUtils.error(this.getClass(), e);
43 throw new RuntimeException(e);
44 }
45 }
46
47 /* (non-Javadoc)
48 * @see eu.etaxonomy.taxeditor.preference.matching.AbstractMatchingPreferences#getDefaultMatchStrategy()
49 */
50 /** {@inheritDoc} */
51 @Override
52 protected IMatchStrategy getDefaultMatchStrategy() throws MatchException {
53 return MatchStrategyConfigurator.getDefaultTeamOrPersonMatchStrategy();
54 }
55 }