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
.container
;
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.container.AbstractGroup} object.
32 * @param misappliedName a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
34 public MisapplicationContainer(AbstractGroup group
, Taxon misappliedName
) {
35 super(misappliedName
);
40 * @see eu.etaxonomy.taxeditor.editor.name.NameComposite#initializeComposite()
44 protected void initializeComposite() {
46 setFont(getViewerFont());
54 protected void updateIcon() {
55 setIcon(MISAPPLIEDNAME_ICON
);
58 private void showSec() {
59 if (getMisappliedName() == null) {
63 if (getMisappliedName().getSec() == null) {
64 setNonEditableInfo("sec. ???", false);
66 String title
= getMisappliedName().getSec().getTitleCache();
67 setNonEditableInfo("sec. " + title
, false);
72 * <p>getMisappliedName</p>
74 * @return a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
76 public Taxon
getMisappliedName() {
77 return getTaxonBase();
82 protected Font
getViewerFont() {
83 return EditorUtil
.getFont(Resources
.MISAPPLIEDNAME_FONT
);
87 * <p>calculateErrors</p>
89 protected void calculateErrors() {
90 super.calculateErrors();
92 nameViewer
.setShowSecError(getMisappliedName());
98 protected void updateNonEditableInfo() {
104 * @see eu.etaxonomy.taxeditor.editor.name.AbstractGroupedContainer#updateIndent()
107 protected void updateIndent() {
108 setIndent(MISAPPLIEDNAME_INDENT
);