private Set<T> transientCdmObjects = new HashSet<T>();
private String settings;
+ protected T cdmBaseToBeFiltered;
+
/**
* <p>Constructor for AbstractFilteredCdmResourceSelectionDialog.</p>
*
@Override
public void refresh() {
initModel();
+ filterExcludedObjects();
super.refresh();
}
/** {@inheritDoc} */
public void update(CdmDataChangeMap changeEvents) {}
+
+ /**
+ * Don't want to add a taxon or synonym to itself so filter the list to remove the taxon in question
+ * so it is not available to add as a concept relation
+ */
+ private void filterExcludedObjects() {
+ if (model != null && cdmBaseToBeFiltered != null) {
+
+ UuidAndTitleCache uuidAndTitleCacheToRemove = null;
+
+ for (UuidAndTitleCache uuidAndTitleCache : model){
+ if ((cdmBaseToBeFiltered.getUuid()).equals(uuidAndTitleCache.getUuid())) {
+ uuidAndTitleCacheToRemove = uuidAndTitleCache;
+ }
+ }
+ model.remove(uuidAndTitleCacheToRemove);
+ }
+ }
}