public Tag processWidget( Tag tag, String elementName, Map<String, String> attributes, MetawidgetTag metawidget ) { if ( tag instanceof BaseHandlerTag ) { BaseHandlerTag tagBaseHandler = (BaseHandlerTag) tag; BaseHtmlMetawidgetTag htmlMetawidgetTag = (BaseHtmlMetawidgetTag) metawidget; tagBaseHandler.setStyle( htmlMetawidgetTag.getStyle() ); tagBaseHandler.setStyleClass( htmlMetawidgetTag.getStyleClass() ); } return tag; } }
/** * Prepares the style attributes for inclusion in the component's HTML tag. * @return The prepared String for inclusion in the HTML tag. * @exception JspException if invalid attributes are specified */ protected String prepareStyles() throws JspException { StringBuffer styles = new StringBuffer(); boolean errorsExist = doErrorsExist(); if (errorsExist && getErrorStyleId() != null) { prepareAttribute(styles , "id", getErrorStyleId()); } else { prepareAttribute(styles , "id", getStyleId()); } if (errorsExist && getErrorStyle() != null) { prepareAttribute(styles , "style", getErrorStyle()); } else { prepareAttribute(styles , "style", getStyle()); } if (errorsExist && getErrorStyleClass() != null) { prepareAttribute(styles , "class", getErrorStyleClass()); } else { prepareAttribute(styles , "class", getStyleClass()); } prepareAttribute(styles , "title", message(getTitle(), getTitleKey())); prepareAttribute(styles , "alt", message(getAlt(), getAltKey())); return styles.toString(); }
/** * Create an appropriate select start element based on our parameters. * @throws JspException * @since Struts 1.1 */ protected String renderSelectStartElement() throws JspException { StringBuffer results = new StringBuffer("<select"); prepareAttribute(results, "name", prepareName()); prepareAttribute(results, "accesskey", getAccesskey()); if (multiple != null) { results.append(" multiple=\"multiple\""); } prepareAttribute(results, "size", getSize()); prepareAttribute(results, "tabindex", getTabindex()); results.append(prepareEventHandlers()); results.append(prepareStyles()); prepareOtherAttributes(results); results.append(">"); return results.toString(); }
/** * Render the button attributes * @param results The StringBuffer that output will be appended to. */ protected void prepareButtonAttributes(StringBuffer results) throws JspException { prepareAttribute(results, "accesskey", getAccesskey()); prepareAttribute(results, "tabindex", getTabindex()); prepareValue(results); }
setAccesskey(string); setAlt(string); setAltKey(string); setBundle(string); setDisabled(bool.booleanValue()); setOnblur(string); setOnchange(string); setOnclick(string); setOndblclick(string); setOnfocus(string); setOnkeydown(string); setOnkeypress(string); setOnkeyup(string); setOnmousedown(string); setOnmousemove(string);
setAlt(string); setAltKey(string); setBundle(string); setLocale(string); setOnclick(string); setOndblclick(string); setOnkeydown(string); setOnkeypress(string); setOnkeyup(string); setOnmousedown(string); setOnmousemove(string); setOnmouseout(string); setOnmouseover(string); setOnmouseup(string); setStyle(string);
/** * Render the appropriately encoded URI. * * @exception JspException if a JSP exception has occurred */ public int doStartTag() throws JspException { // Print this element to our output writer StringBuffer results = new StringBuffer("<frame"); prepareAttribute(results, "src", calculateURL()); prepareAttribute(results, "name", getFrameName()); if (noresize) { results.append(" noresize=\"noresize\""); } prepareAttribute(results, "scrolling", getScrolling()); prepareAttribute(results, "marginheight", getMarginheight()); prepareAttribute(results, "marginwidth", getMarginwidth()); prepareAttribute(results, "frameborder", getFrameborder()); prepareAttribute(results, "longdesc", getLongdesc()); results.append(prepareStyles()); prepareOtherAttributes(results); results.append(getElementClose()); TagUtils.getInstance().write(pageContext,results.toString()); return (SKIP_BODY); }
setBundle(string); setStyle(string); setStyleClass(string); setStyleId(string); setTitle(string); setTitleKey(string);
/** * Prepares the focus event handlers, appending them to the the given * StringBuffer. * @param handlers The StringBuffer that output will be appended to. */ protected void prepareFocusEvents(StringBuffer handlers) { prepareAttribute(handlers, "onblur", getOnblur()); prepareAttribute(handlers, "onfocus", getOnfocus()); // Get the parent FormTag (if necessary) FormTag formTag = null; if ((doDisabled && !getDisabled()) || (doReadonly && !getReadonly())) { formTag = (FormTag)pageContext.getAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE); } // Format Disabled if (doDisabled) { boolean formDisabled = formTag == null ? false : formTag.isDisabled(); if (formDisabled || getDisabled()) { handlers.append(" disabled=\"disabled\""); } } // Format Read Only if (doReadonly) { boolean formReadOnly = formTag == null ? false : formTag.isReadonly(); if (formReadOnly || getReadonly()) { handlers.append(" readonly=\"readonly\""); } } }
/** * Determine if there are errors for the component. * @return Whether errors exist. */ protected boolean doErrorsExist() throws JspException { boolean errorsExist = false; if (getErrorStyleId() != null || getErrorStyle() != null || getErrorStyleClass() != null) { String actualName = prepareName(); if (actualName != null) { ActionMessages errors = TagUtils.getInstance() .getActionMessages(pageContext, errorKey); errorsExist = (errors != null && errors.size(actualName) > 0); } } return errorsExist; }
setAccesskey(string); setAlt(string); setAltKey(string); setBundle(string); setDisabled(bool.booleanValue()); setIndexed(bool.booleanValue()); setOnblur(string); setOnchange(string); setOnclick(string); setOndblclick(string); setOnfocus(string); setOnkeydown(string); setOnkeypress(string); setOnkeyup(string); setOnmousedown(string);
/** * Process the end of this tag. * <p> * Support for Indexed property since Struts 1.1 * * @exception JspException if a JSP exception has occurred */ public int doEndTag() throws JspException { // Generate an HTML element StringBuffer results = new StringBuffer(); results.append(getElementOpen()); prepareAttribute(results, "name", prepareName()); prepareButtonAttributes(results); results.append(prepareEventHandlers()); results.append(prepareStyles()); prepareOtherAttributes(results); results.append(getElementClose()); TagUtils.getInstance().write(pageContext, results.toString()); return (EVAL_PAGE); }
/** * Render the button attributes * @param results The StringBuffer that output will be appended to. */ protected void prepareButtonAttributes(StringBuffer results) throws JspException { String tmp = src(); if (tmp != null) { HttpServletResponse response = (HttpServletResponse) pageContext.getResponse(); prepareAttribute(results, "src", response.encodeURL(tmp)); } prepareAttribute(results, "align", getAlign()); prepareAttribute(results, "border", getBorder()); prepareAttribute(results, "value", getValue()); prepareAttribute(results, "accesskey", getAccesskey()); prepareAttribute(results, "tabindex", getTabindex()); }
setAccesskey(string); setAlt(string); setAltKey(string); setBundle(string); setDisabled(bool.booleanValue()); setIndexed(bool.booleanValue()); setOnblur(string); setOnchange(string); setOnclick(string); setOndblclick(string); setOnfocus(string); setOnkeydown(string); setOnkeypress(string); setOnkeyup(string); setOnmousedown(string);
/** * Renders a fully formed <input> element. * @throws JspException * @since Struts 1.2 */ protected String renderInputElement() throws JspException { StringBuffer results = new StringBuffer("<input"); prepareAttribute(results, "type", this.type); prepareAttribute(results, "name", prepareName()); prepareAttribute(results, "accesskey", getAccesskey()); prepareAttribute(results, "accept", getAccept()); prepareAttribute(results, "maxlength", getMaxlength()); prepareAttribute(results, "size", getCols()); prepareAttribute(results, "tabindex", getTabindex()); prepareValue(results); results.append(this.prepareEventHandlers()); results.append(this.prepareStyles()); prepareOtherAttributes(results); results.append(this.getElementClose()); return results.toString(); }
String srcurl = url(tmp); if (srcurl != null) { prepareAttribute(results, "src", response.encodeURL(srcurl)); prepareAttribute(results, "lowsrcurl", response.encodeURL(lowsrcurl)); prepareAttribute(results, "name", getImageName()); prepareAttribute(results, "height", getHeight()); prepareAttribute(results, "width", getWidth()); prepareAttribute(results, "align", getAlign()); prepareAttribute(results, "border", getBorder()); prepareAttribute(results, "hspace", getHspace()); prepareAttribute(results, "vspace", getVspace()); prepareAttribute(results, "ismap", getIsmap()); prepareAttribute(results, "usemap", getUsemap()); results.append(prepareStyles()); results.append(prepareEventHandlers()); prepareOtherAttributes(results); results.append(getElementClose());
setAccesskey(string); setAlt(string); setAltKey(string); setBundle(string); setDisabled(bool.booleanValue()); setOnblur(string); setOnchange(string); setOnclick(string); setOndblclick(string); setOnfocus(string); setOnkeydown(string); setOnkeypress(string); setOnkeyup(string); setOnmousedown(string); setOnmousemove(string);