Revision f8c6c088
Added by Katja Luther about 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java | ||
---|---|---|
3 | 3 |
*/ |
4 | 4 |
package eu.etaxonomy.taxeditor.ui.section.media; |
5 | 5 |
|
6 |
import org.apache.commons.lang.StringUtils; |
|
6 | 7 |
import org.eclipse.jface.action.IAction; |
8 |
import org.eclipse.swt.SWT; |
|
7 | 9 |
import org.eclipse.swt.events.SelectionAdapter; |
8 | 10 |
import org.eclipse.swt.events.SelectionEvent; |
9 | 11 |
import org.eclipse.swt.events.SelectionListener; |
10 | 12 |
import org.eclipse.swt.widgets.Button; |
13 |
import org.eclipse.swt.widgets.Event; |
|
14 |
import org.eclipse.swt.widgets.Listener; |
|
11 | 15 |
|
12 | 16 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
13 | 17 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
... | ... | |
25 | 29 |
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator; |
26 | 30 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection; |
27 | 31 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; |
32 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection; |
|
28 | 33 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
29 | 34 |
|
30 | 35 |
/** |
... | ... | |
48 | 53 |
if(cdmFormFactory.getSelectionProvider() != null){ |
49 | 54 |
selectionArbitrator = cdmFormFactory.createSelectionArbitrator(this); |
50 | 55 |
} |
56 |
|
|
57 |
|
|
51 | 58 |
} |
52 | 59 |
|
53 | 60 |
/** {@inheritDoc} */ |
... | ... | |
65 | 72 |
}); |
66 | 73 |
text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style); |
67 | 74 |
selection_artist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), element, "Artist", null, EntitySelectionElement.ALL, style); |
75 |
addElement(selection_artist); |
|
68 | 76 |
text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, true, style); |
69 | 77 |
mediaDetailElement = formFactory.createMediaDetailElement(element); |
78 |
addElement(mediaDetailElement); |
|
70 | 79 |
} |
71 | 80 |
|
72 | 81 |
/** {@inheritDoc} */ |
... | ... | |
84 | 93 |
LanguageString title = element.getTitle(CdmStore.getDefaultLanguage()); |
85 | 94 |
|
86 | 95 |
if (title == null) { |
87 |
title = LanguageString.NewInstance("", CdmStore.getDefaultLanguage());
|
|
96 |
title = LanguageString.NewInstance(element.getTitleCache(), CdmStore.getDefaultLanguage());
|
|
88 | 97 |
} |
89 | 98 |
|
90 | 99 |
text_title.setLanguageString(title); |
100 |
|
|
91 | 101 |
} |
92 | 102 |
|
93 | 103 |
@Override |
94 | 104 |
protected Media selectFromDialog() { |
95 |
return MediaSelectionDialog.select(AbstractUtility.getShell(), null, null); |
|
105 |
|
|
106 |
setEntity(MediaSelectionDialog.select(AbstractUtility.getShell(), null, null)); |
|
107 |
return entity; |
|
96 | 108 |
} |
97 | 109 |
|
98 | 110 |
@Override |
... | ... | |
101 | 113 |
} |
102 | 114 |
|
103 | 115 |
/** {@inheritDoc} */ |
104 |
@Override
|
|
116 |
@Override |
|
105 | 117 |
public void handleEvent(Object eventSource) { |
106 | 118 |
if (eventSource == selection_artist) { |
107 | 119 |
getEntity().setArtist(selection_artist.getSelection()); |
Also available in: Unified diff
add media bulk editor see #4730