Revision 1fb5686d
Added by Katja Luther about 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/Root.java | ||
---|---|---|
125 | 125 |
rootNodes.add(new TaxonNodeDto(newClassification.getRootNode())); |
126 | 126 |
|
127 | 127 |
} |
128 |
|
|
129 |
/** |
|
130 |
* @param cb |
|
131 |
*/ |
|
132 |
public void removeRootNode(Classification cb) { |
|
133 |
Integer index = null; |
|
134 |
for (TaxonNodeDto dto: rootNodes){ |
|
135 |
if (dto.getClassificationUUID().equals(cb.getUuid())){ |
|
136 |
index = rootNodes.indexOf(dto); |
|
137 |
} |
|
138 |
} |
|
139 |
|
|
140 |
rootNodes.remove(index); |
|
141 |
|
|
142 |
} |
|
128 | 143 |
} |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeNavigatorComparator.java | ||
---|---|---|
6 | 6 |
import org.eclipse.jface.viewers.ViewerComparator; |
7 | 7 |
|
8 | 8 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
9 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
|
10 | 9 |
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto; |
11 | 10 |
|
12 | 11 |
public class TaxonNodeNavigatorComparator extends ViewerComparator{ |
... | ... | |
28 | 27 |
if (((TaxonNodeDto)e1).getTaxonUuid() == null && ((TaxonNodeDto)e2).getTaxonUuid() == null){ |
29 | 28 |
String title1 = ((TaxonNodeDto)e1).getTitleCache(); |
30 | 29 |
title1 = title1 == null ? "" : title1; |
31 |
return title1.compareTo(((TaxonNode)e2).getClassification().getTitleCache());
|
|
30 |
return title1.compareTo(((TaxonNodeDto)e2).getTitleCache());
|
|
32 | 31 |
}else{ |
33 | 32 |
return comparator.compare((TaxonNodeDto)e1, (TaxonNodeDto)e2); |
34 | 33 |
} |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapter.java | ||
---|---|---|
69 | 69 |
|
70 | 70 |
private static final EnumSet<CRUD> UPDATE = EnumSet.of(CRUD.UPDATE); |
71 | 71 |
|
72 |
public enum MovingType{ |
|
73 |
CHILD, PREVIOUS, BEHIND |
|
74 |
} |
|
72 |
|
|
75 | 73 |
|
76 | 74 |
|
77 | 75 |
/** {@inheritDoc} */ |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorE4.java | ||
---|---|---|
59 | 59 |
|
60 | 60 |
import eu.etaxonomy.cdm.api.application.CdmApplicationState; |
61 | 61 |
import eu.etaxonomy.cdm.api.application.CdmChangeEvent; |
62 |
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action; |
|
62 | 63 |
import eu.etaxonomy.cdm.api.application.ICdmChangeListener; |
63 | 64 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
64 | 65 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
... | ... | |
319 | 320 |
if(!viewer.getTree().isDisposed()){ |
320 | 321 |
viewer.refresh(); |
321 | 322 |
} |
323 |
|
|
322 | 324 |
updateSyncButton(); |
323 | 325 |
} |
324 | 326 |
|
... | ... | |
545 | 547 |
viewer.refresh(cb); |
546 | 548 |
} |
547 | 549 |
} else if (cb instanceof Classification) { |
550 |
if ( event.getAction().equals(Action.Create)){ |
|
551 |
root.addRootNode((Classification)cb); |
|
552 |
} else if ( event.getAction().equals(Action.Delete)){ |
|
553 |
root.removeRootNode((Classification)cb); |
|
554 |
} |
|
548 | 555 |
viewer.refresh(); |
549 | 556 |
} |
550 | 557 |
} |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewClassificationHandlerE4.java | ||
---|---|---|
35 | 35 |
wizard.init(null, selection); |
36 | 36 |
WizardDialog dialog = new WizardDialog(shell, wizard); |
37 | 37 |
dialog.open(); |
38 |
|
|
38 | 39 |
} |
39 | 40 |
} |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RemotingDeleteTaxonNodeHandlerE4.java | ||
---|---|---|
51 | 51 |
private Set<TaxonNodeDto> treeNodes; |
52 | 52 |
private Set<TaxonNodeDto> classifications; |
53 | 53 |
|
54 |
private Set<TaxonNode> taxonNodes; |
|
55 |
private Set<Classification> classificationList; |
|
56 |
|
|
54 | 57 |
public RemotingDeleteTaxonNodeHandlerE4() { |
55 | 58 |
super(TaxonNavigatorLabels.DELETE_TAXON_NODE_LABEL); |
56 | 59 |
} |
... | ... | |
203 | 206 |
|
204 | 207 |
@Override |
205 | 208 |
public void onComplete() { |
209 |
|
|
210 |
// CdmApplicationState.getCurrentDataChangeService() |
|
211 |
// .fireChangeEvent(new CdmChangeEvent(Action.Delete, treeNodes, this), true); |
|
206 | 212 |
} |
207 | 213 |
|
208 | 214 |
/** |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewClassificationWizard.java | ||
---|---|---|
52 | 52 |
CdmStore.getService(IClassificationService.class).merge(getEntity(), true); |
53 | 53 |
CdmApplicationState.getCurrentDataChangeService() |
54 | 54 |
.fireChangeEvent(new CdmChangeEvent(Action.Create, classification, NewTaxonNodeWizard.class), true); |
55 |
|
|
55 |
|
|
56 | 56 |
|
57 | 57 |
} |
58 | 58 |
|
Also available in: Unified diff
fix update for new classification in taxonnavigator