Class ExperimentalLayout

java.lang.Object
io.jenkins.plugins.interactiveinput.ui.ExperimentalLayout

public final class ExperimentalLayout extends Object
Detects whether the current viewer has opted into Jenkins' experimental "new build/job page" layouts, so the plugin can render its per-build/per-job content as native cards there instead of inside core's hardcoded "Legacy" card (see jenkins/run/OverviewTab/index.jelly and jenkins/job/OverviewTab/index.jelly).

The concrete flag classes (NewBuildPageUserExperimentalFlag, NewJobPageUserExperimentalFlag) are @Restricted(NoExternalUse), so we must not compile against them (the access-modifier enforcer would fail the build). Instead we resolve the flag exactly like core's own <l:userExperimentalFlag> tag does: by passing the flag's fully-qualified class name (a plain String) to the public, non-restricted static UserExperimentalFlag.getFlagValueForCurrentUser(String), which loads the class reflectively.

Every read fails safe to false (classic layout) so a missing flag, a non-request thread, or a future core change can never break rendering.

  • Method Details

    • newBuildPage

      public static boolean newBuildPage()
      Returns:
      true when the current viewer has the experimental "new build page" enabled.
    • newJobPage

      public static boolean newJobPage()
      Returns:
      true when the current viewer has the experimental "new job page" enabled.