Warn user that URL will not be saved in bold and red (#5065, #5141)
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 24 Aug 2015 09:11:08 +0000 (11:11 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 24 Aug 2015 09:11:08 +0000 (11:11 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java

index ee6867db2b3a57827f7e4f552affc3713903b1bc..02b61f5412b4e93561abcf8f35b0add06243798e 100644 (file)
@@ -12,7 +12,9 @@ package eu.etaxonomy.taxeditor.ui.element;
 
 import java.net.URI;
 
 
 import java.net.URI;
 
+import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 
 /**
 import org.eclipse.swt.widgets.Label;
 
 /**
@@ -43,10 +45,14 @@ public class UriWithLabelElement extends TextWithLabelElement {
 
        public URI getUri(){
         try {
 
        public URI getUri(){
         try {
+            labelException.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT));
+            labelException.setForeground(getPersistentBackground());
             labelException.setText("");
             return new URI(super.getText());
         } catch (Exception e) {
             labelException.setText("");
             return new URI(super.getText());
         } catch (Exception e) {
-            labelException.setText(e.getMessage());
+            labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
+            labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+            labelException.setText("URL won't be saved! "+e.getMessage());
             return null;
         }
        }
             return null;
         }
        }