@Override public boolean isApplicableIn(ViewGroup owner) { for (View v : owner.getViews()) { if (v instanceof AllView) { return false; } } return true; }
private void locationChanged(ViewGroup vg, String oldFullName, String newFullName) { for (View v : vg.getViews()) { if (v instanceof ListView) { renameViewItem(oldFullName, newFullName, vg, (ListView) v); } if (v instanceof ViewGroup) { locationChanged((ViewGroup) v, oldFullName, newFullName); } } }
private void deleted(ViewGroup vg, Item item) { for (View v : vg.getViews()) { if (v instanceof ListView) { deleteViewItem(item, vg, (ListView) v); } if (v instanceof ViewGroup) { deleted((ViewGroup) v, item); } } }
/** * Gets all the items recursively contained in this collection in a read-only view. * <p> * The default implementation recursively adds the items of all contained Views * in case this view implements {@link ViewGroup}, which should be enough for most cases. * * @since 1.520 */ public Collection<TopLevelItem> getAllItems() { if (this instanceof ViewGroup) { final Collection<TopLevelItem> items = new LinkedHashSet<TopLevelItem>(getItems()); for(View view: ((ViewGroup) this).getViews()) { items.addAll(view.getAllItems()); } return Collections.unmodifiableCollection(items); } else { return getItems(); } }
/** * 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(); }
@Override public boolean isApplicableIn(ViewGroup owner) { for (View v : owner.getViews()) { if (v instanceof AllView) { return false; } } return true; }
@Override public boolean isInstantiable() { for (View v : Stapler.getCurrentRequest().findAncestorObject(ViewGroup.class).getViews()) if(v instanceof AllView) return false; return true; }
@Override public boolean isInstantiable() { for (View v : Stapler.getCurrentRequest().findAncestorObject(ViewGroup.class).getViews()) if(v instanceof AllView) return false; return true; }
@Override public boolean isInstantiable() { for (View v : Stapler.getCurrentRequest().findAncestorObject(ViewGroup.class).getViews()) { if (v instanceof AllView) { return false; } } return true; }
@Override public boolean isInstantiable() { for (View v : Stapler.getCurrentRequest().findAncestorObject(ViewGroup.class).getViews()) if(v instanceof AllView) return false; return true; }
/** * Gets all the items recursively contained in this collection in a read-only view. * <p> * The default implementation recursively adds the items of all contained Views * in case this view implements {@link ViewGroup}, which should be enough for most cases. * * @since 1.520 */ public Collection<TopLevelItem> getAllItems() { if (this instanceof ViewGroup) { final Collection<TopLevelItem> items = new LinkedHashSet<TopLevelItem>(getItems()); for(View view: ((ViewGroup) this).getViews()) { items.addAll(view.getAllItems()); } return Collections.unmodifiableCollection(items); } else { return getItems(); } }
/** * 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(); }
private void locationChanged(Item item, String oldFullName, String newFullName) { final Jenkins jenkins = Jenkins.getInstance(); for (View view: jenkins.getViews()) { if (view instanceof ListView) { renameViewItem(oldFullName, newFullName, jenkins, (ListView) view); } } for (Item g : jenkins.allItems()) { if (g instanceof ViewGroup) { ViewGroup vg = (ViewGroup) g; for (View v : vg.getViews()) { if (v instanceof ListView) { renameViewItem(oldFullName, newFullName, vg, (ListView) v); } } } } }
private void deleted(Item item) { final Jenkins jenkins = Jenkins.getInstance(); for (View view: jenkins.getViews()) { if (view instanceof ListView) { deleteViewItem(item, jenkins, (ListView) view); } } for (Item g : jenkins.allItems()) { if (g instanceof ViewGroup) { ViewGroup vg = (ViewGroup) g; for (View v : vg.getViews()) { if (v instanceof ListView) { deleteViewItem(item, vg, (ListView) v); } } } } }