Revision f6a8dc56
Added by Patrick Plitzner over 10 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
17 | 17 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
18 | 18 |
import eu.etaxonomy.cdm.api.service.IReferenceService; |
19 | 19 |
import eu.etaxonomy.cdm.model.reference.Reference; |
20 |
import eu.etaxonomy.cdm.strategy.cache.reference.ReferenceBaseDefaultCacheStrategy;
|
|
20 |
import eu.etaxonomy.cdm.strategy.cache.reference.ReferenceDefaultCacheStrategy; |
|
21 | 21 |
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard; |
22 | 22 |
import eu.etaxonomy.taxeditor.newWizard.NewReferenceWizard; |
23 | 23 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
... | ... | |
30 | 30 |
* @version 1.0 |
31 | 31 |
*/ |
32 | 32 |
public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<Reference> { |
33 |
|
|
33 |
|
|
34 | 34 |
/** |
35 | 35 |
* <p>select</p> |
36 | 36 |
* |
... | ... | |
41 | 41 |
*/ |
42 | 42 |
public static Reference select(Shell shell, ConversationHolder conversation, Reference reference) { |
43 | 43 |
ReferenceSelectionDialog dialog = new ReferenceSelectionDialog(shell, conversation, |
44 |
"Choose a reference", false, (Reference) reference);
|
|
44 |
"Choose a reference", false, reference); |
|
45 | 45 |
return getSelectionFromDialog(dialog); |
46 | 46 |
} |
47 | 47 |
|
48 |
|
|
48 |
|
|
49 | 49 |
/** |
50 | 50 |
* <p>Constructor for FilteredReferenceSelectionDialog.</p> |
51 | 51 |
* |
... | ... | |
58 | 58 |
protected ReferenceSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, Reference reference) { |
59 | 59 |
super(shell, conversation, title, multi, ReferenceSelectionDialog.class.getCanonicalName(), null); |
60 | 60 |
} |
61 |
|
|
61 |
|
|
62 | 62 |
|
63 | 63 |
/* (non-Javadoc) |
64 | 64 |
* @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID) |
... | ... | |
74 | 74 |
*/ |
75 | 75 |
/** {@inheritDoc} */ |
76 | 76 |
@Override |
77 |
protected void initModel() {
|
|
77 |
protected void initModel() { |
|
78 | 78 |
model = CdmStore.getService(IReferenceService.class).getUuidAndTitleCache(); |
79 | 79 |
} |
80 |
|
|
80 |
|
|
81 | 81 |
|
82 | 82 |
/** {@inheritDoc} */ |
83 | 83 |
@Override |
... | ... | |
87 | 87 |
}else if(cdmObject.getAuthorTeam() == null){ |
88 | 88 |
return super.getTitle(cdmObject); |
89 | 89 |
}else{ |
90 |
return ReferenceBaseDefaultCacheStrategy.putAuthorToEndOfString(cdmObject.getTitleCache(), cdmObject.getAuthorTeam().getTitleCache());
|
|
90 |
return ReferenceDefaultCacheStrategy.putAuthorToEndOfString(cdmObject.getTitleCache(), cdmObject.getAuthorTeam().getTitleCache()); |
|
91 | 91 |
} |
92 | 92 |
} |
93 |
|
|
93 |
|
|
94 | 94 |
/** {@inheritDoc} */ |
95 | 95 |
@Override |
96 | 96 |
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) { |
... | ... | |
102 | 102 |
protected String getNewWizardLinkText() { |
103 | 103 |
return "Click <A>here</A> to create a new reference."; |
104 | 104 |
} |
105 |
|
|
105 |
|
|
106 | 106 |
} |
Also available in: Unified diff
merged model adaptions to cdmlib 3.2.4 from campanula branch