f6516ceacb58c31fcb3ccd95c14f8fd07acb024b
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.editor
.name
;
12 import org
.eclipse
.swt
.graphics
.Font
;
14 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
15 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
16 import eu
.etaxonomy
.taxeditor
.preference
.Resources
;
19 * <p>MisapplicationContainer class.</p>
25 public class MisapplicationContainer
extends AbstractGroupedContainer
<Taxon
> {
28 * <p>Constructor for MisapplicationContainer.</p>
30 * @param editor a {@link eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor} object.
31 * @param group a {@link eu.etaxonomy.taxeditor.editor.name.AbstractGroup} object.
32 * @param misappliedName a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
34 public MisapplicationContainer(TaxonNameEditor editor
, AbstractGroup group
, Taxon misappliedName
) {
35 super(editor
, group
, misappliedName
);
40 * @see eu.etaxonomy.taxeditor.editor.name.NameComposite#initializeComposite()
44 protected void initializeComposite() {
46 setFont(getViewerFont());
47 setIndent(MISAPPLIEDNAME_INDENT
);
55 protected void updateIcon() {
56 setIcon(MISAPPLIEDNAME_ICON
);
59 private void showSec() {
60 if (getMisappliedName() == null) {
64 if (getMisappliedName().getSec() == null) {
65 setNonEditableInfo("sec. ???", false);
67 String title
= getMisappliedName().getSec().getTitleCache();
68 setNonEditableInfo("sec. " + title
, false);
73 * <p>getMisappliedName</p>
75 * @return a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
77 public Taxon
getMisappliedName() {
78 return getTaxonBase();
83 protected Font
getViewerFont() {
84 return EditorUtil
.getFont(Resources
.MISAPPLIEDNAME_FONT
);
88 * <p>calculateErrors</p>
90 protected void calculateErrors() {
91 super.calculateErrors();
93 nameViewer
.setShowSecError(getMisappliedName());
99 protected void updateNonEditableInfo() {