3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.dialogs
;
13 import java
.util
.List
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.eclipse
.core
.runtime
.CoreException
;
17 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
18 import org
.eclipse
.swt
.widgets
.Shell
;
20 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
21 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
29 public class FilteredNameSelectionDialog
extends FilteredCdmResourceSelectionDialog
{
34 public FilteredNameSelectionDialog(Shell shell
) {
35 super(shell
, "Select Name");
38 private static final Logger logger
= Logger
39 .getLogger(FilteredNameSelectionDialog
.class);
41 public static final String SETTINGS
= FilteredNameSelectionDialog
.class.getCanonicalName();
46 * @see eu.etaxonomy.taxeditor.dialogs.FilteredCdmResourceSelectionDialog#getSettings()
48 public String
getSettings() {
50 throw new IllegalStateException("No SETTINGS set.");
56 * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter, org.eclipse.core.runtime.IProgressMonitor)
59 protected void fillContentProvider(AbstractContentProvider contentProvider
,
60 ItemsFilter itemsFilter
, IProgressMonitor progressMonitor
)
61 throws CoreException
{
62 List
<TaxonNameBase
> names
= CdmStore
.searchNameString("*");
63 progressMonitor
.beginTask("Looking for references", names
.size());
64 for (TaxonNameBase name
: names
){
65 contentProvider
.add(name
, itemsFilter
);
66 progressMonitor
.worked(1);