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
.navigation
.navigator
;
13 import java
.util
.List
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.eclipse
.core
.runtime
.IAdaptable
;
17 import org
.eclipse
.core
.runtime
.PlatformObject
;
18 import org
.eclipse
.ui
.IElementFactory
;
19 import org
.eclipse
.ui
.IMemento
;
20 import org
.eclipse
.ui
.IPersistableElement
;
22 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
23 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonomicTree
;
24 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
33 public class Root
extends PlatformObject
implements IAdaptable
, IPersistableElement
, IElementFactory
{
35 private static final Logger logger
= Logger
.getLogger(Root
.class);
37 private ConversationHolder conversation
;
40 * <p>Constructor for Root.</p>
42 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
44 public Root (ConversationHolder conversation
){
45 this.conversation
= conversation
;
49 * <p>getParentBeans</p>
51 * @return a {@link java.util.List} object.
53 public List
<TaxonomicTree
> getParentBeans() {
54 List
<TaxonomicTree
> classifications
= CdmStore
.getTaxonTreeService().list(null, null, null, null, null);
56 if(classifications
.size() == 0){
57 CdmStore
.createDefaultClassification(conversation
);
58 classifications
= CdmStore
.getTaxonTreeService().list(null, null, null, null, null);
61 return classifications
;
65 * @see org.eclipse.ui.IPersistableElement#getFactoryId()
70 * @return a {@link java.lang.String} object.
72 public String
getFactoryId() {
77 * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
80 public void saveState(IMemento memento
) {
84 * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
87 public IAdaptable
createElement(IMemento memento
) {