Change color when error occurs
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 20 Jul 2015 16:34:06 +0000 (18:34 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 21 Jul 2015 09:12:55 +0000 (11:12 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java

index ee6867db2b3a57827f7e4f552affc3713903b1bc..e7ef5ec0b227a867e3d6522b53d4c36cf154acef 100644 (file)
@@ -13,6 +13,7 @@ package eu.etaxonomy.taxeditor.ui.element;
 import java.net.URI;
 
 import org.eclipse.swt.SWT;
 import java.net.URI;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 
 /**
 import org.eclipse.swt.widgets.Label;
 
 /**
@@ -43,9 +44,11 @@ public class UriWithLabelElement extends TextWithLabelElement {
 
        public URI getUri(){
         try {
 
        public URI getUri(){
         try {
+            labelException.setBackground(getPersistentBackground());
             labelException.setText("");
             return new URI(super.getText());
         } catch (Exception e) {
             labelException.setText("");
             return new URI(super.getText());
         } catch (Exception e) {
+            labelException.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
             labelException.setText(e.getMessage());
             return null;
         }
             labelException.setText(e.getMessage());
             return null;
         }