本文整理汇总了Java中org.apache.myfaces.trinidad.context.RequestContext.popCurrentComponent方法的典型用法代码示例。如果您正苦于以下问题:Java RequestContext.popCurrentComponent方法的具体用法?Java RequestContext.popCurrentComponent怎么用?Java RequestContext.popCurrentComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.myfaces.trinidad.context.RequestContext
的用法示例。
在下文中一共展示了RequestContext.popCurrentComponent方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processValidators
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@Override
public void processValidators(FacesContext context)
{
if (context == null)
throw new NullPointerException();
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, this);
try
{
if (!isRendered())
return;
// Process all facets and children of this component
validateChildren(context);
}
finally
{
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
}
示例2: processUpdates
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@Override
public void processUpdates(FacesContext context)
{
if (context == null)
throw new NullPointerException();
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, this);
try
{
if (!isRendered())
return;
// Process all facets and children of this component
updateChildren(context);
}
finally
{
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
}
示例3: processValidators
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@Override
public void processValidators(FacesContext context)
{
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, this);
try
{
// Skip processing if our rendered flag is false
if (!isRendered())
return;
super.processValidators(context);
if (!isImmediate())
_executeValidate(context);
}
finally
{
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
}
示例4: encodeEnd
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@Override
public void encodeEnd(FacesContext context) throws IOException
{
if (context == null)
throw new NullPointerException();
try
{
if (isRendered())
{
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
try
{
Renderer renderer = getRenderer(context);
// if there is a Renderer for this component
if (renderer != null)
{
renderer.encodeEnd(context, this);
}
}
finally
{
requestContext.popCurrentComponent(context, this);
}
}
}
finally
{
popComponentFromEL(context);
}
}
示例5: processDecodes
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@Override
public void processDecodes(FacesContext context)
{
if (context == null)
throw new NullPointerException();
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, this);
try
{
if (!isRendered())
return;
// Process all facets and children of this component
decodeChildren(context);
// Process this component itself
decode(context);
}
finally
{
// Call UIComponent.popComponentFromEL(javax.faces.context.FacesContext) from inside of a finally
// block, just before returning.
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
}
示例6: processRestoreState
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@Override
public void processRestoreState(FacesContext context, Object state)
{
if (context == null)
throw new NullPointerException();
if (_LOG.isFiner())
_LOG.finer("processRestoreState() on " + this);
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, this);
try
{
// If we saved a "TreeState", use it to restore everything
if (state instanceof TreeState)
{
((TreeState) state).restoreState(context, this);
}
// Otherwise, we had no children or facets, and just use
// the "state" object
else
{
restoreState(context, state);
}
}
finally
{
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
}
示例7: broadcastInContext
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
/**
* Broadcast the FacesEvent after updating the current component and
* current composite component
*
* @param context The current instance of FacesContext
* @param event The FacesEvent to be broadcasted
*/
public static void broadcastInContext(FacesContext context, FacesEvent event)
{
UIComponent component = event.getComponent();
UIComponent compositeParent = null;
RequestContext requestContext = RequestContext.getCurrentInstance();
if (!UIComponent.isCompositeComponent(component))
{
compositeParent = UIComponent.getCompositeComponentParent(component);
if (compositeParent != null)
{
requestContext.pushCurrentComponent(context, compositeParent);
compositeParent.pushComponentToEL(context, null);
}
}
requestContext.pushCurrentComponent(context, component);
component.pushComponentToEL(context, null);
try
{
component.broadcast(event);
}
finally
{
component.popComponentFromEL(context);
requestContext.popCurrentComponent(context, component);
if (compositeParent != null)
{
compositeParent.popComponentFromEL(context);
requestContext.popCurrentComponent(context, compositeParent);
}
}
}
示例8: processUpdates
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@Override
public void processUpdates(FacesContext context)
{
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, this);
try
{
// Skip processing if our rendered flag is false
if (!isRendered())
return;
super.processUpdates(context);
// Process this component itself
updateModel(context);
}
finally
{
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
if (!isValid())
{
context.renderResponse();
}
}
示例9: processSaveState
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@Override
public Object processSaveState(FacesContext context)
{
if (context == null)
throw new NullPointerException();
if (_LOG.isFiner())
_LOG.finer("processSaveState() on " + this);
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, this);
Object state = null;
try
{
if (((_children == null) || _children.isEmpty()) &&
((_facets == null) || _facets.isEmpty()))
{
state = saveState(context);
}
else
{
TreeState treeState = new TreeState();
treeState.saveState(context, this);
if (treeState.isEmpty())
state = null;
state = treeState;
}
}
catch (RuntimeException e)
{
_LOG.warning(_LOG.getMessage("COMPONENT_CHILDREN_SAVED_STATE_FAILED", this));
throw e;
}
finally
{
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
return state;
}
示例10: invokeOnComponent
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的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;
}
示例11: processDecodes
import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
/**
* In addition to the standard <code>processDecodes</code> behavior
* inherited from {@link UIXComponentBase}, calls
* <code>validate()</code> if the the <code>immediate</code>
* property is true. Iif the component is invalid afterwards or
* a <code>RuntimeException</code> is thrown, calls
* {@link FacesContext#renderResponse}.
*/
@Override
public void processDecodes(FacesContext context)
{
if (!isValid())
{
// An exception could occur during normal bean attribute level
// validation in update_model phase. When it happens, the component
// will have an invalid local value, and LOCAL_VALUE_SET remains
// true since we want the invalid value to be shown to end user
// to make corrections. But we don't want the invalid state affects
// the next request, so we clear the local value and LOCAL_VALUE_SET
// property here. While on the other hand, we should not clear the
// state when the component is valid, to avoid accidentally clearing
// data that other components might depend on.
setValue(null);
setLocalValueSet(false);
}
setValid(true);
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.pushCurrentComponent(context, this);
pushComponentToEL(context, this);
try
{
// Skip processing if our rendered flag is false
if (!isRendered())
return;
super.processDecodes(context);
if (isImmediate())
_executeValidate(context);
}
finally
{
popComponentFromEL(context);
requestContext.popCurrentComponent(context, this);
}
}