Class PanelCheckResultHelper

java.lang.Object
overit.geocallapp.wfm.core.ux.common.check.PanelCheckResultHelper

public class PanelCheckResultHelper extends Object
  • Field Details

  • Constructor Details

    • PanelCheckResultHelper

      public PanelCheckResultHelper()
  • Method Details

    • makeHelper

      public static PanelCheckResultHelper makeHelper(PanelCheckResult panelCheckResult)
    • showPanelIfNeeded

      public <I, O> boolean showPanelIfNeeded(CheckableEvent<I,O> checkableEvent, O output)
    • showPanelIfNeeded

      public <I, O> boolean showPanelIfNeeded(CheckableEvent<I,O> checkableEvent, O output, Consumer<UIMessage> confirmConsumer)
    • showPanelIfNeeded

      public boolean showPanelIfNeeded(CheckResult checkResult)
    • showPanelIfNeeded

      public boolean showPanelIfNeeded(CheckResult checkResult, Consumer<UIMessage> confirmConsumer)
    • getCheckResultFromPanel

      public CheckResult getCheckResultFromPanel()
    • getEventInputFromPanel

      public <I> I getEventInputFromPanel()
    • showPanelWithErrorsPrioritized

      public <I, O> boolean showPanelWithErrorsPrioritized(CheckableEvent<I,O> checkableEvent, O output)
      Shows the panel with errors prioritized over warnings.

      This method filters the check result to display only error issues if any errors are present. If no errors exist, all issues (including warnings) are displayed. This ensures that critical errors are always shown first without being obscured by warnings.

      Type Parameters:
      I - the type of the event input
      O - the type of the event output
      Parameters:
      checkableEvent - the CheckableEvent containing the check result
      output - the event output
      Returns:
      true if the panel was shown, false otherwise
    • showPanelWithErrorsPrioritized

      public <I, O> boolean showPanelWithErrorsPrioritized(CheckableEvent<I,O> checkableEvent, O output, Consumer<UIMessage> confirmConsumer)
      Shows the panel with errors prioritized over warnings, with a custom confirm consumer.

      This method filters the check result to display only error issues if any errors are present. If no errors exist, all issues (including warnings) are displayed. This ensures that critical errors are always shown first without being obscured by warnings.

      Type Parameters:
      I - the type of the event input
      O - the type of the event output
      Parameters:
      checkableEvent - the CheckableEvent containing the check result
      output - the event output
      confirmConsumer - the consumer to be called when the user confirms (can be null)
      Returns:
      true if the panel was shown, false otherwise
    • showPanelWithErrorsPrioritized

      public boolean showPanelWithErrorsPrioritized(CheckResult checkResult)
      Shows the panel with errors prioritized over warnings.

      This method filters the check result to display only error issues if any errors are present. If no errors exist, all issues (including warnings) are displayed. This ensures that critical errors are always shown first without being obscured by warnings.

      Parameters:
      checkResult - the CheckResult to display
      Returns:
      true if the panel was shown, false otherwise
    • showPanelWithErrorsPrioritized

      public boolean showPanelWithErrorsPrioritized(CheckResult checkResult, Consumer<UIMessage> confirmConsumer)
      Shows the panel with errors prioritized over warnings, with a custom confirm consumer.

      This method filters the check result to display only error issues if any errors are present. If no errors exist, all issues (including warnings) are displayed. This ensures that critical errors are always shown first without being obscured by warnings.

      Parameters:
      checkResult - the CheckResult to display
      confirmConsumer - the consumer to be called when the user confirms (can be null)
      Returns:
      true if the panel was shown, false otherwise
    • filterCheckResultForErrorsPrioritized

      protected CheckResult filterCheckResultForErrorsPrioritized(CheckResult checkResult)
      Filters the check result to prioritize errors over warnings.

      If the check result contains error issues, all warning issues are removed. If no errors are present, the check result is returned as-is.

      Parameters:
      checkResult - the CheckResult to filter
      Returns:
      a new CheckResult with only errors if errors exist, otherwise the original check result