Class StatusLimiter


  • public final class StatusLimiter
    extends Object
    Utility methods to limit import multi-status contents.
    • Method Detail

      • limitChildren

        public static org.eclipse.core.runtime.IStatus limitChildren​(org.eclipse.core.runtime.IStatus status)
        Converts provided multi status to short and simple to read result. Status children will be limited with default limits. If provided status is not multi, it will be returned without any change.

        Clients may use this method on result status from IImportService.work(org.eclipse.core.resources.IProject, java.nio.file.Path, org.eclipse.core.runtime.IProgressMonitor) before display it to user or write in UI log.

        Example of usage:

         SomePlugin.getDefault().getLog().log(StatusLimiter.limitChildren(importStatus));
         
        Parameters:
        status - the status to convert and limit children, cannot be null
        Returns:
        converted limited status, never null
      • limitChildren

        public static org.eclipse.core.runtime.IStatus limitChildren​(org.eclipse.core.runtime.IStatus status,
                                                                     int warningsLimit,
                                                                     int errorsLimit)
        Converts provided multi status to short and simple to read result. Status children will be limited with provided limits. If provided status is not multi, it will be returned without any change.

        Clients may use this method on result status from IImportService.work(org.eclipse.core.resources.IProject, java.nio.file.Path, org.eclipse.core.runtime.IProgressMonitor) before display it to user or write in UI log.

        Example of usage:

         SomePlugin.getDefault().getLog().log(StatusLimiter.limitChildren(importStatus));
         
        Parameters:
        status - the status to convert and limit children, cannot be null
        warningsLimit - the limit for warnings or -1 if warning limit is not required
        errorsLimit - the limit for errors or -1 if warning limit is not required
        Returns:
        converted limited status, never null