Merge branch 'develop' into taxonDescription
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / model / MessagingUtils.java
index 7133c7271302a3e0181197a80dda3b71cc447d53..c8f1e26a37281f8c3c2262e62c95ff9d43b648d5 100644 (file)
@@ -194,6 +194,9 @@ public class MessagingUtils {
                 server = activeCdmSource.getServer();
                 if(activeCdmSource instanceof CdmRemoteSource){
                     contextPath = ((CdmRemoteSource) activeCdmSource).getContextPath();
+                    if (contextPath != null && contextPath.startsWith("cdmserver/")){
+                       contextPath = contextPath.substring("cdmserver/".length());
+                    }
                 }
             }
 
@@ -202,7 +205,7 @@ public class MessagingUtils {
         }
         contextInfo.add("login : " + login);
         contextInfo.add("editor version : " + version);
-        contextInfo.add("server : " + server + " / " + name + (CdmUtils.isNotBlank(contextPath)?" / "+contextPath:""));
+        contextInfo.add("server : " + server + " (" + name + ")" + (CdmUtils.isNotBlank(contextPath)?" / "+contextPath:""));
         contextInfo.add("schema version : " + schemaVersion);
         contextInfo.add("os : " + System.getProperty("os.name")+" "+System.getProperty("os.version")+" "+System.getProperty("os.arch"));
         contextInfo.add("java : "+System.getProperty("java.version"));
@@ -421,7 +424,7 @@ public class MessagingUtils {
                     warningDialog(title, source, String.format("You are missing sufficient permissions for the operation \"%s\". %s", operationlabel, hint));
                 } else {
                     title = "Error executing operation";
-                    errorDialog(title, source, String.format("An error occured while executing %s. %s", operationlabel, hint), pluginId, ex, true);
+                    errorDialog(title, source, String.format("An error occurred while executing %s. %s", operationlabel, hint), pluginId, ex, true);
 
                 }
 
@@ -446,6 +449,12 @@ public class MessagingUtils {
         return MessageDialog.openQuestion(AbstractUtility.getShell(), title, message);
     }
 
+    public static int confirmDialog(String title, String message, String...labels){
+        MessageDialog dialog =new MessageDialog(AbstractUtility.getShell(), title, null, message, MessageDialog.QUESTION,labels, 0);
+        int result = dialog.open();
+        return result;
+    }
+
     /**
      * Displays a message {@link org.eclipse.jface.dialogs.MessageDialog}.
      *