Merge develop into branch
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / element / UriWithLabelElement.java
index 915e342f2ea4ad3a8edcff75d716b129c727c0d4..e7c1e2e7bcf37ee9deae59855b122b143ef26f6e 100644 (file)
@@ -15,6 +15,7 @@ import java.net.URI;
 
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -26,6 +27,7 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
+import eu.etaxonomy.taxeditor.Messages;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
@@ -100,12 +102,14 @@ public class UriWithLabelElement extends TextWithLabelElement {
 
        public URI getUri(){
         try {
-            labelException.setBackground(getPersistentBackground());
-            labelException.setText("");
+            labelException.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT));
+            labelException.setForeground(getPersistentBackground());
+            labelException.setText(""); //$NON-NLS-1$
             return new URI(super.getText());
         } catch (Exception e) {
-            labelException.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
-            labelException.setText(e.getMessage());
+            labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
+            labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+            labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED+e.getMessage());
             return null;
         }
        }