fixes #993
authorn.hoffmann <n.hoffmann@localhost>
Wed, 9 Sep 2009 08:55:32 +0000 (08:55 +0000)
committern.hoffmann <n.hoffmann@localhost>
Wed, 9 Sep 2009 08:55:32 +0000 (08:55 +0000)
taxeditor-application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchWindowAdvisor.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationUtil.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/dialogs/LoginDialog.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java

index 30090682004f665a83992a79b20debfc65cca79d..39de0ce1f9e362d7f5db3d519b1ba9ed2ccc904a 100644 (file)
@@ -35,7 +35,6 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
                configurer.setShowPerspectiveBar(true);
                configurer.setTitle("EDIT Taxonomic Editor");
                configurer.setShowProgressIndicator(true);
-               
        }
        
        public void postWindowOpen() { 
index cdf7d80da252bf793cb4f91dd0192d7fc035317a..70b2c62e2f9107c146ad962daab9232efdbfeb2e 100644 (file)
@@ -180,7 +180,7 @@ public class NavigationUtil extends AbstractUtility{
                        handleOpeningOfMultipleTaxonNodes(taxonNodes);
                        
                }else{
-                       warningDialog("You chose to open a name that has no connection to a taxa. The Editor does not support editing of such a content type at the moment.");
+                       warningDialog("Not implemented yet", "You chose to open a name that has no connection to a taxa. The Editor does not support editing of such a content type at the moment.");
                        logger.warn("Could not open editor for selection. Selection was of type: " + selection.getClass().getSimpleName());
                }
                
@@ -196,7 +196,7 @@ public class NavigationUtil extends AbstractUtility{
                        openEditor(taxonNodes.iterator().next());
                }else{
                        // FIXME implement a dialog that shows all possible taxa and let the user choose which he wants to open.
-                       warningDialog("The accepted taxon is either in multiple taxonomic views or the synonym has" +
+                       warningDialog("Not implemented yet", "The accepted taxon is either in multiple taxonomic views or the synonym has" +
                                        " more than one accepted taxon. This case is not handled yet by the software.");
                }
        }
index c7a3e041f80b41646a837d10dc7aa75b9ef72153..92e7a38d8a4ede0668c118e15bd6c468d02dc377 100644 (file)
@@ -112,13 +112,13 @@ public class LoginDialog extends Dialog {
                        CdmStore.getLoginManager().authenticate(token);                 
                }catch(BadCredentialsException e){
                        logger.error("Bad credentials", e);
-                       StoreUtil.warningDialog("Could not authenticate. Reason: Bad Credentials.");
+                       StoreUtil.warningDialog("Could not authenticate", "Could not authenticate. Reason: Bad Credentials.");
                }catch(LockedException e){
                        logger.error("Account is locked", e);
-                       StoreUtil.warningDialog("Could not authenticate. Reason: Account is locked.");
+                       StoreUtil.warningDialog("Could not authenticate", "Could not authenticate. Reason: Account is locked.");
                }catch(IllegalArgumentException e){
                        logger.error("Null argument for either user or password", e);
-                       StoreUtil.warningDialog("Could not authenticate. Reason: Username and/or Password empty.");
+                       StoreUtil.warningDialog("Could not authenticate", "Could not authenticate. Reason: Username and/or Password empty.");
                }
                
                super.okPressed();
index e1757216ef2b213c8aac9ff87aa0a6042ea58a4d..94e4ca2d0821d3fc14072a296191cd913ace635a 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.resource.ColorRegistry;
 import org.eclipse.jface.resource.FontRegistry;
 import org.eclipse.swt.SWT;
@@ -87,13 +88,11 @@ public abstract class AbstractUtility {
         * This method is for developer convenience.
         */
        public static void notImplementedMessage(){
-               warningDialog("Not yet implemented");
+               warningDialog("Not yet implemented", "This functionality is not yet implemented.");
        }
        
-       public static void warningDialog(String warning){
-               MessageBox messageBox = new MessageBox(getShell(), SWT.ICON_WARNING | SWT.OK);
-               messageBox.setText(warning);
-               messageBox.open();
+       public static void warningDialog(String title, String message){
+               MessageDialog.openWarning(getShell(), title, message);
        }
        
        public static IStatus executeOperation(IUndoableOperation operation){