1 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
3 import org
.eclipse
.jface
.viewers
.LabelProvider
;
4 import org
.eclipse
.swt
.widgets
.Shell
;
6 import eu
.etaxonomy
.cdm
.api
.service
.IIdentifiableEntityService
;
7 import eu
.etaxonomy
.cdm
.api
.service
.dto
.IdentifiedEntityDTO
;
8 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
9 import eu
.etaxonomy
.cdm
.model
.metadata
.PreferencePredicate
;
10 import eu
.etaxonomy
.cdm
.model
.term
.IdentifierType
;
11 import eu
.etaxonomy
.cdm
.persistence
.query
.MatchMode
;
12 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
13 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
15 public abstract class AbstractFilteredIdentifierSelectionDialog
<T
extends ICdmBase
>
16 extends AbstractFilteredCdmResourceSelectionDialog
<T
> {
18 private IdentifierType identifierType
;
19 private MatchMode matchMode
;
20 private Class
<T
> type
;
22 protected AbstractFilteredIdentifierSelectionDialog(Shell shell
, String title
, boolean multi
,
23 String settings
, T cdmObject
) {
24 super(shell
, title
, multi
, settings
, cdmObject
);
27 public class FilteredIdentifiedEntityLabelProvider
extends LabelProvider
{
29 public String
getText(Object element
) {
30 if (element
== null) {
33 IdentifiedEntityDTO identifiedEntity
= (IdentifiedEntityDTO
) element
;
34 String titleCache
= identifiedEntity
.getCdmEntity().getTitleCache();
35 if(PreferencesUtil
.getBooleanValue(PreferencePredicate
.ShowIdInSelectionDialog
.getKey())){
36 titleCache
+= " ["+identifiedEntity
.getCdmEntity().getUuid()+"]";
39 titleCache
+= " ["+identifiedEntity
.getIdentifier().getIdentifier()+"]";
45 protected void callService(String pattern
){
46 model
= CdmStore
.getService(IIdentifiableEntityService
.class).listByIdentifier(type
, pattern
, identifierType
, matchMode
, true, null, limitOfInitialElements
);