Revision 72996734
Added by Patrick Plitzner over 9 years ago
- implemented functionality to reuse media in MediaView (#2385)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java | ||
---|---|---|
46 | 46 |
*/ |
47 | 47 |
public class SelectionDialogFactory { |
48 | 48 |
|
49 |
public static <T extends ICdmBase> T getSelectionFromDialog(Class<T> clazz, Shell shell, ConversationHolder conversation, T curentSelection){ |
|
49 |
public static <T extends ICdmBase> T getSelectionFromDialog(Class<T> clazz, Shell shell, ConversationHolder conversation, T currentSelection){
|
|
50 | 50 |
|
51 | 51 |
if(clazz.equals(Taxon.class)){ |
52 |
return (T) TaxonBaseSelectionDialog.selectTaxon(shell, conversation, (Taxon) curentSelection); |
|
52 |
return (T) TaxonBaseSelectionDialog.selectTaxon(shell, conversation, (Taxon) currentSelection);
|
|
53 | 53 |
} |
54 | 54 |
if(clazz.equals(Synonym.class)){ |
55 | 55 |
return (T) TaxonBaseSelectionDialog.selectSynonym(shell, conversation); |
... | ... | |
58 | 58 |
return (T) TaxonBaseSelectionDialog.selectTaxonBase(shell, conversation); |
59 | 59 |
} |
60 | 60 |
if(clazz.equals(Classification.class)){ |
61 |
return (T) ClassificationSelectionDialog.select(shell, conversation, (Classification) curentSelection); |
|
61 |
return (T) ClassificationSelectionDialog.select(shell, conversation, (Classification) currentSelection);
|
|
62 | 62 |
} |
63 | 63 |
if(clazz.equals(TaxonNode.class)){ |
64 |
return (T) TaxonNodeSelectionDialog.select(shell, conversation, null, null, (TaxonNode) curentSelection, null); |
|
64 |
return (T) TaxonNodeSelectionDialog.select(shell, conversation, null, null, (TaxonNode) currentSelection, null);
|
|
65 | 65 |
} |
66 | 66 |
if(clazz.equals(Reference.class)){ |
67 |
return (T) ReferenceSelectionDialog.select(shell, conversation, (Reference) curentSelection); |
|
67 |
return (T) ReferenceSelectionDialog.select(shell, conversation, (Reference) currentSelection);
|
|
68 | 68 |
} |
69 | 69 |
if(clazz.equals(TaxonNameBase.class)){ |
70 |
return (T) NameSelectionDialog.select(shell, conversation, (TaxonNameBase) curentSelection); |
|
70 |
return (T) NameSelectionDialog.select(shell, conversation, (TaxonNameBase) currentSelection);
|
|
71 | 71 |
} |
72 | 72 |
if(clazz.equals(Team.class)){ |
73 |
return (T) TeamSelectionDialog.select(shell, conversation, (Team) curentSelection); |
|
73 |
return (T) TeamSelectionDialog.select(shell, conversation, (Team) currentSelection);
|
|
74 | 74 |
} |
75 | 75 |
if(clazz.equals(AgentBase.class)){ |
76 |
return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) curentSelection); |
|
76 |
return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection);
|
|
77 | 77 |
} |
78 | 78 |
if(clazz.equals(Feature.class)){ |
79 |
return (T) FeatureSelectionDialog.select(shell, conversation, (Feature) curentSelection); |
|
79 |
return (T) FeatureSelectionDialog.select(shell, conversation, (Feature) currentSelection);
|
|
80 | 80 |
} |
81 | 81 |
if(clazz.equals(FeatureTree.class)){ |
82 |
return (T) FeatureTreeSelectionDialog.select(shell, conversation, (FeatureTree) curentSelection); |
|
82 |
return (T) FeatureTreeSelectionDialog.select(shell, conversation, (FeatureTree) currentSelection);
|
|
83 | 83 |
} |
84 | 84 |
if(clazz.equals(PolytomousKey.class)){ |
85 |
return (T) PolytomousKeySelectionDialog.select(shell, conversation, (PolytomousKey) curentSelection); |
|
85 |
return (T) PolytomousKeySelectionDialog.select(shell, conversation, (PolytomousKey) currentSelection);
|
|
86 | 86 |
} |
87 | 87 |
if(clazz.equals(PolytomousKeyNode.class)){ |
88 | 88 |
MessagingUtils.warningDialog("Not implemented yet", SelectionDialogFactory.class, |
... | ... | |
90 | 90 |
return null; |
91 | 91 |
} |
92 | 92 |
if(clazz.equals(DerivedUnit.class)){ |
93 |
return (T) DerivedUnitSelectionDialog.select(shell, conversation, (DerivedUnit) curentSelection); |
|
93 |
return (T) DerivedUnitSelectionDialog.select(shell, conversation, (DerivedUnit) currentSelection);
|
|
94 | 94 |
} |
95 | 95 |
if(clazz.equals(FieldUnit.class)){ |
96 |
return (T) FieldUnitSelectionDialog.select(shell, conversation, (FieldUnit) curentSelection); |
|
96 |
return (T) FieldUnitSelectionDialog.select(shell, conversation, (FieldUnit) currentSelection);
|
|
97 | 97 |
} |
98 | 98 |
if(clazz.equals(NamedArea.class)){ |
99 |
return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) curentSelection); |
|
99 |
return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) currentSelection);
|
|
100 | 100 |
} |
101 | 101 |
if(clazz.equals(Collection.class)){ |
102 |
return (T) CollectionSelectionDialog.select(shell, conversation, (Collection) curentSelection); |
|
102 |
return (T) CollectionSelectionDialog.select(shell, conversation, (Collection) currentSelection);
|
|
103 | 103 |
} |
104 | 104 |
if(clazz.equals(User.class)){ |
105 |
return (T) UserSelectionDialog.select(shell, conversation, (User) curentSelection); |
|
105 |
return (T) UserSelectionDialog.select(shell, conversation, (User) currentSelection);
|
|
106 | 106 |
} |
107 | 107 |
if(clazz.equals(GrantedAuthorityImpl.class)){ |
108 |
return (T) GrantedAuthoritySelectionDialog.select(shell, conversation, (GrantedAuthorityImpl) curentSelection); |
|
108 |
return (T) GrantedAuthoritySelectionDialog.select(shell, conversation, (GrantedAuthorityImpl) currentSelection);
|
|
109 | 109 |
} |
110 | 110 |
if (clazz.equals(Person.class)){ |
111 |
return (T) PersonSelectionDialog.select(shell, conversation, (Person) curentSelection); |
|
111 |
return (T) PersonSelectionDialog.select(shell, conversation, (Person) currentSelection);
|
|
112 | 112 |
} |
113 | 113 |
if(clazz.equals(Group.class)){ |
114 |
return (T) GroupSelectionDialog.select(shell, conversation, (Group) curentSelection); |
|
114 |
return (T) GroupSelectionDialog.select(shell, conversation, (Group) currentSelection);
|
|
115 | 115 |
} |
116 | 116 |
if(clazz.equals(Institution.class)){ |
117 |
return (T) InstitutionSelectionDialog.select(shell, conversation, (Institution) curentSelection); |
|
117 |
return (T) InstitutionSelectionDialog.select(shell, conversation, (Institution) currentSelection);
|
|
118 | 118 |
} |
119 | 119 |
if(clazz.equals(Primer.class)){ |
120 |
return (T) PrimerSelectionDialog.select(shell, conversation, (Primer) curentSelection); |
|
120 |
return (T) PrimerSelectionDialog.select(shell, conversation, (Primer) currentSelection);
|
|
121 | 121 |
} |
122 | 122 |
if(clazz.equals(Amplification.class)){ |
123 |
return (T) AmplificationSelectionDialog.select(shell, conversation, (Amplification) curentSelection); |
|
123 |
return (T) AmplificationSelectionDialog.select(shell, conversation, (Amplification) currentSelection);
|
|
124 | 124 |
} |
125 | 125 |
|
126 | 126 |
return null; |
Also available in: Unified diff