3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
;
12 import java
.net
.URISyntaxException
;
14 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
15 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
16 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.UriWithLabelElement
;
26 public class TermVocabularyDetailElement
extends AbstractTermBaseDetailElement
<TermVocabulary
> {
28 private UriWithLabelElement uri_uriTermSource
;
33 public TermVocabularyDetailElement(CdmFormFactory formFactory
,
34 ICdmFormElement formElement
) {
35 super(formFactory
, formElement
);
39 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
42 protected void createControls(ICdmFormElement formElement
,
43 TermVocabulary entity
, int style
) {
45 super.createControls(formElement
, entity
, style
);
46 uri_uriTermSource
= formFactory
.createUriWithLabelElement(formElement
, "Term Source URI", getEntity().getTermSourceUri(), style
);
50 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
53 public void handleEvent(Object eventSource
) {
55 handleRepresentation(eventSource
);
57 if (eventSource
== uri_uri
) {
59 getEntity().setUri(uri_uri
.getUri());
60 } catch (URISyntaxException e
) {
61 MessagingUtils
.messageDialog("Not a URI", getClass(), "You have to provide a valid URI");
63 } else if (eventSource
== uri_uriTermSource
) {
65 getEntity().setTermSourceUri(uri_uriTermSource
.getUri());
66 } catch (URISyntaxException e
) {
67 MessagingUtils
.messageDialog("Not a URI", getClass(), "You have to provide a valid URI");
73 * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement#getVocabularyMarkers()
76 public TermVocabulary
getVocabulary() {