Revision 0cec47a5
Added by Cherian Mathew almost 11 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenuFactory.java | ||
---|---|---|
53 | 53 |
// if term type has a parent, do not add it |
54 | 54 |
// it will be added in the recursive call |
55 | 55 |
if(tt.getKindOf() == null) { |
56 |
IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator); |
|
57 |
|
|
58 |
if(ici != null) { |
|
59 |
System.out.println("Adding : " + tt.getMessage()); |
|
56 |
IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator); |
|
57 |
if(ici != null) { |
|
60 | 58 |
dtMenuManager.add(ici); |
61 | 59 |
} |
62 | 60 |
} |
... | ... | |
67 | 65 |
|
68 | 66 |
Set<TermType> children = termType.getGeneralizationOf(); |
69 | 67 |
// term type has no children, so create menu item |
70 |
if(children.isEmpty()) { |
|
71 |
System.out.println("No children for : " + termType.getMessage()); |
|
68 |
if(children.isEmpty()) { |
|
72 | 69 |
return createMenuItem(termType, serviceLocator); |
73 | 70 |
} |
74 |
// term type has children, so create sub menu |
|
75 |
System.out.println("Children for : " + termType.getMessage()); |
|
71 |
// term type has children, so create sub menu |
|
76 | 72 |
MenuManager dtMenuManager = |
77 | 73 |
new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu"); |
78 | 74 |
dtMenuManager.setVisible(true); |
79 | 75 |
dtMenuManager.add(createDefaultMenuItem(termType, serviceLocator)); |
80 | 76 |
// add child items to the sub menu |
81 |
for(TermType tt : children) { |
|
82 |
System.out.println("Child : " + tt.getMessage()); |
|
77 |
for(TermType tt : children) { |
|
83 | 78 |
IContributionItem item = addChildTermsToMenuManager(tt,serviceLocator); |
84 |
if(item != null) { |
|
85 |
System.out.println("Adding : " + tt.getMessage() + " to " + termType.getMessage()); |
|
79 |
if(item != null) { |
|
86 | 80 |
dtMenuManager.add(item); |
87 | 81 |
} |
88 | 82 |
} |
... | ... | |
94 | 88 |
|
95 | 89 |
Map<String, String> params = new HashMap<String, String>(); |
96 | 90 |
params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid", |
97 |
termType.getUuid().toString()); |
|
98 |
System.out.println("Term Type UUID : " + termType.getUuid().toString()); |
|
91 |
termType.getUuid().toString()); |
|
99 | 92 |
|
100 | 93 |
CommandContributionItemParameter p = new CommandContributionItemParameter( |
101 | 94 |
serviceLocator, |
... | ... | |
121 | 114 |
|
122 | 115 |
Map<String, String> params = new HashMap<String, String>(); |
123 | 116 |
params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid", |
124 |
termType.getUuid().toString()); |
|
125 |
System.out.println("Term Type UUID : " + termType.getUuid().toString()); |
|
117 |
termType.getUuid().toString()); |
|
126 | 118 |
|
127 | 119 |
CommandContributionItemParameter p = new CommandContributionItemParameter( |
128 | 120 |
serviceLocator, |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java | ||
---|---|---|
7 | 7 |
|
8 | 8 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
9 | 9 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
10 |
import eu.etaxonomy.cdm.model.common.TermType; |
|
10 | 11 |
import eu.etaxonomy.cdm.model.description.PolytomousKey; |
11 | 12 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
12 | 13 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
... | ... | |
29 | 30 |
} |
30 | 31 |
|
31 | 32 |
@Override |
32 |
public DefinedTerm createNewElement() { |
|
33 |
return DefinedTerm.NewInstance(); |
|
33 |
public DefinedTerm createNewElement() { |
|
34 |
return DefinedTerm.NewInstance(TermType.Scope); |
|
35 |
|
|
34 | 36 |
} |
35 | 37 |
|
36 | 38 |
@Override |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java | ||
---|---|---|
547 | 547 |
|
548 | 548 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
549 | 549 |
|
550 |
DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory |
|
551 |
.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, |
|
552 |
getConversationHolder(), parent, Section.TWISTIE); |
|
553 |
|
|
554 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
550 |
// DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
|
|
551 |
// .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
|
|
552 |
// getConversationHolder(), parent, Section.TWISTIE);
|
|
553 |
// |
|
554 |
// formFactory.createHorizontalSeparator(parent, SWT.BORDER);
|
|
555 | 555 |
|
556 | 556 |
ScopeSection scopeSection = (ScopeSection) formFactory |
557 | 557 |
.createEntityDetailSection(EntityDetailType.SCOPE, |
... | ... | |
562 | 562 |
addPart(descriptionDetailSection); |
563 | 563 |
addPart(naturalLanguageSection); |
564 | 564 |
addPart(describedSpecimenSection); |
565 |
addPart(descriptionSourceSection); |
|
565 |
// addPart(descriptionSourceSection);
|
|
566 | 566 |
addPart(scopeSection); |
567 | 567 |
} |
568 | 568 |
|
Also available in: Unified diff
ScopeRestrictionSection : creating new DefinedTerm with TermType:Scope
DetailsViewer : removed (for the moment commented out) DescriptionSourceSection since this is already in the supplemental details viewer
DefinedTermMenuFactory : code clean up