3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.propertysheet
.tabbed
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.eclipse
.jface
.viewers
.ISelection
;
15 import org
.eclipse
.swt
.SWT
;
16 import org
.eclipse
.swt
.layout
.GridData
;
17 import org
.eclipse
.swt
.layout
.GridLayout
;
18 import org
.eclipse
.swt
.widgets
.Composite
;
19 import org
.eclipse
.ui
.IWorkbenchPart
;
20 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
21 import org
.eclipse
.ui
.forms
.widgets
.Section
;
22 import org
.eclipse
.ui
.views
.properties
.tabbed
.TabbedPropertySheetPage
;
24 import eu
.etaxonomy
.cdm
.model
.agent
.INomenclaturalAuthor
;
31 public class AuthorSection
extends AbstractNamePropertySection
{
32 private static final Logger logger
= Logger
.getLogger(AuthorSection
.class);
34 private Section authorship
;
35 private Composite authorshipComposite
;
37 private Section exAuthorship
;
39 private Section basionymAuthorship
;
41 private Section exBasionymAuthorship
;
43 private INomenclaturalAuthor combinationAuthorTeam
;
45 private INomenclaturalAuthor basionymAuthorTeam
;
47 private INomenclaturalAuthor exCombinationAuthorTeam
;
49 private INomenclaturalAuthor exBasionymAuthorTeam
;
51 private Composite exAuthorshipComposite
;
53 private Composite basionymAuthorshipComposite
;
55 private Composite exBasionymAuthorshipComposite
;
57 private Object sectionLayoutData
;
64 public AuthorSection() {}
67 * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
70 public void createControls(Composite parent
,
71 TabbedPropertySheetPage tabbedPropertySheetPage
) {
72 super.createControls(parent
, tabbedPropertySheetPage
);
74 sectionLayoutData
= new GridData(SWT
.FILL
, SWT
.TOP
, true, false, 2, 1);
76 authorship
= getWidgetFactory().createSection(composite
, ExpandableComposite
.TREE_NODE
| ExpandableComposite
.CLIENT_INDENT
);
77 authorshipComposite
= getWidgetFactory().createComposite(authorship
);
78 authorship
.setClient(authorshipComposite
);
79 authorship
.setLayoutData(sectionLayoutData
);
81 exAuthorship
= getWidgetFactory().createSection(composite
, ExpandableComposite
.TREE_NODE
| ExpandableComposite
.CLIENT_INDENT
);
82 exAuthorshipComposite
= getWidgetFactory().createComposite(exAuthorship
);
83 exAuthorship
.setClient(exAuthorshipComposite
);
84 exAuthorship
.setLayoutData(sectionLayoutData
);
86 basionymAuthorship
= getWidgetFactory().createSection(composite
, ExpandableComposite
.TREE_NODE
| ExpandableComposite
.CLIENT_INDENT
);
87 basionymAuthorshipComposite
= getWidgetFactory().createComposite(basionymAuthorship
);
88 basionymAuthorship
.setClient(basionymAuthorshipComposite
);
89 basionymAuthorship
.setLayoutData(sectionLayoutData
);
91 exBasionymAuthorship
= getWidgetFactory().createSection(composite
, ExpandableComposite
.TREE_NODE
| ExpandableComposite
.CLIENT_INDENT
);
92 exBasionymAuthorshipComposite
= getWidgetFactory().createComposite(exBasionymAuthorship
);
93 exBasionymAuthorship
.setClient(exBasionymAuthorshipComposite
);
94 exBasionymAuthorship
.setLayoutData(sectionLayoutData
);
99 * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh()
102 public void refresh() {
105 section
.setText("Author");
107 cacheText
.setText(name
.getAuthorshipCache());
108 editCacheButton
.setSelection(name
.isProtectedAuthorshipCache());
110 authorship
.setText("Authorship");
111 exAuthorship
.setText("Ex-Authorship");
112 basionymAuthorship
.setText("Basionym Authorship");
113 exBasionymAuthorship
.setText("Ex-Basionym Authorship");
117 * @see eu.etaxonomy.taxeditor.propertysheet.tabbed.AbstractNamePropertySection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
120 public void setInput(IWorkbenchPart part
, ISelection selection
) {
121 super.setInput(part
, selection
);
123 combinationAuthorTeam
= name
.getCombinationAuthorTeam();
124 exCombinationAuthorTeam
= name
.getExCombinationAuthorTeam();
125 basionymAuthorTeam
= name
.getBasionymAuthorTeam();
126 exBasionymAuthorTeam
= name
.getExBasionymAuthorTeam();