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