Merge branch 'develop' into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / dataimport / DataImportEditorInput.java
1 /**
2 * Copyright (C) 2014 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.taxeditor.view.dataimport;
10
11 import java.util.Collection;
12
13 import org.apache.log4j.Logger;
14 import org.eclipse.jface.resource.ImageDescriptor;
15 import org.eclipse.ui.IEditorInput;
16 import org.eclipse.ui.IPersistableElement;
17
18 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
19 import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
20 import eu.etaxonomy.taxeditor.store.CdmStore;
21
22 /**
23 * Input for {@link DataImportEditor}. This class queries a data source for
24 * occurrences and passes them to the editor.
25 *
26 * @author pplitzner
27 * @date 25.02.2014
28 *
29 */
30 public abstract class DataImportEditorInput<T> implements IEditorInput {
31
32 protected static Logger logger = Logger.getLogger(DataImportEditorInput.class);
33
34 private Collection<T> results;
35
36 private final ConversationHolder conversationHolder;
37
38 protected OccurenceQuery query;
39
40 public DataImportEditorInput() {
41 this.conversationHolder = CdmStore.createConversation();
42 }
43
44 @Override
45 public Object getAdapter(Class adapter) {
46 // TODO Auto-generated method stub
47 return null;
48 }
49
50 @Override
51 public boolean exists() {
52 return false;
53 }
54
55 @Override
56 public ImageDescriptor getImageDescriptor() {
57 // TODO Auto-generated method stub
58 return null;
59 }
60
61 @Override
62 public IPersistableElement getPersistable() {
63 return null;
64 }
65
66 public Collection<T> getResults() {
67 return results;
68 }
69
70 public void setResults(Collection<T> results) {
71 this.results = results;
72 }
73
74 public ConversationHolder getConversationHolder() {
75 return conversationHolder;
76 }
77
78 @Override
79 public abstract int hashCode();
80
81 @Override
82 public abstract boolean equals(Object obj);
83
84
85 public abstract void query();
86 }