3 * Copyright (C) 2007 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.
11 package eu
.etaxonomy
.taxeditor
.ui
.element
;
15 import org
.eclipse
.swt
.SWT
;
16 import org
.eclipse
.swt
.widgets
.Label
;
20 * @created Dec 20, 2010
23 public class UriWithLabelElement
extends TextWithLabelElement
{
25 private final Label labelException
;
27 protected UriWithLabelElement(CdmFormFactory formFactory
,
28 ICdmFormElement parentElement
, String labelString
,
29 URI initialUri
, Integer textHeight
, int style
) {
30 super(formFactory
, parentElement
, labelString
, null, textHeight
, style
);
32 labelException
= formFactory
.createLabel(getLayoutComposite(), "", SWT
.WRAP
);
33 labelException
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2, 1));
34 addControl(labelException
);
38 public void setUri(URI uri
) {
40 super.setText(uri
.toString());
46 labelException
.setText("");
47 return new URI(super.getText());
48 } catch (Exception e
) {
49 labelException
.setText(e
.getMessage());