Revision d31115e0
Added by Niels Hoffmann over 13 years ago
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/name/ProtologueElement.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.section.name; |
12 | 12 |
|
13 |
import java.net.URI; |
|
14 |
import java.net.URISyntaxException; |
|
15 |
|
|
13 | 16 |
import org.eclipse.swt.events.SelectionListener; |
14 | 17 |
|
15 | 18 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
16 | 19 |
import eu.etaxonomy.cdm.model.media.Media; |
17 | 20 |
import eu.etaxonomy.cdm.model.media.MediaRepresentation; |
18 | 21 |
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart; |
22 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
|
19 | 23 |
import eu.etaxonomy.taxeditor.forms.AbstractFormSection; |
20 | 24 |
import eu.etaxonomy.taxeditor.forms.CdmFormFactory; |
21 | 25 |
import eu.etaxonomy.taxeditor.forms.ICdmFormElement; |
... | ... | |
89 | 93 |
|
90 | 94 |
mediaRepresentationPart = mediaRepresentation.getParts().iterator().next(); |
91 | 95 |
|
92 |
protologueUriText.setText(mediaRepresentationPart.getUri()); |
|
96 |
protologueUriText.setText(mediaRepresentationPart.getUri().toString());
|
|
93 | 97 |
} |
94 | 98 |
|
95 | 99 |
/* (non-Javadoc) |
... | ... | |
112 | 116 |
@Override |
113 | 117 |
public void handleEvent(Object eventSource) { |
114 | 118 |
if(eventSource == protologueUriText){ |
115 |
mediaRepresentationPart.setUri(protologueUriText.getText()); |
|
119 |
try { |
|
120 |
mediaRepresentationPart.setUri(new URI(protologueUriText.getText())); |
|
121 |
} catch (URISyntaxException e) { |
|
122 |
EditorUtil.warningDialog("Could not parse URI", getClass(), e.getMessage()); |
|
123 |
} |
|
116 | 124 |
} |
117 | 125 |
} |
118 | 126 |
} |
Also available in: Unified diff
added a readme file