public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmBase> extends
FilteredItemsSelectionDialog implements IConversationEnabled {
- private ConversationHolder conversation;
+ private final ConversationHolder conversation;
protected List<UuidAndTitleCache<T>> model;
- private Set<T> transientCdmObjects = new HashSet<T>();
- private String settings;
+ private final Set<T> transientCdmObjects = new HashSet<T>();
+ private final String settings;
-
+
protected T cdmBaseToBeFiltered;
-
+
/**
* <p>Constructor for AbstractFilteredCdmResourceSelectionDialog.</p>
*
lastCompletedFilter.setAccessible(true);
lastCompletedFilter.set(this, null);
} catch (SecurityException e) {
- StoreUtil.error(getClass(), e);
+ AbstractUtility.error(getClass(), e);
} catch (NoSuchFieldException e) {
- StoreUtil.error(getClass(), e);
+ AbstractUtility.error(getClass(), e);
} catch (IllegalArgumentException e) {
- StoreUtil.error(getClass(), e);
+ AbstractUtility.error(getClass(), e);
} catch (IllegalAccessException e) {
- StoreUtil.error(getClass(), e);
+ AbstractUtility.error(getClass(), e);
}
-
- // this also is not the nicest way to do it.
+
+ // this also is not the nicest way to do it.
// I am still amazed, that FilteredSelectionDialog does not offer any methods to change its data
// once it was opened. Am I doing it wrong?
String pattern = getTitle(cdmObject);
@Override
protected Comparator getItemsComparator() {
return new Comparator<UuidAndTitleCache>() {
- public int compare(UuidAndTitleCache entity1,
+ @Override
+ public int compare(UuidAndTitleCache entity1,
UuidAndTitleCache entity2) {
Collator collator = Collator.getInstance();
return collator.compare(entity1.getTitleCache(), entity2.getTitleCache());
/*
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.SelectionHistory#restoreItemFromMemento(org.eclipse.ui.IMemento)
*/
- protected Object restoreItemFromMemento(IMemento element) {
+ @Override
+ protected Object restoreItemFromMemento(IMemento element) {
return element.getString("resource"); //$NON-NLS-1$
}
/*
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.SelectionHistory#storeItemToMemento(java.lang.Object,
* org.eclipse.ui.IMemento)
*/
- protected void storeItemToMemento(Object item, IMemento element) {
+ @Override
+ protected void storeItemToMemento(Object item, IMemento element) {
element.putString("resource", item.toString()); //$NON-NLS-1$
}
}
* @return a {@link eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard} object.
*/
protected abstract AbstractNewEntityWizard getNewEntityWizard(String parameter);
-
+
public class FilteredCdmResourceLabelProvider extends LabelProvider {
- public String getText(Object element) {
+ @Override
+ public String getText(Object element) {
if (element == null) {
return null;
}
*
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
*/
- public ConversationHolder getConversationHolder() {
+ @Override
+ public ConversationHolder getConversationHolder() {
return conversation;
}
-
+
/** {@inheritDoc} */
- public void update(CdmDataChangeMap changeEvents) {}
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {}
/**
- * Don't want to add for example a taxon or synonym to itself
- * so filter the list to remove the taxon in question
+ * Don't want to add for example a taxon or synonym to itself
+ * so filter the list to remove the taxon in question
* (<code>cdmBaseToBeFiltered</code>)
* so it is not available in the filtered list.
*/