1 package eu
.etaxonomy
.taxeditor
.designproposal2
.view
;
3 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
4 import org
.eclipse
.ui
.IEditorInput
;
5 import org
.eclipse
.ui
.IEditorSite
;
6 import org
.eclipse
.ui
.PartInitException
;
7 import org
.eclipse
.ui
.part
.MultiPageEditorPart
;
9 import eu
.etaxonomy
.taxeditor
.designproposal2
.model
.NameEditorInput
;
10 import eu
.etaxonomy
.taxeditor
.designproposal2
.model
.TaxonName
;
12 public class MultiPagePilosellaView
extends MultiPageEditorPart
{
14 public static final String ID
= "eu.etaxonomy.taxeditor.designproposal2.view.mpetestview";
15 private TaxonName taxonname
;
18 protected void createPages() {
20 if (taxonname
.getName() == "Carduus") {
21 this.setPartName("Carduus L.");
22 addPage(0, new CarduusEditorView(), new NameEditorInput(new TaxonName()));
23 } else if (taxonname
.getName() == "Pilosella") {
24 this.setPartName("Pilosella fuscoatra (Nägeli & Peter) Soják");
25 addPage(0, new PilosellaEditorView(), new NameEditorInput(new TaxonName()));
27 this.setPartName("New taxon");
28 addPage(0, new NameEditorView(), new NameEditorInput(new TaxonName()));
30 setPageText(0, "Name");
32 addPage(1, new EmptyEditorView(), new NameEditorInput(new TaxonName()));
33 setPageText(1, "Facts");
35 addPage(2, new EmptyEditorView(), new NameEditorInput(new TaxonName()));
36 setPageText(2, "Specimen");
38 addPage(3, new EmptyEditorView(), new NameEditorInput(new TaxonName()));
39 setPageText(3, "Geographic");
41 } catch (PartInitException e
) {
42 // TODO Auto-generated catch block
48 public void doSave(IProgressMonitor monitor
) {
49 // TODO Auto-generated method stub
54 public void doSaveAs() {
55 // TODO Auto-generated method stub
60 public boolean isSaveAsAllowed() {
61 // TODO Auto-generated method stub
66 public void init(IEditorSite site
, IEditorInput input
) throws PartInitException
{
68 if (!(input
instanceof IEditorInput
))
69 throw new PartInitException(
70 "Invalid Input: Must be IFileEditorInput");
72 if (input
.getAdapter(TaxonName
.class) != null) {
73 taxonname
= (TaxonName
) input
.getAdapter(TaxonName
.class);
74 // System.out.println(taxonname.getCreatedWho());
75 // taxonname.addCdmEventListener(this);