From ad87c2e64653fec5138eb80419d02486a0dcc72b Mon Sep 17 00:00:00 2001 From: mindless Date: Sat, 5 Jun 2010 16:47:05 +0000 Subject: [PATCH] [FIXED HUDSON-6701] make getView fallback to subview of primary view, if that view is a ViewGroup.. this allows a Nested View to be used as the default/primary view. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@31776 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Hudson.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index 12e395798a..591c49f4cc 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -1249,6 +1249,10 @@ public final class Hudson extends Node implements ItemGroup, Stapl if(v.getViewName().equals(name)) return v; } + // Fallback to subview of primary view if it is a ViewGroup + View pv = getPrimaryView(); + if (pv instanceof ViewGroup) + return ((ViewGroup)pv).getView(name); return null; }