1 package eu
.etaxonomy
.taxeditor
.prototype2
.view
;
3 import org
.eclipse
.core
.databinding
.DataBindingContext
;
4 import org
.eclipse
.core
.databinding
.beans
.BeansObservables
;
5 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
6 import org
.eclipse
.ui
.IEditorInput
;
7 import org
.eclipse
.ui
.IEditorSite
;
8 import org
.eclipse
.ui
.PartInitException
;
9 import org
.eclipse
.ui
.part
.MultiPageEditorPart
;
11 import eu
.etaxonomy
.cdm
.model
.name
.TaxonName
;
15 * Generates the tabbed editor with Name view on top and tabs for
16 * "Facts", "Specimen", "Geography", etc.
21 public class MultiPageTaxonView
extends MultiPageEditorPart
{
23 public static final String ID
= "eu.etaxonomy.taxeditor.prototype2.view.multipagetaxonview";
24 private TaxonName taxonname
;
25 private DataBindingContext bindingContext
;
28 protected void createPages() {
30 addPage(0, new NameEditorView(), getEditorInput());
31 setPageText(0, "Name");
33 // addPage(1, new EmptyEditorView(), new NameEditorInput(new TaxonName()));
34 // setPageText(1, "Facts");
36 // addPage(2, new EmptyEditorView(), new NameEditorInput(new TaxonName()));
37 // setPageText(2, "Specimen");
39 // addPage(3, new EmptyEditorView(), new NameEditorInput(new TaxonName()));
40 // setPageText(3, "Geographic");
42 } catch (PartInitException e
) {
43 // TODO Auto-generated catch block
49 public void doSave(IProgressMonitor monitor
) {
50 // TODO Auto-generated method stub
55 public void doSaveAs() {
56 // TODO Auto-generated method stub
61 public boolean isSaveAsAllowed() {
62 // TODO Auto-generated method stub
67 public void init(IEditorSite site
, IEditorInput input
) throws PartInitException
{
69 if (!(input
instanceof IEditorInput
))
70 throw new PartInitException(
71 "Invalid Input: Must be IFileEditorInput");
73 if (input
.getAdapter(TaxonName
.class) != null) {
74 taxonname
= (TaxonName
) input
.getAdapter(TaxonName
.class);
79 // setPartName(taxonname.getName());
81 bindingContext
= new DataBindingContext();
82 bindingContext
.bindValue( BeansObservables
.observeValue(this,"partName"),
83 BeansObservables
.observeValue(taxonname
,"name"),