本文整理汇总了Java中javax.faces.component.ContextCallback类的典型用法代码示例。如果您正苦于以下问题:Java ContextCallback类的具体用法?Java ContextCallback怎么用?Java ContextCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContextCallback类属于javax.faces.component包,在下文中一共展示了ContextCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
// Handle partial refresh here
FacesContextEx ctx = (FacesContextEx)context;
if(ctx.isRenderingPhase()) {
UIComponent subTree = getSubTreeComponent();
if(subTree!=null) {
this.oldSubTree = ctx.getSubTreeComponent();
ctx.setSubTreeComponent(subTree);
try {
return super.invokeOnComponent(context, clientId, callback);
} finally {
ctx.setSubTreeComponent(oldSubTree instanceof UIComponent?(UIComponent)oldSubTree:null);
oldSubTree = null;
}
}
}
return super.invokeOnComponent(context, clientId, callback);
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:UIDynamicControl.java
示例2: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
// Check for the current component
String cid = getClientId(context);
if (clientId.equals(cid)) {
try {
callback.invokeContextCallback(context, this);
return true;
} catch (Exception e) {
throw new FacesException(e);
}
}
// Or the selected facet
UIComponent facet = selectFacet();
if(facet!=null) {
try {
if(facet.invokeOnComponent(context, clientId, callback)) {
return true;
}
} finally {
unselectFacet();
}
}
return false;
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:UISwitchFacet.java
示例3: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
UIComponent subTree = getSubTreeComponent();
if(subTree!=null) {
// Handle partial refresh here
FacesContextEx ctx = (FacesContextEx)context;
if(ctx.isRenderingPhase()) {
this.oldSubTree = ctx.getSubTreeComponent();
ctx.setSubTreeComponent(subTree);
try {
return super.invokeOnComponent(context, clientId, callback);
} finally {
ctx.setSubTreeComponent(oldSubTree instanceof UIComponent?(UIComponent)oldSubTree:null);
oldSubTree = null;
}
}
}
return super.invokeOnComponent(context, clientId, callback);
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:UIDojoTabPane.java
示例4: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
// Handle partial refresh here
FacesContextEx ctx = (FacesContextEx)context;
if(ctx.isRenderingPhase()) {
this.oldSubTree = ctx.getSubTreeComponent();
ctx.setSubTreeComponent(this);
try {
return super.invokeOnComponent(context, clientId, callback);
} finally {
ctx.setSubTreeComponent(oldSubTree instanceof UIComponent?(UIComponent)oldSubTree:null);
oldSubTree = null;
}
} else {
return super.invokeOnComponent(context, clientId, callback);
}
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:UIMobilePageContent.java
示例5: invokeOnChildrenComponents
import javax.faces.component.ContextCallback; //导入依赖的package包/类
/**
* Convenience method to call <code>invokeOnComponent</code> on all of the
* children of a component, surrounding the invocation with calls to
* <code>setup/tearDownChildrenVisitingContext</code>.
* This is useful when a component sometimes optimizes
* away calling <code>invokeOnComponent</code> on its children.
* @see UIXComponent#setupChildrenVisitingContext
* @see UIXComponent#tearDownChildrenVisitingContext
*/
protected final boolean invokeOnChildrenComponents(
FacesContext context,
String clientId,
ContextCallback callback)
throws FacesException
{
setupChildrenVisitingContext(context);
boolean found = false;
try
{
Iterator<UIComponent> children = getFacetsAndChildren();
while (children.hasNext() && !found)
{
found = children.next().invokeOnComponent(context, clientId, callback);
}
}
finally
{
tearDownChildrenVisitingContext(context);
}
return found;
}
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:36,代码来源:UIXComponentBase.java
示例6: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(FacesContext context,
String clientId,
ContextCallback callback)
throws FacesException
{
// optimize case where clientId isn't in NamingContainer
return invokeOnNamingContainerComponent(context, clientId, callback);
}
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:10,代码来源:UIXComponentRefTemplate.java
示例7: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(final FacesContext context,
final String clientId,
final ContextCallback callback) throws FacesException {
final int savedRowIndex = this.getRowIndex();
try {
return super.invokeOnComponent(context, clientId, callback);
} catch (Exception e) {
// This error will occur if a composite component is used as column child.
this.setRowIndex(savedRowIndex);
return invokeOnComponentFromUIComponent(context, clientId, callback);
}
}
开发者ID:ButterFaces,项目名称:ButterFaces,代码行数:16,代码来源:HtmlTable.java
示例8: invokeOnComponentFromUIComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
/**
* Copy from {@link UIComponent#invokeOnComponent} because super call will trigger {@link UIData#invokeOnComponent(FacesContext, String, ContextCallback)}.
*
* @param context context
* @param clientId table client id
* @param callback callback
* @return true if component is found
*/
private boolean invokeOnComponentFromUIComponent(final FacesContext context,
final String clientId,
final ContextCallback callback) throws FacesException {
if (null == context || null == clientId || null == callback) {
throw new NullPointerException();
}
boolean found = false;
if (clientId.equals(this.getClientId(context))) {
try {
this.pushComponentToEL(context, this);
callback.invokeContextCallback(context, this);
return true;
} catch (Exception e) {
throw new FacesException(e);
} finally {
this.popComponentFromEL(context);
}
} else {
final Iterator<UIComponent> itr = this.getFacetsAndChildren();
while (itr.hasNext() && !found) {
found = itr.next().invokeOnComponent(context, clientId, callback);
}
}
return found;
}
开发者ID:ButterFaces,项目名称:ButterFaces,代码行数:36,代码来源:HtmlTable.java
示例9: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
public boolean invokeOnComponent(FacesContext faces, String clientId, ContextCallback callback)
throws FacesException {
String id = super.getClientId(faces);
if (clientId.equals(id)) {
this.pushComponentToEL(faces, this);
try {
callback.invokeContextCallback(faces, this);
} finally {
this.popComponentFromEL(faces);
}
return true;
} else if (clientId.startsWith(id)) {
int prevIndex = this.index;
int idxStart = clientId.indexOf(getSeparatorChar(faces), id.length());
if (idxStart != -1 && Character.isDigit(clientId.charAt(idxStart + 1))) {
int idxEnd = clientId.indexOf(getSeparatorChar(faces), idxStart + 1);
if (idxEnd != -1) {
int newIndex = Integer.parseInt(clientId.substring(idxStart + 1, idxEnd));
boolean found = false;
try {
this.captureOrigValue(faces);
this.setIndex(faces, newIndex);
if (this.isIndexAvailable()) {
found = super.invokeOnComponent(faces, clientId, callback);
}
} finally {
this.setIndex(faces, prevIndex);
this.restoreOrigValue(faces);
}
return found;
}
} else {
return super.invokeOnComponent(faces, clientId, callback);
}
}
return false;
}
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:38,代码来源:TabRepeat.java
示例10: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
try {
_shadowedData = publishControlData(context);
return super.invokeOnComponent(context, clientId, callback);
} finally {
revokeControlData(_shadowedData, context);
_shadowedData = null;
}
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:UIVarPublisherBase.java
示例11: adInView
import javax.faces.component.ContextCallback; //导入依赖的package包/类
public void adInView(WaypointEvent e) {
UIComponent container = e.getComponent().findComponent("container");
container.invokeOnComponent(FacesContext.getCurrentInstance(), e.getWaypointId(), new ContextCallback() {
public void invokeContextCallback(FacesContext fc, UIComponent component) {
HtmlPanelGroup panelGroup = (HtmlPanelGroup) component;
String analyticsId = panelGroup != null ? (String) panelGroup.getAttributes().get("analyticsid") : "";
FacesMessage msg =
new FacesMessage(FacesMessage.SEVERITY_INFO, "Ad with ID: " + analyticsId + " was read", null);
fc.addMessage(null, msg);
}
});
}
开发者ID:websphere,项目名称:PrimefacesShowcase,代码行数:16,代码来源:ScrollAnalyticsController.java
示例12: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(FacesContext context, String clientId,
ContextCallback callback) throws FacesException {
throw new UnsupportedOperationException();
}
开发者ID:servicecatalog,项目名称:oscm,代码行数:6,代码来源:UIViewRootStub.java
示例13: invokeOnNamingContainerComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
/**
* <p>
* Optimized implementation of <code>invokeOnComponent</code> for NamingContainers.
* If the clientId isn't within the NamingContainer, invocation of the
* NamingContainer's children is skipped.
* </p>
* <p>Subclasses implementing NamingContainer should override
* <code>invokeOnComponent</code> and delegate to this method.</p>
*/
protected final boolean invokeOnNamingContainerComponent(
FacesContext context,
String clientId,
ContextCallback callback)
throws FacesException
{
assert this instanceof NamingContainer : "Only use invokeOnNamingContainerComponent on NamingContainers";
boolean invokedComponent;
setupVisitingContext(context);
try
{
String thisClientId = getClientId(context);
if (clientId.equals(thisClientId))
{
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, null);
try
{
// this is the component we want, so invoke the callback
callback.invokeContextCallback(context, this);
}
finally
{
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
invokedComponent = true;
}
else
{
// if this is a NamingContainer, only traverse into it if the clientId we are looking for
// is inside of it
if ((!clientId.startsWith(thisClientId) ||
(clientId.charAt(thisClientId.length()) != NamingContainer.SEPARATOR_CHAR)))
{
invokedComponent = false;
}
else
{
// iterate through children.
// We inline this code instead of calling super in order
// to avoid making an extra call to getClientId().
invokedComponent = invokeOnChildrenComponents(context, clientId, callback);
}
}
}
finally
{
// teardown the context now that we have visited the children
tearDownVisitingContext(context);
}
return invokedComponent;
}
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:71,代码来源:UIXComponentBase.java
示例14: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
/**
* Override to calls the hooks for setting up and tearing down the
* context before the children are visited.
* @see #setupVisitingContext
* @see #tearDownVisitingContext
*/
@Override
public boolean invokeOnComponent(
FacesContext context,
String clientId,
ContextCallback callback)
throws FacesException
{
boolean invokedComponent;
// set up the context for visiting the children
setupVisitingContext(context);
try
{
String thisClientId = getClientId(context);
if (clientId.equals(thisClientId))
{
// push component to the stack before invoking the component.
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, null);
try
{
// this is the component we want, so invoke the callback
callback.invokeContextCallback(context, this);
}
finally
{
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
// we found the component
invokedComponent = true;
}
else
{
// set up the children visiting context to iterate through children. We inline this
// code instead of calling super in order
// to avoid making an extra call to getClientId().
invokedComponent = invokeOnChildrenComponents(context, clientId, callback);
}
}
finally
{
// teardown the context now that we have visited the component
tearDownVisitingContext(context);
}
return invokedComponent;
}
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:60,代码来源:UIXComponentBase.java
示例15: invokeOnComponent
import javax.faces.component.ContextCallback; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
return super.invokeOnComponent(context, clientId, callback);
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:5,代码来源:UIDialog.java
注:本文中的javax.faces.component.ContextCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论