Revision 0caafa75
Added by Andreas Müller over 1 year ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/Root.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.navigation.navigator; |
11 | 10 |
|
12 | 11 |
import java.util.ArrayList; |
... | ... | |
22 | 21 |
import eu.etaxonomy.cdm.api.service.IClassificationService; |
23 | 22 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
24 | 23 |
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto; |
25 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
|
26 | 24 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
27 | 25 |
|
28 | 26 |
/** |
29 |
* <p>Root class.</p> |
|
30 |
* |
|
31 | 27 |
* @author p.ciardelli |
32 | 28 |
* @created 02.06.2009 |
33 |
* @version 1.0 |
|
34 | 29 |
*/ |
35 |
public class Root extends PlatformObject implements IAdaptable, IPersistableElement, IElementFactory { |
|
30 |
public class Root extends PlatformObject |
|
31 |
implements IPersistableElement, IElementFactory { |
|
36 | 32 |
|
37 |
// private final ConversationHolder conversation; |
|
38 | 33 |
private List<TaxonNodeDto> rootNodes = new ArrayList<>(); |
39 | 34 |
|
40 |
/** |
|
41 |
* <p>Constructor for Root.</p> |
|
42 |
* |
|
43 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
|
44 |
*/ |
|
45 |
public Root () {//ConversationHolder conversation){ |
|
46 |
// this.conversation = conversation; |
|
47 |
} |
|
35 |
public Root () {} |
|
48 | 36 |
|
49 |
/** |
|
50 |
* <p>getParentBeans</p> |
|
51 |
* |
|
52 |
* @return a {@link java.util.List} object. |
|
53 |
*/ |
|
54 | 37 |
public List<TaxonNodeDto> getParentBeans() { |
55 | 38 |
List<String> propertyPaths = Arrays.asList(new String[]{ |
56 | 39 |
"name", //$NON-NLS-1$ |
... | ... | |
76 | 59 |
return rootNodes; |
77 | 60 |
} |
78 | 61 |
|
79 |
/* (non-Javadoc) |
|
80 |
* @see org.eclipse.ui.IPersistableElement#getFactoryId() |
|
81 |
*/ |
|
82 |
/** |
|
83 |
* <p>getFactoryId</p> |
|
84 |
* |
|
85 |
* @return a {@link java.lang.String} object. |
|
86 |
*/ |
|
87 | 62 |
@Override |
88 | 63 |
public String getFactoryId() { |
89 | 64 |
return null; |
90 | 65 |
} |
91 | 66 |
|
92 |
/* (non-Javadoc) |
|
93 |
* @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento) |
|
94 |
*/ |
|
95 |
/** {@inheritDoc} */ |
|
96 | 67 |
@Override |
97 | 68 |
public void saveState(IMemento memento) { |
98 | 69 |
} |
99 | 70 |
|
100 |
/* (non-Javadoc) |
|
101 |
* @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento) |
|
102 |
*/ |
|
103 |
/** {@inheritDoc} */ |
|
104 | 71 |
@Override |
105 | 72 |
public IAdaptable createElement(IMemento memento) { |
106 | 73 |
return null; |
107 | 74 |
} |
108 | 75 |
|
109 |
|
|
110 | 76 |
public void addRootNode(Classification newClassification){ |
111 | 77 |
newClassification = CdmStore.getService(IClassificationService.class).load(newClassification.getUuid()); |
112 | 78 |
boolean exist = false; |
... | ... | |
119 | 85 |
if (!exist){ |
120 | 86 |
rootNodes.add(new TaxonNodeDto(newClassification.getRootNode())); |
121 | 87 |
} |
122 |
|
|
123 | 88 |
} |
124 | 89 |
|
125 |
/** |
|
126 |
* @param cb |
|
127 |
*/ |
|
128 | 90 |
public void removeRootNode(Classification cb) { |
129 | 91 |
int index = -1; |
130 | 92 |
for (TaxonNodeDto dto: rootNodes){ |
... | ... | |
136 | 98 |
if (index > 0){ |
137 | 99 |
rootNodes.remove(index); |
138 | 100 |
} |
139 |
|
|
140 | 101 |
} |
141 |
} |
|
102 |
} |
Also available in: Unified diff
ref #10186 further remove ConversationHolder and cleanup