public String getDisplayName() { return getViewName(); }
public int compare(View lhs, View rhs) { return lhs.getViewName().compareTo(rhs.getViewName()); } };
public View getView(String name) { for (View v : views) if(v.getViewName().equals(name)) return v; return null; }
public void setPrimaryView(@Nonnull View v) { this.primaryView = v.getViewName(); }
/** * Same as {@link #getUrl()} except this returns a view/{name} path * even for the default view. */ public String getViewUrl() { return (owner!=null ? owner.getUrl() : "") + "view/" + Util.rawEncode(getViewName()) + '/'; }
/** * Validation of the display name field. * * @param view the view to check the new display name of. * @param value the proposed new display name. * @return the validation result. * @since 2.37 */ @SuppressWarnings("unused") // expose utility check method to subclasses protected FormValidation checkDisplayName(@Nonnull View view, @CheckForNull String value) { if (StringUtils.isBlank(value)) { // no custom name, no need to check return FormValidation.ok(); } for (View v: view.owner.getViews()) { if (v.getViewName().equals(view.getViewName())) { continue; } if (StringUtils.equals(v.getDisplayName(), value)) { return FormValidation.warning(Messages.View_DisplayNameNotUniqueWarning(value)); } } return FormValidation.ok(); }
AllView allView = null; for (View v : views) { if (DEFAULT_VIEW_NAME.equals(v.getViewName())) { if (StringUtils.equals(v.getViewName(), primaryView)) { if (v instanceof AllView) { allView = (AllView) v;
public HttpResponse doIndex() { return new HttpRedirect("view/" + Util.rawEncode(getPrimaryView().getViewName()) + "/"); }
if(v.getViewName().equals(name)) return v;
group = (ViewGroup) view; } else if (tok.hasMoreTokens()) { throw new IllegalStateException(view.getViewName() + " view can not contain views");
throw new IllegalStateException(String.format("%s does not allow to delete '%s' view", group.getDisplayName(), view.getViewName()));
@Override protected int run() throws Exception { final Jenkins jenkins = Jenkins.getActiveInstance(); jenkins.checkPermission(View.CREATE); View newView; try { newView = View.createViewFromXML(viewName, stdin); } catch (Failure ex) { throw new IllegalArgumentException("Invalid view name: " + ex.getMessage()); } final String newName = newView.getViewName(); if (jenkins.getView(newName) != null) { throw new IllegalStateException("View '" + newName + "' already exists"); } jenkins.addView(newView); return 0; } }
return base + shortUrl; } else { LOGGER.log(Level.FINER, "irrelevant {0} for {1} from {2}", new Object[] {view.getViewName(), this, uri});
setViewOwner(v); views.add(0,v); primaryView = v.getViewName();
public int compare(View lhs, View rhs) { return lhs.getViewName().compareTo(rhs.getViewName()); } };
public View getView(String name) { for (View v : views) if(v.getViewName().equals(name)) return v; return null; }
public View getView(String name) { for (View v : views) if(v.getViewName().equals(name)) return v; return null; }
public View getView(String name) { for (View v : views) if(v.getViewName().equals(name)) return v; return null; }
/** * Same as {@link #getUrl()} except this returns a view/{name} path * even for the default view. */ public String getViewUrl() { return (owner!=null ? owner.getUrl() : "") + "view/" + Util.rawEncode(getViewName()) + '/'; }
/** * Same as {@link #getUrl()} except this returns a view/{name} path * even for the default view. */ public String getViewUrl() { return (owner!=null ? owner.getUrl() : "") + "view/" + Util.rawEncode(getViewName()) + '/'; }