Revision 0fde7fba
Added by Katja Luther almost 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/MoveSynonymToAnotherAcceptedTaxonHandlerE4.java | ||
---|---|---|
1 | 1 |
package eu.etaxonomy.taxeditor.editor.name.e4.handler; |
2 | 2 |
|
3 |
import java.util.ArrayList;
|
|
4 |
import java.util.List;
|
|
3 |
import java.util.HashSet;
|
|
4 |
import java.util.Set;
|
|
5 | 5 |
import java.util.UUID; |
6 | 6 |
|
7 | 7 |
import javax.inject.Inject; |
... | ... | |
79 | 79 |
|
80 | 80 |
Synonym synonym = (Synonym) selection.getFirstElement(); |
81 | 81 |
Taxon oldParent = input.getTaxon(); |
82 |
List<UUID> excludeTaxa = new ArrayList<UUID>();
|
|
82 |
Set<UUID> excludeTaxa = new HashSet<>();
|
|
83 | 83 |
excludeTaxa.add(oldParent.getUuid()); |
84 | 84 |
|
85 | 85 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java | ||
---|---|---|
10 | 10 |
package eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler; |
11 | 11 |
|
12 | 12 |
import java.util.ArrayList; |
13 |
import java.util.HashSet; |
|
13 | 14 |
import java.util.Iterator; |
14 | 15 |
import java.util.List; |
16 |
import java.util.Set; |
|
15 | 17 |
import java.util.UUID; |
16 | 18 |
|
17 | 19 |
import javax.inject.Named; |
... | ... | |
107 | 109 |
} |
108 | 110 |
|
109 | 111 |
DescriptionBase description = elements.get(0).getInDescription(); |
110 |
List<UUID> excludeTaxa = new ArrayList<UUID>();
|
|
112 |
Set<UUID> excludeTaxa = new HashSet<>();
|
|
111 | 113 |
if (description!=null && description.isInstanceOf(TaxonDescription.class)){ |
112 | 114 |
TaxonDescription taxonDescription = HibernateProxyHelper.deproxy(description, TaxonDescription.class); |
113 | 115 |
actualTaxon = taxonDescription.getTaxon(); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandlerE4.java | ||
---|---|---|
4 | 4 |
package eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler; |
5 | 5 |
|
6 | 6 |
import java.util.ArrayList; |
7 |
import java.util.HashSet; |
|
7 | 8 |
import java.util.List; |
9 |
import java.util.Set; |
|
8 | 10 |
import java.util.UUID; |
9 | 11 |
|
10 | 12 |
import javax.inject.Named; |
... | ... | |
98 | 100 |
descriptions.add(description); |
99 | 101 |
|
100 | 102 |
// Choose the target taxon |
101 |
List<UUID> excludeTaxa = new ArrayList<UUID>();
|
|
103 |
Set<UUID> excludeTaxa = new HashSet<>();
|
|
102 | 104 |
|
103 | 105 |
excludeTaxa.add(descriptions.get(0).getTaxon().getUuid()); |
104 | 106 |
|
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TreeNodeDropAdapterE4.java | ||
---|---|---|
80 | 80 |
// targetTreeNode = HibernateProxyHelper.deproxy(targetTreeNode, TaxonNode.class); |
81 | 81 |
// } |
82 | 82 |
if(taxonNodes != null) { |
83 |
if (taxonNodes.size() == 1){ |
|
83 |
// if (taxonNodes.size() == 1){
|
|
84 | 84 |
boolean success = moveTaxon(taxonNodes, targetTreeNode); |
85 | 85 |
if (success){ |
86 | 86 |
taxonNavigator.refresh(); |
87 | 87 |
} |
88 | 88 |
return success; |
89 |
} else{ |
|
90 |
if( MessageDialog.openConfirm(null, Messages.TreeNodeDropAdapter_MOVING, Messages.TreeNodeDropAdapter_MOVING_MESSAGE)){ |
|
91 |
return true; |
|
92 |
} |
|
93 |
} |
|
89 |
// } else{
|
|
90 |
// if( MessageDialog.openConfirm(null, Messages.TreeNodeDropAdapter_MOVING, Messages.TreeNodeDropAdapter_MOVING_MESSAGE)){
|
|
91 |
// return true;
|
|
92 |
// }
|
|
93 |
// }
|
|
94 | 94 |
} |
95 | 95 |
} |
96 | 96 |
return false; |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RemotingChangeAcceptedTaxonToSynonymHandlerE4.java | ||
---|---|---|
3 | 3 |
*/ |
4 | 4 |
package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler; |
5 | 5 |
|
6 |
import java.util.ArrayList; |
|
7 | 6 |
import java.util.HashSet; |
8 | 7 |
import java.util.Iterator; |
9 |
import java.util.List; |
|
10 | 8 |
import java.util.Set; |
11 | 9 |
import java.util.UUID; |
12 | 10 |
|
... | ... | |
115 | 113 |
Shell shell, |
116 | 114 |
MPart activePart, |
117 | 115 |
MHandledMenuItem menuItem) { |
118 |
List<UUID> excludeTaxa = new ArrayList<UUID>();
|
|
116 |
Set<UUID> excludeTaxa = new HashSet<>();
|
|
119 | 117 |
for (TaxonNodeDto oldNode:oldTaxonNodes){ |
120 | 118 |
excludeTaxa.add(oldNode.getTaxonUuid()); |
121 | 119 |
} |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RemotingMoveFactualDataHandlerE4.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler; |
10 | 10 |
|
11 |
import java.util.ArrayList;
|
|
12 |
import java.util.List;
|
|
11 |
import java.util.HashSet;
|
|
12 |
import java.util.Set;
|
|
13 | 13 |
import java.util.UUID; |
14 | 14 |
|
15 | 15 |
import javax.inject.Named; |
... | ... | |
86 | 86 |
TaxonNavigatorLabels.UNSAVED_CHANGES_MESSAGE); |
87 | 87 |
} |
88 | 88 |
|
89 |
List<UUID> excludeTaxa = new ArrayList<UUID>();
|
|
89 |
Set<UUID> excludeTaxa = new HashSet<>();
|
|
90 | 90 |
excludeTaxa.add(sourceTaxonNode.getTaxonUuid()); |
91 | 91 |
|
92 | 92 |
targetTaxonNode = TaxonNodeSelectionDialog.select(shell, |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RemotingMoveTaxonNodeHandlerE4.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler; |
10 | 10 |
|
11 |
import java.util.ArrayList; |
|
12 |
import java.util.List; |
|
11 |
import java.util.HashSet; |
|
12 |
import java.util.Iterator; |
|
13 |
import java.util.Set; |
|
13 | 14 |
import java.util.UUID; |
14 | 15 |
|
15 | 16 |
import javax.inject.Named; |
... | ... | |
26 | 27 |
import org.eclipse.jface.viewers.TreeSelection; |
27 | 28 |
import org.eclipse.swt.widgets.Shell; |
28 | 29 |
|
29 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
|
30 | 30 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
31 | 31 |
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto; |
32 | 32 |
import eu.etaxonomy.taxeditor.navigation.NavigationUtil; |
... | ... | |
36 | 36 |
import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingMoveTaxonOperation; |
37 | 37 |
import eu.etaxonomy.taxeditor.operation.e4.RemotingCdmHandlerE4; |
38 | 38 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
39 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
40 | 39 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog; |
41 | 40 |
|
42 | 41 |
/** |
... | ... | |
46 | 45 |
*/ |
47 | 46 |
public class RemotingMoveTaxonNodeHandlerE4 extends RemotingCdmHandlerE4 { |
48 | 47 |
|
49 |
private TaxonNodeDto oldTaxonNode;
|
|
48 |
private Set<UUID> oldTaxonNodeUUIDs = new HashSet<>();
|
|
50 | 49 |
|
51 | 50 |
public RemotingMoveTaxonNodeHandlerE4() { |
52 | 51 |
super(TaxonNavigatorLabels.MOVE_TAXON_LABEL); |
... | ... | |
58 | 57 |
MPart activePart, |
59 | 58 |
MHandledMenuItem menuItem) { |
60 | 59 |
// check that only a single taxon tree node has been selected |
61 |
if(selection.size() > 1) { |
|
62 |
return new Status(IStatus.ERROR, |
|
63 |
"unknown", //$NON-NLS-1$ |
|
64 |
TaxonNavigatorLabels.SINGLE_TAXON_SELECTION_MESSAGE); |
|
65 |
} |
|
60 |
// if(selection.size() > 1) {
|
|
61 |
// return new Status(IStatus.ERROR,
|
|
62 |
// "unknown", //$NON-NLS-1$
|
|
63 |
// TaxonNavigatorLabels.SINGLE_TAXON_SELECTION_MESSAGE);
|
|
64 |
// }
|
|
66 | 65 |
|
67 | 66 |
// check for no taxon tree node selected |
68 | 67 |
if(selection.size() == 0) { |
... | ... | |
71 | 70 |
TaxonNavigatorLabels.NO_TAXON_SELECTION_MESSAGE); |
72 | 71 |
} |
73 | 72 |
// check that selected object is a taxon node |
74 |
Object obj = selection.iterator().next(); |
|
75 |
if(obj instanceof TaxonNodeDto) { |
|
76 |
oldTaxonNode = (TaxonNodeDto)obj; |
|
77 |
} else { |
|
78 |
return new Status(IStatus.ERROR, |
|
79 |
"unknown", //$NON-NLS-1$ |
|
80 |
TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE); |
|
73 |
Object obj ; |
|
74 |
Iterator iter = selection.iterator(); |
|
75 |
while (iter.hasNext()){ |
|
76 |
obj = iter.next(); |
|
77 |
if(obj instanceof TaxonNodeDto) { |
|
78 |
oldTaxonNodeUUIDs.add(((TaxonNodeDto)obj).getUuid()); |
|
79 |
} else { |
|
80 |
return new Status(IStatus.ERROR, |
|
81 |
"unknown", //$NON-NLS-1$ |
|
82 |
TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE); |
|
83 |
} |
|
81 | 84 |
} |
82 | 85 |
return Status.OK_STATUS; |
83 | 86 |
} |
... | ... | |
88 | 91 |
MPart activePart, |
89 | 92 |
MHandledMenuItem menuItem) { |
90 | 93 |
TaxonNode parentTaxonNode; |
91 |
|
|
92 |
List<UUID> excludeTaxa = new ArrayList<UUID>(); |
|
93 |
excludeTaxa.add(oldTaxonNode.getTaxonUuid()); |
|
94 |
|
|
95 | 94 |
MovingType moveToNewParent = MovingType.CHILD; |
96 | 95 |
|
97 | 96 |
if (PreferencesUtil.getSortNodesNaturally()){ |
... | ... | |
100 | 99 |
parentTaxonNode = TaxonNodeSelectionDialog.select(shell, |
101 | 100 |
// new ConversationHolderMock(), |
102 | 101 |
Messages.RemotingMoveTaxonNodeHandler_CHOOSE_TAXON, |
103 |
excludeTaxa,
|
|
102 |
oldTaxonNodeUUIDs,
|
|
104 | 103 |
null, |
105 |
oldTaxonNode.getClassificationUUID(), true);
|
|
104 |
null, true);
|
|
106 | 105 |
String[] buttonLables = {Messages.RemotingMoveTaxonNodeHandler_CHILD, Messages.RemotingMoveTaxonNodeHandler_BEHIND,Messages.RemotingMoveTaxonNodeHandler_CANCEL}; |
107 | 106 |
MessageDialog dialog = new MessageDialog(null, Messages.RemotingMoveTaxonNodeHandler_TARGET_NODE, null, Messages.RemotingMoveTaxonNodeHandler_TARGET_NODE_MESSAGE, MessageDialog.QUESTION_WITH_CANCEL, buttonLables, 0); |
108 | 107 |
dialog.open(); |
... | ... | |
116 | 115 |
parentTaxonNode = TaxonNodeSelectionDialog.select(shell, |
117 | 116 |
// new ConversationHolderMock(), |
118 | 117 |
Messages.RemotingMoveTaxonNodeHandler_CHOOSE_PARENT, |
119 |
excludeTaxa,
|
|
120 |
CdmStore.getService(ITaxonNodeService.class).find(oldTaxonNode.getUuid()),
|
|
121 |
oldTaxonNode.getClassificationUUID(), true);
|
|
118 |
oldTaxonNodeUUIDs,
|
|
119 |
null,
|
|
120 |
null, true);
|
|
122 | 121 |
} |
123 | 122 |
|
124 | 123 |
|
... | ... | |
132 | 131 |
|
133 | 132 |
return new RemotingMoveTaxonOperation(getTrigger(), |
134 | 133 |
false, |
135 |
oldTaxonNode.getUuid(),
|
|
134 |
oldTaxonNodeUUIDs,
|
|
136 | 135 |
parentTaxonNode.getUuid(), |
137 | 136 |
moveToNewParent); |
138 | 137 |
} |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingMoveTaxonOperation.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.taxeditor.navigation.navigator.operation; |
10 | 10 |
|
11 |
import java.util.HashSet; |
|
12 | 11 |
import java.util.Set; |
13 | 12 |
import java.util.UUID; |
14 | 13 |
|
... | ... | |
19 | 18 |
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action; |
20 | 19 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
21 | 20 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
22 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
|
23 | 21 |
import eu.etaxonomy.taxeditor.navigation.l10n.Messages; |
24 | 22 |
import eu.etaxonomy.taxeditor.navigation.navigator.e4.TreeNodeDropAdapterE4.MovingType; |
25 | 23 |
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation; |
... | ... | |
33 | 31 |
|
34 | 32 |
private final static String LABEL = Messages.RemotingMoveTaxonOperation_MOVE_OP; |
35 | 33 |
|
36 |
private final Set<UUID> taxonNodesToMoveUuid;
|
|
34 |
private Set<UUID> taxonNodesToMoveUuid; |
|
37 | 35 |
private final UUID newParentTreeNodeUuid; |
38 | 36 |
private final MovingType moveToParentNode; |
39 | 37 |
|
40 | 38 |
public RemotingMoveTaxonOperation(Object source, |
41 | 39 |
boolean async, |
42 |
UUID taxonNodeToMoveUuid,
|
|
40 |
Set<UUID> taxonNodeToMoveUuid,
|
|
43 | 41 |
UUID newParentTreeNodeUuid, |
44 | 42 |
MovingType moveToParentNode) { |
45 | 43 |
super(LABEL, Action.Update, source,async); |
46 |
taxonNodesToMoveUuid = new HashSet<UUID>(); |
|
47 |
taxonNodesToMoveUuid.add(taxonNodeToMoveUuid); |
|
44 |
taxonNodesToMoveUuid = taxonNodeToMoveUuid; |
|
48 | 45 |
this.newParentTreeNodeUuid = newParentTreeNodeUuid; |
49 | 46 |
this.moveToParentNode = moveToParentNode; |
50 | 47 |
} |
51 | 48 |
|
52 |
public RemotingMoveTaxonOperation(Object source, |
|
53 |
boolean async, |
|
54 |
TaxonNode taxonNodeToMove,
|
|
55 |
TaxonNode newParentTreeNode, |
|
56 |
MovingType moveToParentNode) { |
|
57 |
super(LABEL, Action.Update, source,async); |
|
58 |
taxonNodesToMoveUuid = new HashSet<UUID>();
|
|
59 |
taxonNodesToMoveUuid.add(taxonNodeToMove.getUuid());
|
|
60 |
this.newParentTreeNodeUuid = newParentTreeNode.getUuid(); |
|
61 |
this.moveToParentNode = moveToParentNode; |
|
62 |
} |
|
49 |
// public RemotingMoveTaxonOperation(Object source,
|
|
50 |
// boolean async,
|
|
51 |
// List<TaxonNode> taxonNodeToMove,
|
|
52 |
// TaxonNode newParentTreeNode,
|
|
53 |
// MovingType moveToParentNode) {
|
|
54 |
// super(LABEL, Action.Update, source,async);
|
|
55 |
//
|
|
56 |
// taxonNodesToMoveUuid=taxonNodeToMove;
|
|
57 |
// this.newParentTreeNodeUuid = newParentTreeNode.getUuid();
|
|
58 |
// this.moveToParentNode = moveToParentNode;
|
|
59 |
// }
|
|
63 | 60 |
|
64 | 61 |
|
65 |
/** |
|
66 |
* @param source |
|
67 |
* @param async |
|
68 |
* @param uuids |
|
69 |
* @param uuid |
|
70 |
* @param child |
|
71 |
*/ |
|
72 |
public RemotingMoveTaxonOperation(Object source, boolean async, Set<UUID> uuids, UUID uuid, |
|
73 |
MovingType child) { |
|
74 |
super(LABEL, Action.Update, source,async); |
|
75 |
this.taxonNodesToMoveUuid = uuids; |
|
76 |
this.newParentTreeNodeUuid = uuid; |
|
77 |
this.moveToParentNode = child; |
|
78 |
} |
|
62 |
// /**
|
|
63 |
// * @param source
|
|
64 |
// * @param async
|
|
65 |
// * @param uuids
|
|
66 |
// * @param uuid
|
|
67 |
// * @param child
|
|
68 |
// */
|
|
69 |
// public RemotingMoveTaxonOperation(Object source, boolean async, Set<UUID> uuids, UUID uuid,
|
|
70 |
// MovingType child) {
|
|
71 |
// super(LABEL, Action.Update, source,async);
|
|
72 |
// this.taxonNodesToMoveUuid = uuids;
|
|
73 |
// this.newParentTreeNodeUuid = uuid;
|
|
74 |
// this.moveToParentNode = child;
|
|
75 |
// }
|
|
79 | 76 |
|
80 | 77 |
/* (non-Javadoc) |
81 | 78 |
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java | ||
---|---|---|
72 | 72 |
|
73 | 73 |
private T selectedObject; |
74 | 74 |
|
75 |
protected T cdmBaseToBeFiltered;
|
|
75 |
protected Set<UUID> cdmBaseToBeFiltered;
|
|
76 | 76 |
|
77 | 77 |
|
78 | 78 |
/** |
... | ... | |
92 | 92 |
setShellStyle(SWT.DIALOG_TRIM); |
93 | 93 |
setMessage(Messages.SearchDialog_patternLabel); |
94 | 94 |
this.settings = settings; |
95 |
|
|
96 |
this.cdmBaseToBeFiltered = cdmObject; |
|
95 |
if (cdmObject != null){ |
|
96 |
this.cdmBaseToBeFiltered = new HashSet<>(); |
|
97 |
this.cdmBaseToBeFiltered.add(cdmObject.getUuid()); |
|
98 |
} |
|
97 | 99 |
Cursor cursor = shell.getCursor(); |
98 | 100 |
shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); |
99 | 101 |
init(); |
... | ... | |
260 | 262 |
while(iterator.hasNext()){ |
261 | 263 |
element = iterator.next(); |
262 | 264 |
|
263 |
if (cdmBaseToBeFiltered == null || !element.getUuid().equals(cdmBaseToBeFiltered.getUuid())){
|
|
265 |
if (cdmBaseToBeFiltered == null || !cdmBaseToBeFiltered.contains(element.getUuid())){
|
|
264 | 266 |
contentProvider.add(element); |
265 | 267 |
} |
266 | 268 |
if (progressMonitor != null){ |
... | ... | |
488 | 490 |
} |
489 | 491 |
AbstractNewEntityWizard wizard = getNewEntityWizard(text); |
490 | 492 |
if(wizard!=null){ |
491 |
wizard.init(null, null); |
|
493 |
if (wizard.getEntity() == null){ |
|
494 |
wizard.init(null, null); |
|
495 |
} |
|
492 | 496 |
if(wizard.getEntity() != null) { |
493 | 497 |
WizardDialog dialog = new WizardDialog(getShell(), wizard); |
494 | 498 |
int status = dialog.open(); |
... | ... | |
539 | 543 |
UuidAndTitleCache uuidAndTitleCacheToRemove = null; |
540 | 544 |
|
541 | 545 |
for (UuidAndTitleCache uuidAndTitleCache : model){ |
542 |
if ((cdmBaseToBeFiltered.getUuid()).equals(uuidAndTitleCache.getUuid())) {
|
|
546 |
if (cdmBaseToBeFiltered != null && cdmBaseToBeFiltered.contains(uuidAndTitleCache.getUuid())) {
|
|
543 | 547 |
uuidAndTitleCacheToRemove = uuidAndTitleCache; |
544 | 548 |
} |
545 | 549 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonBaseSelectionDialog.java | ||
---|---|---|
10 | 10 |
package eu.etaxonomy.taxeditor.ui.dialog.selection; |
11 | 11 |
|
12 | 12 |
import java.util.Collections; |
13 |
import java.util.HashSet; |
|
13 | 14 |
import java.util.UUID; |
14 | 15 |
|
15 | 16 |
import org.eclipse.swt.widgets.Shell; |
... | ... | |
58 | 59 |
String title, boolean multi, TaxonBase taxon, TaxonBase taxonToBeFiltered) { |
59 | 60 |
super(shell, //conversation, |
60 | 61 |
title, multi, TaxonBaseSelectionDialog.class.getCanonicalName(), taxon); |
61 |
this.cdmBaseToBeFiltered = taxonToBeFiltered; |
|
62 |
if (taxonToBeFiltered != null){ |
|
63 |
this.cdmBaseToBeFiltered = new HashSet<>(); |
|
64 |
this.cdmBaseToBeFiltered.add(taxonToBeFiltered.getUuid()); |
|
65 |
} |
|
62 | 66 |
this.clazz = clazz; |
63 | 67 |
search(); |
64 | 68 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionDialog.java | ||
---|---|---|
6 | 6 |
import java.util.Collections; |
7 | 7 |
import java.util.Comparator; |
8 | 8 |
import java.util.List; |
9 |
import java.util.Set; |
|
9 | 10 |
import java.util.UUID; |
10 | 11 |
|
11 | 12 |
import org.eclipse.jface.viewers.ILabelProvider; |
... | ... | |
36 | 37 |
public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonNode> implements SelectionListener{ |
37 | 38 |
|
38 | 39 |
public static TaxonNode select(Shell shell, //ConversationHolder conversation, |
39 |
String title, List<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
|
|
40 |
String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
|
|
40 | 41 |
TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell, |
41 | 42 |
//conversation, |
42 | 43 |
title, |
... | ... | |
47 | 48 |
return getSelectionFromDialog(dialog); |
48 | 49 |
} |
49 | 50 |
public static TaxonNode select(Shell shell, //ConversationHolder conversation, |
50 |
String title, List<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
|
|
51 |
String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
|
|
51 | 52 |
TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell, |
52 | 53 |
//conversation, |
53 | 54 |
title, |
... | ... | |
59 | 60 |
} |
60 | 61 |
|
61 | 62 |
public static UuidAndTitleCache<TaxonNode> selectUuidAndTitleCache(Shell shell, //ConversationHolder conversation, |
62 |
String title, List<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
|
|
63 |
String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
|
|
63 | 64 |
TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell, |
64 | 65 |
//conversation, |
65 | 66 |
title, |
... | ... | |
76 | 77 |
|
77 | 78 |
private Classification selectedClassification; |
78 | 79 |
private UUID selectedUuid; |
79 |
private final List<UUID> excludeTaxa;
|
|
80 |
// private final Set<UUID> excludeTaxa;
|
|
80 | 81 |
private boolean allowClassificationSelection = false; |
81 | 82 |
|
82 | 83 |
protected TaxonNodeSelectionDialog(Shell shell, //ConversationHolder conversation, |
83 |
String title, List<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
|
|
84 |
String title, Set<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
|
|
84 | 85 |
super(shell, //conversation, |
85 | 86 |
title, multi, TaxonNodeSelectionDialog.class.getCanonicalName(), node); |
86 | 87 |
|
... | ... | |
88 | 89 |
|
89 | 90 |
setListLabelProvider(labelProvider); |
90 | 91 |
// setDetailsLabelProvider(labelProvider); |
91 |
this.excludeTaxa = excludeTaxa;
|
|
92 |
this.cdmBaseToBeFiltered = excludeTaxa;
|
|
92 | 93 |
if(classificationUUID != null){ |
93 | 94 |
selectedUuid = classificationUUID; |
94 | 95 |
} |
... | ... | |
99 | 100 |
createClassificationSelectionCombo(shell); |
100 | 101 |
} |
101 | 102 |
protected TaxonNodeSelectionDialog(Shell shell, //ConversationHolder conversation, |
102 |
String title, List<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID) {
|
|
103 |
String title, Set<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID) {
|
|
103 | 104 |
this(shell, title, excludeTaxa, multi, node, classificationUUID, false); |
104 | 105 |
} |
105 | 106 |
|
... | ... | |
207 | 208 |
} |
208 | 209 |
}); |
209 | 210 |
if (selectedClassification == null){ |
210 |
if (this.cdmBaseToBeFiltered == null){
|
|
211 |
// if (this.cdmBaseToBeFiltered.isEmpty()){
|
|
211 | 212 |
selectedClassification = classifications.iterator().next(); |
212 |
} else { |
|
213 |
selectedClassification = this.cdmBaseToBeFiltered.getClassification(); |
|
214 |
} |
|
213 |
|
|
214 |
// } else { |
|
215 |
// selectedClassification = this.cdmBaseToBeFiltered.getClassification(); |
|
216 |
// } |
|
215 | 217 |
} |
216 | 218 |
} |
217 | 219 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionNaturalOrderDialog.java | ||
---|---|---|
1 | 1 |
package eu.etaxonomy.taxeditor.ui.dialog.selection; |
2 | 2 |
|
3 |
import java.util.List;
|
|
3 |
import java.util.Set;
|
|
4 | 4 |
import java.util.UUID; |
5 | 5 |
|
6 | 6 |
import org.eclipse.swt.widgets.Shell; |
... | ... | |
13 | 13 |
|
14 | 14 |
protected TaxonNodeSelectionNaturalOrderDialog(Shell shell,//ConversationHolder conversation, |
15 | 15 |
String title, |
16 |
List<UUID> excludeTaxa, boolean multi, TaxonNode node,
|
|
16 |
Set<UUID> excludeTaxa, boolean multi, TaxonNode node,
|
|
17 | 17 |
Classification classification) { |
18 | 18 |
super(shell, //conversation, |
19 | 19 |
title, excludeTaxa, multi, node, classification.getUuid()); |
Also available in: Unified diff
allow multiple selection for moving taxonnodes