Revision 3a6a6dab
Added by Andreas Müller about 3 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateNewTaxonBaseOperation.java | ||
---|---|---|
16 | 16 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
17 | 17 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
18 | 18 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
19 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
|
20 | 19 |
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4; |
20 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
|
21 | 21 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
22 | 22 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
23 | 23 |
|
24 | 24 |
/** |
25 | 25 |
* @author k.luther |
26 | 26 |
* @since 02.05.2018 |
27 |
* |
|
28 | 27 |
*/ |
29 | 28 |
public abstract class CreateNewTaxonBaseOperation extends AbstractPostTaxonOperation { |
30 | 29 |
|
31 |
/** |
|
32 |
* @param label |
|
33 |
* @param undoContext |
|
34 |
* @param taxonUuid |
|
35 |
*/ |
|
36 | 30 |
public CreateNewTaxonBaseOperation(String label, IUndoContext undoContext, UUID taxonUuid) { |
37 | 31 |
super(label, undoContext, taxonUuid); |
38 | 32 |
|
39 | 33 |
} |
40 | 34 |
|
41 |
/** |
|
42 |
* @param label |
|
43 |
* @param undoContext |
|
44 |
* @param taxon |
|
45 |
* @param postOperationEnabled |
|
46 |
*/ |
|
47 | 35 |
public CreateNewTaxonBaseOperation(String label, IUndoContext undoContext, Taxon taxon, |
48 | 36 |
IPostOperationEnabled postOperationEnabled) { |
49 | 37 |
super(label, undoContext, taxon, postOperationEnabled); |
50 | 38 |
} |
51 | 39 |
|
52 |
/** |
|
53 |
* @param newTaxonBase |
|
54 |
*/ |
|
55 | 40 |
protected void addToSaveList(CdmBase newCdmBase) { |
56 | 41 |
TaxonNameEditorE4 editor = null; |
57 |
Object activePart = EditorUtil.getActivePart();
|
|
42 |
Object activePart = AbstractUtility.getActivePart();
|
|
58 | 43 |
if (activePart instanceof TaxonNameEditorE4){ |
59 | 44 |
editor = (TaxonNameEditorE4) activePart; |
60 | 45 |
if (newCdmBase instanceof Synonym){ |
... | ... | |
67 | 52 |
editor.setDirty(); |
68 | 53 |
} |
69 | 54 |
} |
70 |
|
|
71 | 55 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/InspectSessionsDialog.java | ||
---|---|---|
157 | 157 |
|
158 | 158 |
class SessionsTreeContentProvider implements ITreeContentProvider { |
159 | 159 |
|
160 |
|
|
161 |
|
|
162 |
/* (non-Javadoc) |
|
163 |
* @see org.eclipse.jface.viewers.IContentProvider#dispose() |
|
164 |
*/ |
|
165 | 160 |
@Override |
166 | 161 |
public void dispose() { |
167 | 162 |
|
168 | 163 |
} |
169 | 164 |
|
170 |
/* (non-Javadoc) |
|
171 |
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) |
|
172 |
*/ |
|
173 | 165 |
@Override |
174 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
|
175 |
|
|
176 |
|
|
177 |
} |
|
166 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} |
|
178 | 167 |
|
179 |
/* (non-Javadoc) |
|
180 |
* @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object) |
|
181 |
*/ |
|
182 | 168 |
@Override |
183 | 169 |
public Object[] getElements(Object inputElement) { |
184 | 170 |
return (CdmEntityInfo[])inputElement; |
185 | 171 |
} |
186 | 172 |
|
187 |
/* (non-Javadoc) |
|
188 |
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) |
|
189 |
*/ |
|
190 | 173 |
@Override |
191 | 174 |
public Object[] getChildren(Object parentElement) { |
192 | 175 |
List<CdmEntityInfo> children = ((CdmEntityInfo)parentElement).getChildren(); |
193 | 176 |
return children.toArray(); |
194 | 177 |
} |
195 | 178 |
|
196 |
/* (non-Javadoc) |
|
197 |
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) |
|
198 |
*/ |
|
199 | 179 |
@Override |
200 | 180 |
public Object getParent(Object element) { |
201 | 181 |
CdmEntityInfo cei = (CdmEntityInfo)element; |
202 | 182 |
return cei.getParent(); |
203 | 183 |
} |
204 | 184 |
|
205 |
/* (non-Javadoc) |
|
206 |
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) |
|
207 |
*/ |
|
208 | 185 |
@Override |
209 | 186 |
public boolean hasChildren(Object element) { |
210 | 187 |
List<CdmEntityInfo> children = ((CdmEntityInfo)element).getChildren(); |
... | ... | |
223 | 200 |
return (CdmModelFieldPropertyFromClass) e.getObjectValue(); |
224 | 201 |
} |
225 | 202 |
} |
226 |
|
|
227 | 203 |
} |
228 | 204 |
|
229 | 205 |
class SessionsTreeLabelProvider extends StyledCellLabelProvider implements ILabelProvider { |
... | ... | |
240 | 216 |
super.update(cell); |
241 | 217 |
} |
242 | 218 |
|
243 |
/* (non-Javadoc) |
|
244 |
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) |
|
245 |
*/ |
|
246 | 219 |
@Override |
247 | 220 |
public Image getImage(Object element) { |
248 | 221 |
// TODO Auto-generated method stub |
249 | 222 |
return null; |
250 | 223 |
} |
251 | 224 |
|
252 |
/* (non-Javadoc) |
|
253 |
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) |
|
254 |
*/ |
|
255 | 225 |
@Override |
256 | 226 |
public String getText(Object element) { |
257 | 227 |
CdmEntityInfo cei = (CdmEntityInfo)element; |
258 | 228 |
return cei.getLabel(); |
259 | 229 |
} |
260 | 230 |
} |
261 |
} |
|
262 |
|
|
263 |
|
|
231 |
} |
Also available in: Unified diff
cleanup