Project

General

Profile

« Previous | Next » 

Revision 1c9c9562

Added by Patrick Plitzner almost 7 years ago

ref #6762 Implement option to add kindOf related terms in term editor

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateDefinedTermOperation.java
36 36

  
37 37
	private final TermBase parentTermBase;
38 38
	private final TermEditorInput definedTermInput;
39
    private boolean addTermAsKindOf;
40

  
39 41

  
40 42
	/**
41 43
	 * @param label
42 44
	 * @param undoContext
43 45
	 * @param postOperationEnabled
46
	 * @param addTermAsKindOf
44 47
	 */
45 48
	public CreateDefinedTermOperation(String label,
46 49
			IUndoContext undoContext,
47 50
			TermBase termBase,
48 51
			TermEditorInput definedTermInput,
49
			IPostOperationEnabled postOperationEnabled) {
52
			IPostOperationEnabled postOperationEnabled, boolean addTermAsKindOf) {
50 53
		super(label, undoContext, postOperationEnabled);
51 54
		this.parentTermBase = termBase;
52 55
		this.definedTermInput = definedTermInput;
56
		this.addTermAsKindOf = addTermAsKindOf;
53 57
	}
54 58

  
55 59
	/* (non-Javadoc)
......
75 79
			vocabulary.addTerm(newTerm);
76 80
		} else if (parentTermBase instanceof DefinedTermBase) {
77 81
			DefinedTermBase parent = (DefinedTermBase) parentTermBase;
78
			parent.addIncludes(newTerm);
82
			if(addTermAsKindOf){
83
			    parent.addGeneralizationOf(newTerm);
84
			}
85
			else{
86
			    parent.addIncludes(newTerm);
87
			}
79 88
			TermVocabulary vocabulary = parent.getVocabulary();
80 89
			vocabulary.addTerm(newTerm);
81 90
		}

Also available in: Unified diff