本文整理汇总了Java中javax.faces.component.UINamingContainer.getSeparatorChar方法的典型用法代码示例。如果您正苦于以下问题:Java UINamingContainer.getSeparatorChar方法的具体用法?Java UINamingContainer.getSeparatorChar怎么用?Java UINamingContainer.getSeparatorChar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.faces.component.UINamingContainer
的用法示例。
在下文中一共展示了UINamingContainer.getSeparatorChar方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEndTextToRender
import javax.faces.component.UINamingContainer; //导入方法依赖的package包/类
@Override
protected void getEndTextToRender(FacesContext context, UIComponent component, String currentValue) throws IOException {
final ResponseWriter writer = context.getResponseWriter();
if (component instanceof HtmlRadioBox) {
final HtmlRadioBox radioBox = (HtmlRadioBox) component;
final String radioBoxClientId = radioBox.getClientId();
final char separatorChar = UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance());
if (radioBox.getValues() instanceof Iterable) {
int iterator = 0;
for (java.lang.Object o : (Iterable) radioBox.getValues()) {
renderRadioBoxItem(writer, radioBox, radioBoxClientId, separatorChar, iterator, o);
iterator++;
}
}
}
}
示例2: getResolvedId
import javax.faces.component.UINamingContainer; //导入方法依赖的package包/类
private static String getResolvedId(final UIComponentBase component, final String id) {
if (id.equals("@all") || id.equals("@none") || id.equals("@form") || id.equals("@this")) {
return id;
}
UIComponent resolvedComponent = component.findComponent(id);
if (resolvedComponent == null) {
final FacesContext context = FacesContext.getCurrentInstance();
if (context != null && id.charAt(0) == UINamingContainer.getSeparatorChar(context)) {
return id.substring(1);
}
return id;
}
return resolvedComponent.getClientId();
}
示例3: getResolvedId
import javax.faces.component.UINamingContainer; //导入方法依赖的package包/类
private String getResolvedId(final UIComponent component, final String clientIdToResolve) {
// some component does not return correct client id (i.e. table) so try it by using parent component
final UIComponent resolvedComponent = this.resolveComponent(component, clientIdToResolve);
if (resolvedComponent == null) {
if (clientIdToResolve.charAt(0) == UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance())) {
return clientIdToResolve.substring(1);
}
return clientIdToResolve;
}
return resolvedComponent.getClientId();
}
示例4: writeRequiredSpanIfNecessary
import javax.faces.component.UINamingContainer; //导入方法依赖的package包/类
private void writeRequiredSpanIfNecessary(final String clientId, final boolean readonly, final boolean required,
final ResponseWriter writer) throws IOException {
if (required && !readonly) {
final char separatorChar = UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance());
writer.startElement("span", null);
writer.writeAttribute("id", clientId + separatorChar + "requiredLabel", null);
writer.writeAttribute("class", Constants.REQUIRED_SPAN_CLASS, null);
writer.endElement("span");
}
}
示例5: checkClientId
import javax.faces.component.UINamingContainer; //导入方法依赖的package包/类
private String checkClientId(final FacesContext context, final String clientId) {
return StringUtils.isNotEmpty(clientId) && clientId.charAt(0) == UINamingContainer.getSeparatorChar(context)
? clientId.substring(1)
: clientId;
}
示例6: createInputClientId
import javax.faces.component.UINamingContainer; //导入方法依赖的package包/类
private String createInputClientId(FacesContext context, UIComponent component) {
final char separatorChar = UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance());
return component.getClientId(context) + separatorChar + "inner";
}
示例7: encodeEnd
import javax.faces.component.UINamingContainer; //导入方法依赖的package包/类
@Override
public void encodeEnd(final FacesContext context, final UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
final HtmlTooltip tooltip = (HtmlTooltip) component;
final ResponseWriter writer = context.getResponseWriter();
final char separatorChar = UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance());
final String contentId = component.getClientId().replace(separatorChar + "", "_");
final String forSelector = getForElement(tooltip);
if (StringUtils.isNotEmpty(forSelector)) {
writer.startElement("span", tooltip);
writer.writeAttribute("name", contentId, null);
writer.writeAttribute("class", "butter-component-tooltip-temp-content", null);
if (StringUtils.isEmpty(tooltip.getFor()) && tooltip.getParent() instanceof Tooltip) {
renderValidationErrors(context, writer, tooltip.getParent());
}
for (UIComponent child : tooltip.getChildren()) {
child.encodeAll(context);
}
writer.endElement("span");
writer.startElement("script", tooltip);
writer.writeText("jQuery(document).ready(function() {\n", null);
writer.writeText(" jQuery(", null);
writer.writeText(forSelector, null);
writer.writeText(")._butterTooltip({\n", null);
writer.writeText(" trigger: ", null);
writer.writeText(getNullSafeStringParameter(tooltip.getTrigger()), null);
writer.writeText(",\n title: ", null);
writer.writeText(getNullSafeStringParameter(tooltip.getTitle()), null);
writer.writeText(",\n placement: ", null);
writer.writeText(getNullSafeStringParameter(tooltip.getPlacement()), null);
writer.writeText(",\n placementFunction: ", null);
writer.writeText(getNullSafeFunctionParameter(tooltip.getPlacementFunction()), null);
writer.writeText(",\n contentByName: '", null);
writer.writeText(contentId, null);
writer.writeText("',\n minVerticalOffset: ", null);
writer.writeText(getNullSafeIntegerParameter(tooltip.getMinVerticalOffset()), null);
writer.writeText(",\n minHorizontalOffset: ", null);
writer.writeText(getNullSafeIntegerParameter(tooltip.getMinHorizontalOffset()), null);
writer.writeText(",\n viewport: ", null);
writer.writeText("'" + StringUtils.getNotNullValue(tooltip.getViewport(), "body") + "'", null);
writer.writeText("\n })\n});", null);
if (StringUtils.isNotEmpty(tooltip.getOnShow())
|| StringUtils.isNotEmpty(tooltip.getOnShown())
|| StringUtils.isNotEmpty(tooltip.getOnHide())
|| StringUtils.isNotEmpty(tooltip.getOnHidden())) {
encodePopoverEvent(forSelector, tooltip.getOnShow(), "show.bs.popover", component, writer);
encodePopoverEvent(forSelector, tooltip.getOnShown(), "shown.bs.popover", component, writer);
encodePopoverEvent(forSelector, tooltip.getOnHide(), "hide.bs.popover", component, writer);
encodePopoverEvent(forSelector, tooltip.getOnHidden(), "hidden.bs.popover", component, writer);
}
if (StringUtils.isEmpty(tooltip.getFor()) && isTooltipParentReadonly(tooltip)) {
// in this case popover will be docked in readonly text to calculate correct position
// hover event should triggered correctly
writer.writeText("jQuery(document).ready(function() {", null);
writer.writeText("\n jQuery(" + createParentForElement(tooltip) + ").find('.butter-component-label').on('" + convertTooltipTriggerToJavaScriptEvent(tooltip.getTrigger()) + "', function(e) {", component, null);
writer.writeText("\n jQuery(" + createParentReadonlyForElement(tooltip) + ").trigger(e.type);", component, null);
writer.writeText("\n });", component, null);
writer.writeText("\n});\n", component, null);
}
writer.endElement("script");
}
}
示例8: getComponentId
import javax.faces.component.UINamingContainer; //导入方法依赖的package包/类
private static String getComponentId(FacesContext context, UIComponent component, String originalExpression) {
char separatorChar = UINamingContainer.getSeparatorChar(context);
String separator = "" + separatorChar;
UIComponent root;
if (originalExpression.startsWith(":")) {
originalExpression = originalExpression.substring(1);
root = context.getViewRoot();
} else {
root = component;
}
List<UIComponent> roots = new ArrayList<UIComponent>();
roots.add(root);
String result = "";
String[] subexpressions = originalExpression.split(separator);
for (int i = 0; i < subexpressions.length; i++) {
String currentId = subexpressions[i];
if (currentId != null && currentId.length() > 0) {
if (currentId.startsWith("@(") && currentId.endsWith(")")) {
// the jQuery expression is evaluated on the client side
result += currentId + " ";
roots.clear();
} else {
if (currentId.equals("**")) {
i++;
if (subexpressions[i].contains("*"))
currentId = "@findPartialIdRecursively(" + subexpressions[i] + ")";
else
currentId = "@findIdRecursively(" + subexpressions[i] + ")";
} else if (currentId.equals("*")) {
i++;
currentId = "@findId(" + subexpressions[i] + ")";
} else if (currentId.contains("*")) {
currentId = "@findPartialId(" + currentId + ")";
}
roots = translateSearchExpressionToId(component, roots, currentId, originalExpression);
}
} else
throw new FacesException("Invalid search expression: " + originalExpression);
}
for (UIComponent c : roots) {
result += c.getClientId() + " ";
}
return result.trim();
}
示例9: getSeparatorChar
import javax.faces.component.UINamingContainer; //导入方法依赖的package包/类
static char getSeparatorChar(FacesContext context) {
return UINamingContainer.getSeparatorChar(context);
}