Revision 8481f952
Added by Andreas Müller almost 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaSection.java | ||
---|---|---|
19 | 19 |
* <p>MediaSection class.</p> |
20 | 20 |
* |
21 | 21 |
* @author nho |
22 |
* @version $Id: $ |
|
23 | 22 |
*/ |
24 | 23 |
public class MediaSection extends AbstractEntityCollectionSection<IdentifiableMediaEntity, Media>{ |
25 | 24 |
|
... | ... | |
35 | 34 |
super(cdmFormFactory, conversation, parentElement, "Media", style); |
36 | 35 |
} |
37 | 36 |
|
38 |
/** {@inheritDoc} */ |
|
39 | 37 |
@Override |
40 | 38 |
public Media createNewElement() { |
41 | 39 |
return Media.NewInstance(); |
42 | 40 |
} |
43 | 41 |
|
44 |
/** {@inheritDoc} */ |
|
45 | 42 |
@Override |
46 | 43 |
public Collection<Media> getCollection(IdentifiableMediaEntity entity) { |
47 | 44 |
return entity.getMedia(); |
... | ... | |
52 | 49 |
return new DefaultCdmBaseComparator<>(); |
53 | 50 |
} |
54 | 51 |
|
55 |
/** {@inheritDoc} */ |
|
56 | 52 |
@Override |
57 | 53 |
public String getEmptyString() { |
58 | 54 |
return "No media yet."; |
59 | 55 |
} |
60 | 56 |
|
61 |
/** {@inheritDoc} */ |
|
62 | 57 |
@Override |
63 | 58 |
protected String getTooltipString() { |
64 | 59 |
return "Create new media"; |
65 | 60 |
} |
66 | 61 |
|
67 |
/** {@inheritDoc} */ |
|
68 | 62 |
@Override |
69 | 63 |
public void addElement(Media element) { |
70 | 64 |
getEntity().addMedia(element); |
71 | 65 |
} |
72 | 66 |
|
73 |
/** {@inheritDoc} */ |
|
74 | 67 |
@Override |
75 | 68 |
public void removeElement(Media element) { |
76 | 69 |
getEntity().removeMedia(element); |
77 | 70 |
} |
78 | 71 |
|
79 |
/** |
|
80 |
* {@inheritDoc} |
|
81 |
*/ |
|
82 | 72 |
@Override |
83 | 73 |
public Media addExisting() { |
84 |
return MediaSelectionDialog.select(getShell(), //getConversationHolder(), |
|
85 |
null); |
|
74 |
return MediaSelectionDialog.select(getShell(), null); |
|
86 | 75 |
} |
87 | 76 |
|
88 |
/** |
|
89 |
* {@inheritDoc} |
|
90 |
*/ |
|
91 | 77 |
@Override |
92 | 78 |
public boolean allowAddExisting() { |
93 | 79 |
return true; |
94 | 80 |
} |
95 |
|
|
96 |
|
|
97 | 81 |
} |
Also available in: Unified diff
cleanup