File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java | Tobago Deprecation | 712 |
org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java | Tobago Theme Standard | 544 |
private static String createDojoDndType(UIComponent component, String clientId, String dojoType) {
StringBuilder strBuilder = new StringBuilder();
strBuilder.append("new ").append(dojoType).append("('").append(clientId).append("'");
StringBuilder parameter = new StringBuilder();
Object objHorizontal = component.getAttributes().get("horizontal");
if (objHorizontal != null) {
parameter.append("horizontal: ").append(String.valueOf(objHorizontal)).append(",");
}
Object objCopyOnly = component.getAttributes().get("copyOnly");
if (objCopyOnly != null) {
parameter.append("copyOnly: ").append(String.valueOf(objCopyOnly)).append(",");
}
Object objSkipForm = component.getAttributes().get("skipForm");
if (objSkipForm != null) {
parameter.append("skipForm: ").append(String.valueOf(objSkipForm)).append(",");
}
Object objWithHandles = component.getAttributes().get("withHandles");
if (objWithHandles != null) {
parameter.append("withHandles: ").append(String.valueOf(objWithHandles)).append(",");
}
Object objAccept = component.getAttributes().get("accept");
if (objAccept != null) {
String accept = null;
if (objAccept instanceof String[]) {
String[] allowed = (String[]) objAccept;
if (allowed.length > 1) {
// TODO replace this
accept = "'" + allowed[0] + "'";
for (int i = 1; i < allowed.length; i++) {
accept += ",'" + allowed[i] + "'";
}
}
} else {
accept = (String) objAccept;
}
parameter.append("accept: [").append(accept).append("],");
}
Object objSingular = component.getAttributes().get("singular");
if (objSingular != null) {
parameter.append("singular: ").append(String.valueOf(objSingular)).append(",");
}
Object objCreator = component.getAttributes().get("creator");
if (objCreator != null) {
parameter.append("creator: ").append(String.valueOf(objCreator)).append(",");
}
if (parameter.length() > 0) {
parameter.deleteCharAt(parameter.lastIndexOf(","));
strBuilder.append(",{").append(parameter).append("}");
}
strBuilder.append(");");
return strBuilder.toString();
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/RenderUtil.java | Tobago Deprecation | 251 |
org/apache/myfaces/tobago/renderkit/util/RenderUtils.java | Tobago Theme Standard | 245 |
LOG.warn("No items found! rendering dummies instead!");
for (int i = 0; i < indices.length; i++) {
items.add(new SelectItem(Integer.toString(i), "Item " + i, ""));
}
}
return items;
}
public static String currentValue(UIComponent component) {
String currentValue = null;
if (component instanceof ValueHolder) {
Object value;
if (component instanceof EditableValueHolder) {
value = ((EditableValueHolder) component).getSubmittedValue();
if (value != null) {
return (String) value;
}
}
value = ((ValueHolder) component).getValue();
if (value != null) {
Converter converter = ((ValueHolder) component).getConverter();
if (converter == null) {
FacesContext context = FacesContext.getCurrentInstance();
converter = context.getApplication().createConverter(value.getClass());
}
if (converter != null) {
currentValue =
converter.getAsString(FacesContext.getCurrentInstance(),
component, value);
} else {
currentValue = value.toString();
}
}
}
return currentValue;
}
public static List<SelectItem> getSelectItems(UIComponent component) {
ArrayList<SelectItem> list = new ArrayList<SelectItem>();
for (Object o1 : component.getChildren()) {
UIComponent kid = (UIComponent) o1;
if (LOG.isDebugEnabled()) {
LOG.debug("kid " + kid);
LOG.debug("kid " + kid.getClass().getName());
}
if (kid instanceof UISelectItem) {
Object value = ((UISelectItem) kid).getValue();
if (value == null) {
UISelectItem item = (UISelectItem) kid;
if (kid instanceof org.apache.myfaces.tobago.component.UISelectItem) {
list.add(getSelectItem(
(org.apache.myfaces.tobago.component.UISelectItem) kid));
} else {
list.add(new SelectItem(item.getItemValue() == null ? "" : item.getItemValue(),
item.getItemLabel() != null ? item.getItemLabel() : item.getItemValue().toString(),
item.getItemDescription()));
}
} else if (value instanceof SelectItem) {
list.add((SelectItem) value);
} else { |
File | Project | Line |
---|
org/apache/myfaces/tobago/internal/util/HtmlWriterUtils.java | Tobago Core | 53 |
org/apache/myfaces/tobago/internal/util/JavascriptWriterUtils.java | Tobago Core | 51 |
public JsonWriterUtils(final Writer out, final String characterEncoding) {
super(out, characterEncoding);
}
@Override
protected void writeEncodedValue(final char[] text, final int start,
final int length, final boolean isAttribute) throws IOException {
int localIndex = -1;
final int end = start + length;
for (int i = start; i < end; i++) {
char ch = text[i];
if (ch >= CHARS_TO_ESCAPE.length || CHARS_TO_ESCAPE[ch] != null) {
localIndex = i;
break;
}
}
final Writer out = getOut();
if (localIndex == -1) {
// no need to escape
out.write(text, start, length);
} else {
// write until localIndex and then encode the remainder
out.write(text, start, localIndex);
final ResponseWriterBuffer buffer = getBuffer();
for (int i = localIndex; i < end; i++) {
final char ch = text[i];
// Tilde or less...
if (ch < CHARS_TO_ESCAPE.length) {
if (isAttribute && ch == '&' && (i + 1 < end) && text[i + 1] == '{') {
// HTML 4.0, section B.7.1: ampersands followed by
// an open brace don't get escaped
buffer.addToBuffer('&');
} else if (CHARS_TO_ESCAPE[ch] != null) {
buffer.addToBuffer(CHARS_TO_ESCAPE[ch]);
} else {
buffer.addToBuffer(ch);
}
} else if (isUtf8()) {
buffer.addToBuffer(ch);
} else if (ch <= 0xff) {
// ISO-8859-1 entities: encode as needed
buffer.flushBuffer();
out.write('&');
char[] chars = ISO8859_1_ENTITIES[ch - 0xA0];
out.write(chars, 0, chars.length);
out.write(';');
} else {
buffer.flushBuffer();
// Double-byte characters to encode.
// PENDING: when outputting to an encoding that
// supports double-byte characters (UTF-8, for example),
// we should not be encoding
writeDecRef(ch);
}
}
buffer.flushBuffer();
}
}
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/RenderUtil.java | Tobago Deprecation | 140 |
org/apache/myfaces/tobago/renderkit/util/RenderUtils.java | Tobago Theme Standard | 138 |
}
public static String getFormattedValue(
FacesContext facesContext, UIComponent component) {
Object value = null;
if (component instanceof ValueHolder) {
value = ((ValueHolder) component).getLocalValue();
if (value == null) {
value = ((ValueHolder) component).getValue();
}
}
return getFormattedValue(facesContext, component, value);
}
// Copy from RendererBase
public static String getFormattedValue(
FacesContext context, UIComponent component, Object currentValue)
throws ConverterException {
if (currentValue == null) {
return "";
}
if (!(component instanceof ValueHolder)) {
return currentValue.toString();
}
Converter converter = ((ValueHolder) component).getConverter();
if (converter == null) {
if (currentValue instanceof String) {
return (String) currentValue;
}
Class converterType = currentValue.getClass();
converter = context.getApplication().createConverter(converterType);
}
if (converter == null) {
return currentValue.toString();
} else {
return converter.getAsString(context, component, currentValue);
}
}
public static Measure calculateStringWidth(FacesContext facesContext, UIComponent component, String text) {
return calculateStringWidth(facesContext, (Configurable) component, text, "tobago.font.widths");
}
public static Measure calculateStringWidth2(FacesContext facesContext, UIComponent component, String text) {
return calculateStringWidth(facesContext, (Configurable) component, text, "tobago.font2.widths");
}
private static Measure calculateStringWidth(
FacesContext facesContext, Configurable component, String text, String type) { |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/RenderUtil.java | Tobago Deprecation | 315 |
org/apache/myfaces/tobago/renderkit/util/RenderUtils.java | Tobago Theme Standard | 312 |
DebugUtils.addDevelopmentMessage(FacesContext.getCurrentInstance(), message);
}
} else if (kid instanceof UISelectItems) {
Object value = ((UISelectItems) kid).getValue();
if (LOG.isDebugEnabled()) {
LOG.debug("value " + value);
if (value != null) {
LOG.debug("value " + value.getClass().getName());
}
}
if (value == null) {
if (LOG.isDebugEnabled()) {
LOG.debug("value is null");
}
} else if (value instanceof SelectItem) {
list.add((SelectItem) value);
} else if (value instanceof SelectItem[]) {
SelectItem[] items = (SelectItem[]) value;
list.addAll(Arrays.asList(items));
} else if (value instanceof Collection) {
for (Object o : ((Collection) value)) {
list.add((SelectItem) o);
}
} else if (value instanceof Map) {
for (Object key : ((Map) value).keySet()) {
if (key != null) {
Object val = ((Map) value).get(key);
if (val != null) {
list.add(new SelectItem(val.toString(), key.toString(), null));
}
}
}
} else { |
File | Project | Line |
---|
org/apache/myfaces/tobago/component/UILinkCommand.java | Tobago Core | 39 |
org/apache/myfaces/tobago/component/UIOutput.java | Tobago Core | 39 |
Map<String, Object> getAttributes();
ValueBinding getValueBinding(String name);
void setValueBinding(String name, ValueBinding binding);
String getClientId(FacesContext context);
String getFamily();
String getId();
void setId(String id);
UIComponent getParent();
void setParent(UIComponent parent);
boolean isRendered();
void setRendered(boolean rendered);
String getRendererType();
void setRendererType(String rendererType);
boolean getRendersChildren();
List<UIComponent> getChildren();
int getChildCount();
UIComponent findComponent(String expr);
Map<String, UIComponent> getFacets();
UIComponent getFacet(String name);
Iterator<UIComponent> getFacetsAndChildren();
void broadcast(javax.faces.event.FacesEvent event) throws AbortProcessingException;
void decode(FacesContext context);
void encodeBegin(FacesContext context) throws IOException;
void encodeChildren(FacesContext context) throws IOException;
void encodeEnd(FacesContext context) throws IOException;
void queueEvent(javax.faces.event.FacesEvent event);
void processRestoreState(FacesContext context, Object state);
void processDecodes(FacesContext context);
void processValidators(FacesContext context);
void processUpdates(FacesContext context);
Object processSaveState(FacesContext context);
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/component/UIInput.java | Tobago Core | 38 |
org/apache/myfaces/tobago/component/UILinkCommand.java | Tobago Core | 39 |
Map<String, Object> getAttributes();
ValueBinding getValueBinding(String name);
void setValueBinding(String name, ValueBinding binding);
String getClientId(FacesContext context);
String getFamily();
String getId();
void setId(String id);
UIComponent getParent();
void setParent(UIComponent parent);
boolean isRendered();
void setRendered(boolean rendered);
String getRendererType();
void setRendererType(String rendererType);
boolean getRendersChildren();
List<UIComponent> getChildren();
int getChildCount();
UIComponent findComponent(String expr);
Map<String, UIComponent> getFacets();
UIComponent getFacet(String name);
Iterator<UIComponent> getFacetsAndChildren();
void broadcast(javax.faces.event.FacesEvent event) throws AbortProcessingException;
void decode(FacesContext context);
void encodeBegin(FacesContext context) throws IOException;
void encodeChildren(FacesContext context) throws IOException;
void encodeEnd(FacesContext context) throws IOException;
void queueEvent(javax.faces.event.FacesEvent event);
void processRestoreState(FacesContext context, Object state);
void processDecodes(FacesContext context);
void processValidators(FacesContext context);
void processUpdates(FacesContext context);
Object processSaveState(FacesContext context); |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/RenderUtil.java | Tobago Deprecation | 216 |
org/apache/myfaces/tobago/renderkit/util/RenderUtils.java | Tobago Theme Standard | 212 |
}
return Measure.valueOf(width);
}
public static List<SelectItem> getItemsToRender(javax.faces.component.UISelectOne component) {
return getItems(component);
}
public static List<SelectItem> getItemsToRender(javax.faces.component.UISelectMany component) {
return getItems(component);
}
public static List<SelectItem> getItems(javax.faces.component.UIInput component) {
List<SelectItem> selectItems = getSelectItems(component);
String renderRange = (String) component.getAttributes().get(Attributes.RENDER_RANGE_EXTERN);
if (renderRange == null) {
renderRange = (String) component.getAttributes().get(Attributes.RENDER_RANGE);
}
if (renderRange == null) {
return selectItems;
}
int[] indices = StringUtils.getIndices(renderRange);
List<SelectItem> items = new ArrayList<SelectItem>(indices.length);
if (selectItems.size() != 0) {
for (int indice : indices) {
items.add(selectItems.get(indice));
}
} else {
LOG.warn("No items found! rendering dummies instead!"); |
File | Project | Line |
---|
org/apache/myfaces/tobago/compat/FacesInvokeOnComponent12.java | Tobago JSF Compatibility | 27 |
org/apache/myfaces/tobago/compat/FacesUtilsEL.java | Tobago JSF Compatibility | 49 |
public static boolean invokeOnComponent(
FacesContext context, UIComponent component, String clientId, ContextCallback callback) {
String thisClientId = component.getClientId(context);
if (clientId.equals(thisClientId)) {
callback.invokeContextCallback(context, component);
return true;
} else if (component instanceof NamingContainer) {
// This component is a naming container. If the client id shows it's inside this naming container,
// then process further.
// Otherwise we know the client id we're looking for is not in this naming container,
// so for improved performance short circuit and return false.
if (clientId.startsWith(thisClientId)
&& (clientId.charAt(thisClientId.length()) == NamingContainer.SEPARATOR_CHAR)) {
if (invokeOnComponentFacetsAndChildren(context, component, clientId, callback)) {
return true;
}
}
} else {
if (invokeOnComponentFacetsAndChildren(context, component, clientId, callback)) {
return true;
}
}
return false;
}
private static boolean invokeOnComponentFacetsAndChildren(
FacesContext context, UIComponent component, String clientId, ContextCallback callback) {
for (java.util.Iterator<UIComponent> it = component.getFacetsAndChildren(); it.hasNext();) {
UIComponent child = it.next();
if (child.invokeOnComponent(context, clientId, callback)) {
return true;
}
}
return false;
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java | Tobago Deprecation | 569 |
org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java | Tobago Theme Standard | 408 |
int rowIndex = ((UISheet) partiallyComponent).getRowIndex();
if (rowIndex >= 0 && clientId.endsWith(Integer.toString(rowIndex))) {
return clientId.substring(0, clientId.lastIndexOf(NamingContainer.SEPARATOR_CHAR));
}
}
return clientId;
}
LOG.error("No Component found for id " + componentId + " search base component " + component.getClientId(context));
return null;
}
/**
* @deprecated since Tobago 1.5.0.
*/
@Deprecated
public static String toStyleString(String key, Integer value) {
StringBuilder buf = new StringBuilder();
buf.append(key);
buf.append(":");
buf.append(value);
buf.append("px; ");
return buf.toString();
}
/**
* @deprecated since Tobago 1.5.0.
*/
@Deprecated
public static String toStyleString(String key, String value) {
StringBuilder buf = new StringBuilder();
buf.append(key);
buf.append(":");
buf.append(value);
buf.append("; ");
return buf.toString();
}
/**
* @deprecated since Tobago 1.5.0. Please use getTitleFromTipAndMessages and write it out.
*/
@Deprecated
public static void renderTip(UIComponent component, TobagoResponseWriter writer) throws IOException { |
File | Project | Line |
---|
org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java | Tobago Core | 50 |
org/apache/myfaces/tobago/internal/component/AbstractUITabGroupLayout.java | Tobago Core | 31 |
public abstract class AbstractUITabGroupLayout extends AbstractUILayoutBase implements LayoutManager {
private static final Logger LOG = LoggerFactory.getLogger(AbstractUIGridLayout.class);
private boolean horizontalAuto;
private boolean verticalAuto;
public void init() {
for (LayoutComponent component : getLayoutContainer().getComponents()) {
if (component instanceof LayoutContainer) {
((LayoutContainer) component).getLayoutManager().init();
}
}
}
public void fixRelativeInsideAuto(Orientation orientation, boolean auto) {
if (orientation == Orientation.HORIZONTAL) {
horizontalAuto = auto;
} else {
verticalAuto = auto;
}
for (LayoutComponent component : getLayoutContainer().getComponents()) {
if (component instanceof LayoutContainer) {
((LayoutContainer) component).getLayoutManager().fixRelativeInsideAuto(orientation, auto);
}
}
}
public void preProcessing(Orientation orientation) {
// process auto tokens
IntervalList intervals = new IntervalList();
for (LayoutComponent component : getLayoutContainer().getComponents()) {
if (component instanceof LayoutContainer) { |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java | Tobago Deprecation | 457 |
org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java | Tobago Theme Standard | 254 |
writer.write("new Tobago.ScriptLoader(");
if (!ajax) {
writer.write("\n ");
}
writer.write(allScripts);
if (afterLoadCmds != null && afterLoadCmds.length > 0) {
writer.write(", ");
if (!ajax) {
writer.write("\n");
}
boolean first = true;
for (String afterLoadCmd : afterLoadCmds) {
String[] splittedStrings = StringUtils.split(afterLoadCmd, '\n'); // split on <CR> to have nicer JS
for (String splitted : splittedStrings) {
writer.write(first ? " " : " + ");
writer.write("\"");
String cmd = StringUtils.replace(splitted, "\\", "\\\\");
cmd = StringUtils.replace(cmd, "\"", "\\\"");
writer.write(cmd);
writer.write("\"");
if (!ajax) {
writer.write("\n");
}
first = false;
}
}
}
writer.write(");"); |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/HtmlElements.java | Tobago Core | 20 |
org/apache/myfaces/tobago/renderkit/html/HtmlConstants.java | Tobago Deprecation | 24 |
public final class HtmlConstants {
public static final String A = "a";
public static final String AREA = "area";
public static final String B = "b";
public static final String BASE = "base";
public static final String BODY = "body";
public static final String BR = "br";
public static final String BUTTON = "button";
public static final String COL = "col";
public static final String COLGROUP = "colgroup";
public static final String DIV = "div";
public static final String FIELDSET = "fieldset";
public static final String FORM = "form";
public static final String HEAD = "head";
public static final String HR = "hr";
public static final String HTML = "html";
public static final String IFRAME = "iframe";
public static final String IMG = "img";
public static final String INPUT = "input";
public static final String LABEL = "label";
public static final String LEGEND = "legend";
public static final String LI = "li";
public static final String LINK = "link";
public static final String META = "meta";
public static final String OL = "ol"; |
File | Project | Line |
---|
org/apache/myfaces/tobago/internal/context/ResourceManagerImpl.java | Tobago Core | 397 |
org/apache/myfaces/tobago/internal/context/ResourceManagerImpl.java | Tobago Core | 445 |
if (reverseOrder) {
matches.add(0, result);
} else {
matches.add(result);
}
if (LOG.isTraceEnabled()) {
LOG.trace("testing path: {} *", path); // match
}
return true;
} else if (!returnStrings) {
try {
path = path.substring(1).replace('/', '.');
Class clazz = Class.forName(path);
if (LOG.isTraceEnabled()) {
LOG.trace("testing path: " + path + " *"); // match
}
matches.add(clazz);
return true;
} catch (ClassNotFoundException e) {
// not found
if (LOG.isTraceEnabled()) {
LOG.trace("testing path: " + path); // no match
}
}
} else {
if (LOG.isTraceEnabled()) {
LOG.trace("testing path: " + path); // no match
}
}
return false;
}
private String makePath( |
File | Project | Line |
---|
org/apache/myfaces/tobago/internal/taglib/TagUtils.java | Tobago Core | 63 |
org/apache/myfaces/tobago/component/ComponentUtil.java | Tobago Deprecation | 249 |
component.getAttributes().put(name, new Integer(value));
}
}
}
public static void setBooleanProperty(UIComponent component, String name, String value) {
if (value != null) {
if (UIComponentTag.isValueReference(value)) {
component.setValueBinding(name, createValueBinding(value));
} else {
component.getAttributes().put(name, Boolean.valueOf(value));
}
}
}
public static void setStringProperty(UIComponent component, String name, String value) {
if (value != null) {
if (UIComponentTag.isValueReference(value)) {
component.setValueBinding(name, createValueBinding(value));
} else {
component.getAttributes().put(name, value);
}
}
}
public static void setValueForValueBinding(String name, Object value) { |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java | Tobago Deprecation | 137 |
org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java | Tobago Theme Standard | 126 |
public static void writeLabelWithAccessKey(TobagoResponseWriter writer, LabelWithAccessKey label)
throws IOException {
int pos = label.getPos();
String text = label.getText();
if (pos == -1) {
writer.writeText(text);
} else {
writer.writeText(text.substring(0, pos));
writer.startElement(HtmlElements.U, null);
writer.writeText(Character.toString(text.charAt(pos)));
writer.endElement(HtmlElements.U);
writer.writeText(text.substring(pos + 1));
}
}
/** @deprecated since 1.5.7 and 1.6.0 */
@Deprecated
public static void setDefaultTransition(FacesContext facesContext, boolean transition)
throws IOException {
writeScriptLoader(facesContext, null, new String[]{"Tobago.transition = " + transition + ";"});
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/util/EncodeAjaxCallback.java | Tobago Core | 82 |
org/apache/myfaces/tobago/renderkit/RenderUtil.java | Tobago Deprecation | 109 |
encode(facesContext, kid);
}
}
component.encodeEnd(facesContext);
}
}
public static void prepareRendererAll(FacesContext facesContext, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
RendererBase renderer = ComponentUtils.getRenderer(facesContext, component);
boolean prepareRendersChildren = false;
if (renderer != null) {
renderer.prepareRender(facesContext, component);
prepareRendersChildren = renderer.getPrepareRendersChildren();
}
if (prepareRendersChildren) {
renderer.prepareRendersChildren(facesContext, component);
} else {
Iterator it = component.getFacetsAndChildren();
while (it.hasNext()) {
UIComponent child = (UIComponent) it.next();
prepareRendererAll(facesContext, child);
}
}
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/event/ValueBindingResetInputActionListener.java | Tobago JSF Compatibility | 44 |
org/apache/myfaces/tobago/event/ValueExpressionResetInputActionListener.java | Tobago JSF Compatibility | 43 |
Object obj = clientIdsExpression.getValue(FacesContext.getCurrentInstance().getELContext());
String [] clientIds;
if (obj instanceof String[]) {
clientIds = (String[]) obj;
} else if (obj instanceof String) {
clientIds= StringUtils.split((String) obj, ", ");
} else {
LOG.error("Ignore unknown value of " + obj + " for reset.");
return;
}
for (String clientId : clientIds) {
UIComponent component = FindComponentUtils.findComponent(event.getComponent(), clientId);
if (component != null) {
resetChildren(component);
}
}
}
public boolean isTransient() {
return false;
}
public void restoreState(FacesContext context, Object state) {
Object[] values = (Object[]) state; |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java | Tobago Deprecation | 781 |
org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java | Tobago Theme Standard | 798 |
return builder.toString();
}
/**
* @deprecated since Tobago 1.5.0. Please use {@link org.apache.myfaces.tobago.renderkit.css.Classes}.
*/
@Deprecated
public static void removeStyleClasses(UIComponent cell) {
Object obj = cell.getAttributes().get(Attributes.STYLE_CLASS);
if (obj != null && obj instanceof StyleClasses && cell.getRendererType() != null) {
StyleClasses styleClasses = (StyleClasses) obj;
if (!styleClasses.isEmpty()) {
String rendererName = cell.getRendererType().substring(0, 1).toLowerCase(Locale.ENGLISH)
+ cell.getRendererType().substring(1);
styleClasses.removeTobagoClasses(rendererName);
}
if (styleClasses.isEmpty()) {
cell.getAttributes().remove(Attributes.STYLE_CLASS);
}
}
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java | Tobago Tool Apt | 652 |
org/apache/myfaces/tobago/apt/FacesConfigAnnotationVisitor.java | Tobago Tool Apt | 686 |
protected void addElement(InterfaceDeclaration decl, List<Element> components, List<Element> renderer,
Namespace namespace) throws IOException {
UIComponentTag componentTag = decl.getAnnotation(UIComponentTag.class);
if (componentTag != null) {
try {
Class<?> uiComponentClass = Class.forName(componentTag.uiComponent());
if (!componentTag.isComponentAlreadyDefined()) {
Element element = createComponentElement(decl, componentTag, uiComponentClass, namespace);
if (element != null) {
if (!containsElement(components, element)) {
addFacets(componentTag, namespace, element);
List attributes = new ArrayList();
List properties = new ArrayList();
addAttributes(decl, uiComponentClass, properties, attributes, namespace); |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/RendererBase.java | Tobago Core | 108 |
org/apache/myfaces/tobago/renderkit/util/RenderUtils.java | Tobago Theme Standard | 153 |
public static String getFormattedValue(
FacesContext context, UIComponent component, Object currentValue)
throws ConverterException {
if (currentValue == null) {
return "";
}
if (!(component instanceof ValueHolder)) {
return currentValue.toString();
}
Converter converter = ((ValueHolder) component).getConverter();
if (converter == null) {
if (currentValue instanceof String) {
return (String) currentValue;
}
Class converterType = currentValue.getClass();
converter = context.getApplication().createConverter(converterType);
}
if (converter == null) {
return currentValue.toString();
} else {
return converter.getAsString(context, component, currentValue);
}
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java | Tobago Deprecation | 692 |
org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java | Tobago Theme Standard | 528 |
public static void renderDojoDndItem(UIComponent component, TobagoResponseWriter writer, boolean addStyle)
throws IOException {
Object objDndType = component.getAttributes().get("dndType");
if (objDndType != null) {
writer.writeAttribute("dndType", String.valueOf(objDndType), false);
}
Object objDndData = component.getAttributes().get("dndData");
if (objDndData != null) {
writer.writeAttribute("dndData", String.valueOf(objDndData), false);
}
if (addStyle && (null != objDndType || null != objDndData)) {
StyleClasses styles = StyleClasses.ensureStyleClasses(component);
styles.addFullQualifiedClass("dojoDndItem");
}
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/RenderUtil.java | Tobago Deprecation | 114 |
org/apache/myfaces/tobago/renderkit/util/RenderUtils.java | Tobago Theme Standard | 117 |
}
public static void prepareRendererAll(FacesContext facesContext, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
RendererBase renderer = ComponentUtils.getRenderer(facesContext, component);
boolean prepareRendersChildren = false;
if (renderer != null) {
renderer.prepareRender(facesContext, component);
prepareRendersChildren = renderer.getPrepareRendersChildren();
}
if (prepareRendersChildren) {
renderer.prepareRendersChildren(facesContext, component);
} else {
Iterator it = component.getFacetsAndChildren();
while (it.hasNext()) {
UIComponent child = (UIComponent) it.next();
prepareRendererAll(facesContext, child);
}
}
}
public static String getFormattedValue( |
File | Project | Line |
---|
org/apache/myfaces/tobago/util/EncodeAjaxCallback.java | Tobago Core | 87 |
org/apache/myfaces/tobago/renderkit/util/RenderUtils.java | Tobago Theme Standard | 117 |
}
public static void prepareRendererAll(FacesContext facesContext, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
RendererBase renderer = ComponentUtils.getRenderer(facesContext, component);
boolean prepareRendersChildren = false;
if (renderer != null) {
renderer.prepareRender(facesContext, component);
prepareRendersChildren = renderer.getPrepareRendersChildren();
}
if (prepareRendersChildren) {
renderer.prepareRendersChildren(facesContext, component);
} else {
Iterator it = component.getFacetsAndChildren();
while (it.hasNext()) {
UIComponent child = (UIComponent) it.next();
prepareRendererAll(facesContext, child);
}
}
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java | Tobago Theme Scarborough | 65 |
org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java | Tobago Theme Scarborough | 65 |
boolean required = select.isRequired();
// fixme: use CSS, not the Style Attribute for "display"
style.setDisplay(null);
writer.startElement(HtmlElements.OL, select);
writer.writeIdAttribute(id);
writer.writeStyleAttribute(style);
writer.writeClassAttribute(Classes.create(select));
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
UIPage page = (UIPage) ComponentUtils.findPage(facesContext, component);
boolean focus = false;
if ((!StringUtils.isBlank(page.getFocusId()) && page.getFocusId().equals(id)) || select.isFocus()) {
focus = true;
}
Object value = select.getValue(); |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java | Tobago Theme Scarborough | 102 |
org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java | Tobago Theme Scarborough | 99 |
}
Integer tabIndex = select.getTabIndex();
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
HtmlRendererUtils.renderCommandFacet(select, itemId, facesContext, writer);
writer.endElement(HtmlElements.INPUT);
String label = item.getLabel();
if (label != null) {
writer.startElement(HtmlElements.LABEL, select);
writer.writeAttribute(HtmlAttributes.FOR, itemId, false);
writer.writeText(label);
writer.endElement(HtmlElements.LABEL);
}
writer.endElement(HtmlElements.LI);
}
writer.endElement(HtmlElements.OL); |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java | Tobago Deprecation | 95 |
org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java | Tobago Theme Standard | 95 |
public static void renderFocusId(final FacesContext facesContext, final UIInput component)
throws IOException {
if (renderErrorFocusId(facesContext, component)) {
return;
}
if (ComponentUtils.getBooleanAttribute(component, Attributes.FOCUS)) {
UIPage page = (UIPage) ComponentUtils.findPage(facesContext, component);
String id = component.getClientId(facesContext);
if (!StringUtils.isBlank(page.getFocusId()) && !page.getFocusId().equals(id)) {
LOG.warn("page focusId = \"" + page.getFocusId() + "\" ignoring new value \""
+ id + "\"");
} else {
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext); |
File | Project | Line |
---|
org/apache/myfaces/tobago/internal/util/HtmlWriterUtils.java | Tobago Core | 23 |
org/apache/myfaces/tobago/internal/util/JsonWriterUtils.java | Tobago Core | 24 |
public final class JsonWriterUtils extends WriterUtils {
private static final char[][] CHARS_TO_ESCAPE;
static {
// init lookup table
CHARS_TO_ESCAPE = new char[0xA0][];
for (int i = 0; i < 0x20; i++) {
CHARS_TO_ESCAPE[i] = EMPTY; // Control characters
}
CHARS_TO_ESCAPE['\t'] = "	".toCharArray(); // Horizontal tabulator
CHARS_TO_ESCAPE['\n'] = " ".toCharArray(); // Line feed
CHARS_TO_ESCAPE['\r'] = " ".toCharArray(); // Carriage return
CHARS_TO_ESCAPE['"'] = """.toCharArray();
CHARS_TO_ESCAPE['&'] = "&".toCharArray();
CHARS_TO_ESCAPE['<'] = "<".toCharArray();
CHARS_TO_ESCAPE['>'] = ">".toCharArray();
CHARS_TO_ESCAPE['\\'] = "\\\\".toCharArray(); |
File | Project | Line |
---|
org/apache/myfaces/tobago/internal/component/AbstractUIPage.java | Tobago Core | 266 |
org/apache/myfaces/tobago/internal/component/AbstractUIPanel.java | Tobago Core | 55 |
super.encodeEnd(facesContext);
}
public void onComponentPopulated(FacesContext facesContext, UIComponent parent) {
if (getLayoutManager() == null) {
setLayoutManager(CreateComponentUtils.createAndInitLayout(
facesContext, ComponentTypes.GRID_LAYOUT, RendererTypes.GRID_LAYOUT, parent));
}
}
public List<LayoutComponent> getComponents() {
return LayoutUtils.findLayoutChildren(this);
}
public LayoutManager getLayoutManager() {
return (LayoutManager) getFacet(Facets.LAYOUT);
}
public void setLayoutManager(LayoutManager layoutManager) {
getFacets().put(Facets.LAYOUT, (AbstractUILayoutBase) layoutManager);
}
public boolean isLayoutChildren() {
return isRendered();
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/LayoutComponentRendererBase.java | Tobago Core | 63 |
org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/GridLayoutRenderer.java | Tobago Theme Scarborough | 69 |
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.ROW_SPACING);
}
public Measure getMarginLeft(FacesContext facesContext, Configurable component) {
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_LEFT);
}
public Measure getMarginRight(FacesContext facesContext, Configurable component) {
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_RIGHT);
}
public Measure getMarginTop(FacesContext facesContext, Configurable component) {
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_TOP);
}
public Measure getMarginBottom(FacesContext facesContext, Configurable component) {
return getResourceManager().getThemeMeasure(facesContext, component, Attributes.MARGIN_BOTTOM);
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java | Tobago Tool Apt | 237 |
org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java | Tobago Tool Apt | 86 |
BodyContent bodyContent = tag.bodyContent();
BodyContentDescription contentDescription = decl.getAnnotation(BodyContentDescription.class);
// TODO more error checking
if (contentDescription != null) {
if (bodyContent.equals(BodyContent.JSP)
&& contentDescription.contentType().length() > 0) {
throw new IllegalArgumentException(
"contentType " + contentDescription.contentType() + " for bodyContent JSP not allowed!");
} else if (bodyContent.equals(BodyContent.TAGDEPENDENT)
&& contentDescription.contentType().length() == 0) {
throw new IllegalArgumentException("contentType should set for tagdependent bodyContent");
}
}
addLeafTextElement(bodyContent.toString(), "body-content", tagElement, document); |
File | Project | Line |
---|
org/apache/myfaces/tobago/internal/taglib/component/PopupReferenceTag.java | Tobago Core | 56 |
org/apache/myfaces/tobago/internal/taglib/component/ResetInputActionListenerTag.java | Tobago Core | 55 |
public abstract boolean isExecuteSet();
public int doStartTag() throws JspException {
// Locate our parent UIComponentTag
UIComponentTag tag =
UIComponentTag.getParentUIComponentTag(pageContext);
if (tag == null) {
// TODO Message resource i18n
throw new JspException("Not nested in faces tag");
}
if (!tag.getCreated()) {
return (SKIP_BODY);
}
UIComponent component = tag.getComponentInstance();
if (component == null) {
// TODO Message resource i18n
throw new JspException("Component Instance is null");
}
if (!(component instanceof ActionSource)) {
// TODO Message resource i18n
throw new JspException("Component " + component.getClass().getName() + " is not instanceof ActionSource");
}
ActionSource actionSource = (ActionSource) component;
if (!isExecuteSet()) { |
File | Project | Line |
---|
org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java | Tobago Theme Scarborough | 87 |
org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java | Tobago Theme Scarborough | 87 |
boolean checked = item.getValue().equals(value);
writer.writeAttribute(HtmlAttributes.CHECKED, checked);
writer.writeNameAttribute(id);
writer.writeIdAttribute(itemId);
String formattedValue = RenderUtils.getFormattedValue(facesContext, select, item.getValue());
writer.writeAttribute(HtmlAttributes.VALUE, formattedValue, true);
writer.writeAttribute(HtmlAttributes.DISABLED, item.isDisabled() || disabled);
writer.writeAttribute(HtmlAttributes.READONLY, readonly);
writer.writeAttribute(HtmlAttributes.REQUIRED, required);
if (focus) {
writer.writeAttribute(HtmlAttributes.AUTOFOCUS, true);
focus = false;
} |
File | Project | Line |
---|
org/apache/myfaces/tobago/facelets/FlowLayoutRule.java | Tobago Facelets | 38 |
org/apache/myfaces/tobago/facelets/GridLayoutRule.java | Tobago Facelets | 43 |
return new CellspacingMapper(attribute);
}
if (Attributes.MARGIN_LEFT.equals(name)) {
return new MarginLeftMapper(attribute);
}
if (Attributes.MARGIN_TOP.equals(name)) {
return new MarginTopMapper(attribute);
}
if (Attributes.MARGIN_RIGHT.equals(name)) {
return new MarginRightMapper(attribute);
}
if (Attributes.MARGIN_BOTTOM.equals(name)) {
return new MarginBottomMapper(attribute);
}
if (Attributes.MARGIN.equals(name)) {
return new MarginMapper(attribute);
}
}
}
return null;
}
static final class ColumnSpacingMapper extends Metadata { |
File | Project | Line |
---|
org/apache/myfaces/tobago/internal/webapp/DebugResponseWriterWrapper.java | Tobago Core | 127 |
org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterWrapper.java | Tobago Core | 105 |
responseWriter.endDocument();
}
public void writeURIAttribute(String name, Object value, String property) throws IOException {
responseWriter.writeURIAttribute(name, value, property);
}
public void writeText(char[] text, int off, int len) throws IOException {
responseWriter.writeText(text, off, len);
}
public void write(char[] chars, int i, int i1) throws IOException {
responseWriter.write(chars, i, i1);
}
public void close() throws IOException {
responseWriter.close();
} |