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
.Display
;
17 import org
.eclipse
.swt
.widgets
.Label
;
21 * @created Dec 20, 2010
24 public class UriWithLabelElement
extends TextWithLabelElement
{
26 private final Label labelException
;
28 protected UriWithLabelElement(CdmFormFactory formFactory
,
29 ICdmFormElement parentElement
, String labelString
,
30 URI initialUri
, Integer textHeight
, int style
) {
31 super(formFactory
, parentElement
, labelString
, null, textHeight
, style
);
33 labelException
= formFactory
.createLabel(getLayoutComposite(), "", SWT
.WRAP
);
34 labelException
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2, 1));
35 addControl(labelException
);
39 public void setUri(URI uri
) {
41 super.setText(uri
.toString());
47 labelException
.setBackground(getPersistentBackground());
48 labelException
.setText("");
49 return new URI(super.getText());
50 } catch (Exception e
) {
51 labelException
.setBackground(Display
.getCurrent().getSystemColor(SWT
.COLOR_RED
));
52 labelException
.setText(e
.getMessage());