/** * Retrieves the {@link Shell} that was stored into the request * cycle. This allows components wrapped by the {@link Shell} to * locate it and access the services it provides. * * @since 4.1.1 */ public static Shell get(IRequestCycle cycle) { return (Shell) cycle.getAttribute(SHELL_ATTRIBUTE); }
/** * Retrieves the {@link Shell} that was stored into the request * cycle. This allows components wrapped by the {@link Shell} to * locate it and access the services it provides. * * @since 4.1.1 */ public static Shell get(IRequestCycle cycle) { return (Shell) cycle.getAttribute(SHELL_ATTRIBUTE); }
/** * Returns the {@link PageRenderSupport} object if previously stored, or null otherwise. * This is used in the rare case that a component wishes to adjust its behavior based on whether * the page render support services are available (typically, adjust for whether enclosed by a * Body component, or not). */ public static PageRenderSupport getOptionalPageRenderSupport(IRequestCycle cycle) { return (PageRenderSupport) cycle.getAttribute(PAGE_RENDER_SUPPORT_ATTRIBUTE); }
/** * Returns the {@link PageRenderSupport} object if previously stored, or null otherwise. * This is used in the rare case that a component wishes to adjust its behavior based on whether * the page render support services are available (typically, adjust for whether enclosed by a * Body component, or not). */ public static PageRenderSupport getOptionalPageRenderSupport(IRequestCycle cycle) { return (PageRenderSupport) cycle.getAttribute(PAGE_RENDER_SUPPORT_ATTRIBUTE); }
private Stack getCycleStack(IRequestCycle cycle) { Stack currStack = (Stack) cycle.getAttribute(TreeHelper.class.getName()); if (currStack == null) { currStack = new Stack(); } return currStack; }
public ITreeModelSource getTreeModelSource() { ITreeModelSource objSource = (ITreeModelSource) getPage() .getRequestCycle().getAttribute( ITreeModelSource.TREE_MODEL_SOURCE_ATTRIBUTE); return objSource; }
public ITreeRowSource getTreeRowSource() { ITreeRowSource objSource = (ITreeRowSource) getPage().getRequestCycle() .getAttribute(ITreeRowSource.TREE_ROW_SOURCE_ATTRIBUTE); return objSource; }
void mapFormNames(IRequestCycle cycle, IForm form) { List names = (List)cycle.getAttribute(FORM_NAME_LIST + form.getExtendedId()); if (names == null) { names = new ArrayList(); cycle.setAttribute(FORM_NAME_LIST + form.getExtendedId(), names); } names.add(form.getName()); }
void mapFormNames(IRequestCycle cycle, IForm form) { List names = (List)cycle.getAttribute(FORM_NAME_LIST + form.getExtendedId()); if (names == null) { names = new ArrayList(); cycle.setAttribute(FORM_NAME_LIST + form.getExtendedId(), names); } names.add(form.getName()); }
public ITreeModelSource getTreeModelSource() { ITreeModelSource objSource = (ITreeModelSource) getPage() .getRequestCycle().getAttribute( ITreeModelSource.TREE_MODEL_SOURCE_ATTRIBUTE); return objSource == null ? getTreeViewParameter() : objSource; }
public void write(StringBuffer buffer, ScriptSession session) { IRequestCycle cycle = session.getRequestCycle(); Location location = getLocation(); String tag = "<unique> " + location.toString(); if (cycle.getAttribute(tag) != null) return; cycle.setAttribute(tag, Boolean.TRUE); writeChildren(buffer, session); }
public boolean getShowNormalPages() { if (getVolatile()) return true; IForm form = (IForm) getPage().getRequestCycle().getAttribute( TapestryUtils.FORM_ATTRIBUTE); return (form == null); }
public void write(StringBuffer buffer, ScriptSession session) { IRequestCycle cycle = session.getRequestCycle(); Location location = getLocation(); String tag = "<unique> " + location.toString(); if (cycle.getAttribute(tag) != null) return; cycle.setAttribute(tag, Boolean.TRUE); writeChildren(buffer, session); }
/** * @see org.apache.tapestry.AbstractComponent#prepareForRender(org.apache.tapestry.IRequestCycle) */ protected void prepareForRender(IRequestCycle cycle) { super.prepareForRender(cycle); if (cycle.getAttribute(ATTRIBUTE_NAME) != null) throw new ApplicationRuntimeException(Tapestry.getMessage("Select.may-not-nest"), this, null, null); cycle.setAttribute(ATTRIBUTE_NAME, this); _rendering = true; _nextOptionId = 0; }
/** * @see org.apache.tapestry.AbstractComponent#prepareForRender(org.apache.tapestry.IRequestCycle) */ protected void prepareForRender(IRequestCycle cycle) { super.prepareForRender(cycle); if (cycle.getAttribute(ATTRIBUTE_NAME) != null) throw new ApplicationRuntimeException(Tapestry.getMessage("Select.may-not-nest"), this, null, null); cycle.setAttribute(ATTRIBUTE_NAME, this); _rendering = true; _nextOptionId = 0; }
/** * @see org.apache.tapestry.AbstractComponent#prepareForRender(org.apache.tapestry.IRequestCycle) */ protected void prepareForRender(IRequestCycle cycle) { IComponent outer = (IComponent) cycle.getAttribute(ATTRIBUTE_NAME); if (outer != null) throw new ApplicationRuntimeException(FormMessages.linkSubmitMayNotNest(this, outer), this, getLocation(), null); cycle.setAttribute(ATTRIBUTE_NAME, this); }
/** * {@inheritDoc} */ public String peekClientId() { if (getPage() == null) return null; IForm form = (IForm) getPage().getRequestCycle().getAttribute(TapestryUtils.FORM_ATTRIBUTE); if (form == null) return null; return form.peekClientId(this); }
/** * @see org.apache.tapestry.AbstractComponent#prepareForRender(org.apache.tapestry.IRequestCycle) */ protected void prepareForRender(IRequestCycle cycle) { IComponent outer = (IComponent) cycle.getAttribute(ATTRIBUTE_NAME); if (outer != null) throw new ApplicationRuntimeException(FormMessages.linkSubmitMayNotNest(this, outer), this, getLocation(), null); cycle.setAttribute(ATTRIBUTE_NAME, this); }
/** * {@inheritDoc} */ public String peekClientId() { if (getPage() == null) return null; IForm form = (IForm) getPage().getRequestCycle().getAttribute(TapestryUtils.FORM_ATTRIBUTE); if (form == null) return null; return form.peekClientId(this); }
public CheckboxGroup getCheckboxGroup() { CheckboxGroup group = getGroup(); if (group == null) { IRequestCycle cycle = getPage().getRequestCycle(); group = (CheckboxGroup) cycle.getAttribute(CheckboxGroup.CHECKBOX_GROUP_ATTRIBUTE); } if (group == null) throw new ApplicationRuntimeException("The component " + getExtendedId() + " must be wrapped by a CheckboxGroup or the 'group' parameter must be set."); return group; }