diff options
Diffstat (limited to 'build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StatusTool.java')
-rw-r--r-- | build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StatusTool.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StatusTool.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StatusTool.java index 27be912cbfd..677448a8b38 100644 --- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StatusTool.java +++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StatusTool.java @@ -22,23 +22,25 @@ public class StatusTool { * Applies the status to the status line of a dialog page */ public static void applyToStatusLine(MessageLine messageLine, IStatus status) { - String[] messages= getErrorMessages(status); + String[] messages = getErrorMessages(status); messageLine.setErrorMessage(messages[0]); messageLine.setMessage(messages[1]); } + /** * Applies the status to the status line of a dialog page */ public static void applyToStatusLine(DialogPage page, IStatus status) { - String[] messages= getErrorMessages(status); + String[] messages = getErrorMessages(status); page.setErrorMessage(messages[0]); page.setMessage(messages[1]); } + /** * Returns error-message / warning-message for a status */ public static String[] getErrorMessages(IStatus status) { - String message= status.getMessage(); + String message = status.getMessage(); if (status.matches(IStatus.ERROR) && !"".equals(message)) { //$NON-NLS-1$ return new String[] { message, null }; } else if (status.matches(IStatus.WARNING | IStatus.INFO)) { @@ -47,6 +49,7 @@ public class StatusTool { return new String[] { null, null }; } } + /** * Compare two IStatus. The more severe is returned: * An error is more severe than a warning, and a warning is more severe @@ -58,20 +61,21 @@ public class StatusTool { } return s2; } + /** * Finds the most severe status from a array of status * An error is more severe than a warning, and a warning is more severe * than ok. */ public static IStatus getMostSevere(IStatus[] status) { - IStatus max= null; - for (int i= 0; i < status.length; i++) { - IStatus curr= status[i]; + IStatus max = null; + for (int i = 0; i < status.length; i++) { + IStatus curr = status[i]; if (curr.matches(IStatus.ERROR)) { return curr; } if (max == null || curr.getSeverity() > max.getSeverity()) { - max= curr; + max = curr; } } return max; |