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
.store
.StoreUtil
;
16 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.UriWithLabelElement
;
25 public class TermVocabularyDetailElement
extends AbstractTermBaseDetailElement
<TermVocabulary
> {
27 private UriWithLabelElement uri_uriTermSource
;
32 public TermVocabularyDetailElement(CdmFormFactory formFactory
,
33 ICdmFormElement formElement
) {
34 super(formFactory
, formElement
);
38 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
41 protected void createControls(ICdmFormElement formElement
,
42 TermVocabulary entity
, int style
) {
44 super.createControls(formElement
, entity
, style
);
45 uri_uriTermSource
= formFactory
.createUriWithLabelElement(formElement
, "Term Source URI", getEntity().getTermSourceUri(), style
);
49 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
52 public void handleEvent(Object eventSource
) {
54 handleRepresentation(eventSource
);
56 if (eventSource
== uri_uri
) {
58 getEntity().setUri(uri_uri
.getUri());
59 } catch (URISyntaxException e
) {
60 StoreUtil
.errorDialog("Not a URI", getClass(), "You have to provide a valid URI");
62 } else if (eventSource
== uri_uriTermSource
) {
64 getEntity().setTermSourceUri(uri_uriTermSource
.getUri());
65 } catch (URISyntaxException e
) {
66 StoreUtil
.errorDialog("Not a URI", getClass(), "You have to provide a valid URI");
72 * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement#getVocabularyMarkers()
75 public TermVocabulary
getVocabulary() {