.
[taxeditor.git] / taxeditor-bulkeditor / src / main / java / eu / etaxonomy / taxeditor / bulkeditor / input / BulkEditorInput.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 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.bulkeditor.input;
11
12 import java.beans.PropertyChangeSupport;
13
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.model.common.MarkerType;
19 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery;
20
21 /**
22 * @author p.ciardelli
23 * @created 25.06.2009
24 * @version 1.0
25 * @param <T>
26 */
27 abstract public class BulkEditorInput extends PropertyChangeSupport implements IEditorInput {
28
29 /**
30 * @param sourceBean
31 */
32 public BulkEditorInput(Object sourceBean) {
33 super(sourceBean);
34 }
35
36 public static final String QUERY_CHANGED = "query_changed";
37
38 static public BulkEditorInput NewInstance(String inputType) {
39
40 if (ReferenceEditorInput.getID().equals(inputType)) {
41 return new ReferenceEditorInput();
42 }
43
44 if (NameEditorInput.getID().equals(inputType)) {
45 return new NameEditorInput();
46 }
47
48 if (AgentEditorInput.getID().equals(inputType)) {
49 return new AgentEditorInput();
50 }
51
52 return null;
53 }
54
55 private IBulkEditorQuery query;
56
57 /* (non-Javadoc)
58 * @see org.eclipse.ui.IEditorInput#exists()
59 */
60 public boolean exists() {
61 // TODO Auto-generated method stub
62 return false;
63 }
64
65 /* (non-Javadoc)
66 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
67 */
68 public ImageDescriptor getImageDescriptor() {
69 // TODO Auto-generated method stub
70 return null;
71 }
72
73 /* (non-Javadoc)
74 * @see org.eclipse.ui.IEditorInput#getPersistable()
75 */
76 public IPersistableElement getPersistable() {
77 return null;
78 }
79
80 /* (non-Javadoc)
81 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
82 */
83 @SuppressWarnings("unchecked")
84 public Object getAdapter(Class adapter) {
85 return null;
86 }
87
88 /**
89 * @param bulkEditorQuery
90 */
91 public void setQuery(IBulkEditorQuery bulkEditorQuery) {
92
93 this.query = bulkEditorQuery;
94
95 if (query != null) {
96 firePropertyChange(QUERY_CHANGED, null, null);
97 }
98 }
99
100 public IBulkEditorQuery getQuery() {
101 return query;
102 }
103
104 public boolean isMergingEnabled() {
105 return false;
106 }
107
108 /**
109 * @param markerType
110 * @return
111 */
112 public boolean isMarkerTypeEditingEnabled(MarkerType markerType) {
113 return false;
114 }
115 }