Revision 0b880d16
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java | ||
---|---|---|
39 | 39 |
import org.eclipse.swt.widgets.Shell; |
40 | 40 |
|
41 | 41 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
42 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
|
43 | 42 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
44 | 43 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
45 | 44 |
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity; |
46 | 45 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
47 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
|
48 | 46 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
49 | 47 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
50 | 48 |
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard; |
... | ... | |
60 | 58 |
* @version 1.0 |
61 | 59 |
*/ |
62 | 60 |
public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmBase> extends |
63 |
SearchDialog implements IConversationEnabled { |
|
61 |
SearchDialog {//implements IConversationEnabled {
|
|
64 | 62 |
|
65 |
private final ConversationHolder conversation;
|
|
63 |
// private final ConversationHolder conversation = null;
|
|
66 | 64 |
|
67 | 65 |
protected List<UuidAndTitleCache<T>> model; |
68 | 66 |
private final Set<T> transientCdmObjects = new HashSet<T>(); |
... | ... | |
92 | 90 |
setMessage(Messages.SearchDialog_patternLabel); |
93 | 91 |
this.settings = settings; |
94 | 92 |
|
95 |
this.conversation = conversation; |
|
93 |
// this.conversation = conversation;
|
|
96 | 94 |
this.cdmBaseToBeFiltered = cdmObject; |
97 | 95 |
Cursor cursor = shell.getCursor(); |
98 | 96 |
shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); |
... | ... | |
434 | 432 |
T entity = (T) wizard.getEntity(); |
435 | 433 |
refresh(); |
436 | 434 |
setPattern(entity); |
437 |
if (getConversationHolder() != null){ |
|
438 |
getConversationHolder().bind(); |
|
439 |
} |
|
435 |
// if (getConversationHolder() != null){
|
|
436 |
// getConversationHolder().bind();
|
|
437 |
// }
|
|
440 | 438 |
} |
441 | 439 |
//FIXME : Need to make sure this is a stable fix (ticket 3822) |
442 |
if (getConversationHolder() != null){ |
|
443 |
getConversationHolder().commit(); |
|
444 |
} |
|
440 |
// if (getConversationHolder() != null){
|
|
441 |
// getConversationHolder().commit();
|
|
442 |
// }
|
|
445 | 443 |
} |
446 | 444 |
} |
447 | 445 |
} |
... | ... | |
452 | 450 |
* <p>getConversationHolder</p> |
453 | 451 |
* |
454 | 452 |
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
455 |
*/ |
|
456 |
@Override |
|
457 |
public ConversationHolder getConversationHolder() { |
|
458 |
return conversation; |
|
459 |
} |
|
453 |
// */
|
|
454 |
// @Override
|
|
455 |
// public ConversationHolder getConversationHolder() {
|
|
456 |
// return conversation;
|
|
457 |
// }
|
|
460 | 458 |
|
461 | 459 |
/** {@inheritDoc} */ |
462 |
@Override |
|
463 |
public void update(CdmDataChangeMap changeEvents) {} |
|
460 |
// @Override
|
|
461 |
// public void update(CdmDataChangeMap changeEvents) {}
|
|
464 | 462 |
|
465 | 463 |
/** |
466 | 464 |
* Don't want to add for example a taxon or synonym to itself |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/DerivedUnitSelectionDialog.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import java.util.UUID; |
13 | 13 |
|
14 |
import org.eclipse.core.runtime.CoreException; |
|
15 |
import org.eclipse.swt.widgets.Control; |
|
14 | 16 |
import org.eclipse.swt.widgets.Shell; |
17 |
import org.eclipse.swt.widgets.Text; |
|
15 | 18 |
|
16 | 19 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
17 | 20 |
import eu.etaxonomy.cdm.api.service.IOccurrenceService; |
... | ... | |
79 | 82 |
/** {@inheritDoc} */ |
80 | 83 |
@Override |
81 | 84 |
protected void search() { |
82 |
model = CdmStore.getService(IOccurrenceService.class).getDerivedUnitUuidAndTitleCache(); |
|
85 |
|
|
86 |
Control control =getSearchField(); |
|
87 |
String pattern = null; |
|
88 |
if (control != null){ |
|
89 |
pattern = ((Text)control).getText(); |
|
90 |
} |
|
91 |
|
|
92 |
if (pattern == null || pattern.equals("?")){ |
|
93 |
model = CdmStore.getService(IOccurrenceService.class).getDerivedUnitUuidAndTitleCache(null,null); |
|
94 |
}else{ |
|
95 |
model = CdmStore.getService(IOccurrenceService.class).getDerivedUnitUuidAndTitleCache(limitOfInitialElements,pattern); |
|
96 |
} |
|
97 |
try { |
|
98 |
fillContentProvider(null); |
|
99 |
} catch (CoreException e) { |
|
100 |
// TODO Auto-generated catch block |
|
101 |
e.printStackTrace(); |
|
102 |
} |
|
103 |
|
|
83 | 104 |
} |
84 | 105 |
|
85 | 106 |
/** {@inheritDoc} */ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SearchDialog.java | ||
---|---|---|
77 | 77 |
import org.eclipse.ui.internal.WorkbenchMessages; |
78 | 78 |
import org.eclipse.ui.internal.WorkbenchPlugin; |
79 | 79 |
|
80 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
|
81 | 80 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
82 | 81 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
83 | 82 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
... | ... | |
88 | 87 |
* @date 15.11.2017 |
89 | 88 |
* |
90 | 89 |
*/ |
91 |
public abstract class SearchDialog<T extends ICdmBase> extends Dialog implements IConversationEnabled{ |
|
90 |
public abstract class SearchDialog<T extends ICdmBase> extends Dialog{// implements IConversationEnabled{
|
|
92 | 91 |
|
93 | 92 |
private TableViewer list; |
94 | 93 |
private Text searchField; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SpecimenOrObservationBaseSelectionDialog.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import java.util.UUID; |
13 | 13 |
|
14 |
import org.eclipse.core.runtime.CoreException; |
|
15 |
import org.eclipse.swt.widgets.Control; |
|
14 | 16 |
import org.eclipse.swt.widgets.Shell; |
17 |
import org.eclipse.swt.widgets.Text; |
|
15 | 18 |
|
16 | 19 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
17 | 20 |
import eu.etaxonomy.cdm.api.service.IOccurrenceService; |
... | ... | |
49 | 52 |
/** {@inheritDoc} */ |
50 | 53 |
@Override |
51 | 54 |
protected void search() { |
52 |
model = CdmStore.getService(IOccurrenceService.class).getUuidAndTitleCache(null, null); |
|
55 |
|
|
56 |
Control control =getSearchField(); |
|
57 |
String pattern = null; |
|
58 |
if (control != null){ |
|
59 |
pattern = ((Text)control).getText(); |
|
60 |
} |
|
61 |
|
|
62 |
if (pattern == null || pattern.equals("?")){ |
|
63 |
model = CdmStore.getService(IOccurrenceService.class).getUuidAndTitleCache(null,null); |
|
64 |
}else{ |
|
65 |
model =CdmStore.getService(IOccurrenceService.class).getUuidAndTitleCache(limitOfInitialElements,pattern); |
|
66 |
} |
|
67 |
try { |
|
68 |
fillContentProvider(null); |
|
69 |
} catch (CoreException e) { |
|
70 |
// TODO Auto-generated catch block |
|
71 |
e.printStackTrace(); |
|
72 |
} |
|
53 | 73 |
} |
54 | 74 |
|
55 | 75 |
/** {@inheritDoc} */ |
Also available in: Unified diff
remove conversation from selectiondialog