ref #10186 remove ConversationHolder from many forms and some more cleanup (cont.)
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / element / LsidWithExceptionLabelElement.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.taxeditor.ui.element;
11
12 import eu.etaxonomy.cdm.model.common.LSID;
13 import eu.etaxonomy.taxeditor.l10n.Messages;
14
15 /**
16 *
17 * @author pplitzner
18 * @date Sep 21, 2015
19 *
20 */
21 public class LsidWithExceptionLabelElement extends AbstractUriWithExceptionLabelElement<LSID> {
22
23 protected LsidWithExceptionLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement,
24 String labelString, LSID initialObject, Integer textHeight, int style) {
25 super(formFactory, parentElement, labelString, initialObject, textHeight, style);
26 exceptionString = Messages.LsidWithLabelElement_URL_NOT_SAVED;
27 }
28
29 /**
30 * {@inheritDoc}
31 */
32 @Override
33 public void setParsedText(LSID object) {
34 if(object != null){
35 super.setText(object.toString());
36 }
37 }
38
39 /**
40 * {@inheritDoc}
41 */
42 @Override
43 public LSID getParsedText() throws Exception {
44 String uriText = super.getText();
45 if(uriText!=null){
46 return new LSID(uriText);
47 }
48 return null;
49 }
50
51 }