Project

General

Profile

« Previous | Next » 

Revision eec49400

Added by Cherian Mathew almost 9 years ago

#5010 : Initial commit to fix duplicate entry issue when creating new key node

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyListContentProvider.java
1 1
// $Id$
2 2
/**
3 3
 * Copyright (C) 2007 EDIT
4
 * European Distributed Institute of Taxonomy 
4
 * European Distributed Institute of Taxonomy
5 5
 * http://www.e-taxonomy.eu
6
 * 
6
 *
7 7
 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
 * See LICENSE.TXT at the top of this package for the full license terms.
9 9
 */
......
16 16
import org.eclipse.jface.viewers.IStructuredContentProvider;
17 17
import org.eclipse.jface.viewers.Viewer;
18 18

  
19
import eu.etaxonomy.cdm.model.description.PolytomousKey;
20 19
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
21 20

  
22 21
/**
......
29 28

  
30 29
	/*
31 30
	 * (non-Javadoc)
32
	 * 
31
	 *
33 32
	 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
34 33
	 */
35 34
	@Override
......
38 37

  
39 38
	/*
40 39
	 * (non-Javadoc)
41
	 * 
40
	 *
42 41
	 * @see
43 42
	 * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
44 43
	 * .viewers.Viewer, java.lang.Object, java.lang.Object)
......
49 48

  
50 49
	/*
51 50
	 * (non-Javadoc)
52
	 * 
51
	 *
53 52
	 * @see
54 53
	 * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java
55 54
	 * .lang.Object)
56 55
	 */
57 56
	@Override
58 57
	public Object[] getElements(Object inputElement) {
59
		if (inputElement instanceof PolytomousKey) {
58
		if (inputElement instanceof PolytomousKeyEditorInput) {
60 59
			List<PolytomousKeyNode> result = new ArrayList<PolytomousKeyNode>();
61 60

  
62
			PolytomousKeyNode root = ((PolytomousKey) inputElement).getRoot();
61
			PolytomousKeyNode root = ((PolytomousKeyEditorInput) inputElement).getKey().getRoot();
63 62

  
64 63
			getChildrenBreadthFirst(result, root);
65 64
			return result.toArray();

Also available in: Unified diff