Revision 191f2328
Added by Patrick Plitzner almost 9 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueElement.java | ||
---|---|---|
11 | 11 |
package eu.etaxonomy.taxeditor.ui.section.name; |
12 | 12 |
|
13 | 13 |
import java.net.URI; |
14 |
import java.net.URISyntaxException; |
|
15 | 14 |
|
16 | 15 |
import org.eclipse.swt.events.SelectionListener; |
17 | 16 |
|
... | ... | |
22 | 21 |
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart; |
23 | 22 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
24 | 23 |
import eu.etaxonomy.cdm.model.reference.Reference; |
25 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
26 | 24 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
27 | 25 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
28 | 26 |
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent; |
29 | 27 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
30 | 28 |
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement; |
31 | 29 |
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator; |
32 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
|
|
30 |
import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
|
|
33 | 31 |
import eu.etaxonomy.taxeditor.ui.openurl.IOpenUrlEnabled; |
34 | 32 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; |
35 | 33 |
|
... | ... | |
44 | 42 |
|
45 | 43 |
private final SelectionArbitrator selectionArbitrator; |
46 | 44 |
|
47 |
private TextWithLabelElement protologueUriText;
|
|
45 |
private UriWithLabelElement protologueUriText;
|
|
48 | 46 |
private MediaRepresentationPart mediaRepresentationPart; |
49 | 47 |
private Media media; |
50 | 48 |
private MediaRepresentation mediaRepresentation; |
... | ... | |
67 | 65 |
/** {@inheritDoc} */ |
68 | 66 |
@Override |
69 | 67 |
public void createControls(ICdmFormElement element, int style) { |
70 |
protologueUriText = formFactory.createTextWithLabelElement(this, "Protologue URI", "", style);
|
|
68 |
protologueUriText = formFactory.createUriWithLabelElement(element, "Protologue URI", null, style);
|
|
71 | 69 |
|
72 | 70 |
formFactory.createOpenUrlSelectorElement(element, "Query BHL for Reference Image", this, style); |
73 | 71 |
} |
... | ... | |
112 | 110 |
@Override |
113 | 111 |
public void handleEvent(Object eventSource) { |
114 | 112 |
if(eventSource == protologueUriText && protologueUriText.getText()!=null){ |
115 |
try { |
|
116 |
mediaRepresentationPart.setUri(new URI(protologueUriText.getText())); |
|
117 |
} catch (URISyntaxException e) { |
|
118 |
MessagingUtils.warningDialog("Could not parse URI", getClass(), e.getMessage()); |
|
119 |
} |
|
113 |
mediaRepresentationPart.setUri(protologueUriText.getUri()); |
|
120 | 114 |
} |
121 | 115 |
} |
122 | 116 |
|
Also available in: Unified diff
Show URI parsing exceptions below URI text field (fixes #5055, #5003, #4587)