本文整理汇总了Java中javax.faces.event.PhaseId类的典型用法代码示例。如果您正苦于以下问题:Java PhaseId类的具体用法?Java PhaseId怎么用?Java PhaseId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PhaseId类属于javax.faces.event包,在下文中一共展示了PhaseId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getListener
import javax.faces.event.PhaseId; //导入依赖的package包/类
public PhaseListener getListener() {
return new PhaseListener() {
private static final long serialVersionUID = -66585096775189540L;
public PhaseId getPhaseId() {
return PhaseId.RENDER_RESPONSE;
}
public void beforePhase(PhaseEvent event) {
unselectCategory();
}
public void afterPhase(PhaseEvent arg0) {
// nothing
}
};
}
示例2: handleValueChange
import javax.faces.event.PhaseId; //导入依赖的package包/类
public void handleValueChange (ValueChangeEvent event)
{
PhaseId
phaseId = event.getPhaseId();
String
oldValue = (String) event.getOldValue(),
newValue = (String) event.getNewValue();
if (phaseId.equals(PhaseId.ANY_PHASE))
{
event.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
event.queue();
}
else if (phaseId.equals(PhaseId.UPDATE_MODEL_VALUES))
{
// do you method here
}
}
示例3: processPartial
import javax.faces.event.PhaseId; //导入依赖的package包/类
@Override
public void processPartial(PhaseId phaseId)
{
UIViewRoot viewRoot = _context.getViewRoot();
if (phaseId == PhaseId.APPLY_REQUEST_VALUES ||
phaseId == PhaseId.PROCESS_VALIDATIONS ||
phaseId == PhaseId.UPDATE_MODEL_VALUES)
{
_processExecute(viewRoot, phaseId);
}
else if (phaseId == PhaseId.RENDER_RESPONSE)
{
_processRender(viewRoot);
}
}
示例4: _processExecute
import javax.faces.event.PhaseId; //导入依赖的package包/类
private void _processExecute(UIViewRoot component, PhaseId phaseId)
{
// We are only handling visit-based (partial) execution here.
// Full execution (isExecuteAll() == true) is handled by the UIViewRoot
// Note that this is different from the render phase
Collection<String> executeIds = getExecuteIds();
if (executeIds == null || executeIds.isEmpty())
{
_LOG.warning("No execute Ids were supplied for the Ajax request");
return;
}
VisitContext visitContext = VisitContext.createVisitContext(_context, executeIds,
EnumSet.of(VisitHint.SKIP_UNRENDERED, VisitHint.EXECUTE_LIFECYCLE));
VisitCallback visitCallback = new ProcessPhaseCallback(_context, phaseId);
component.visitTree(visitContext, visitCallback);
}
示例5: visit
import javax.faces.event.PhaseId; //导入依赖的package包/类
public VisitResult visit(VisitContext context, UIComponent target)
{
if (_phaseId == PhaseId.APPLY_REQUEST_VALUES)
{
target.processDecodes(_context);
}
else if (_phaseId == PhaseId.PROCESS_VALIDATIONS)
{
target.processValidators(_context);
}
else if (_phaseId == PhaseId.UPDATE_MODEL_VALUES)
{
target.processUpdates(_context);
}
// No need to visit children, since they will be executed/rendred by their parents
return VisitResult.REJECT;
}
示例6: setUp
import javax.faces.event.PhaseId; //导入依赖的package包/类
@Override
protected void setUp() throws IOException
{
_facesContext = createMockFacesContext(MApplication.sharedInstance(), true);
_requestContext = createRequestContext();
_requestContext.setSkinFamily(_skinFamily);
_requestContext.setAgent(_agent);
_requestContext.setRightToLeft(_rightToLeft);
_requestContext.setOutputMode(_outputMode);
_requestContext.setAccessibilityMode(_accMode);
_facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
UIViewRoot root = RenderKitBootstrap.createUIViewRoot(_facesContext);
root.setRenderKitId(getRenderKitId());
_facesContext.setViewRoot(root);
ExtendedRenderKitService service =
_getExtendedRenderKitService(_facesContext);
if (service != null)
service.encodeBegin(_facesContext);
}
示例7: __handleQueueEvent
import javax.faces.event.PhaseId; //导入依赖的package包/类
/**
* This method sets the phaseID of the event
* according to the "immediate" property of this
* component.
* If "immediate" is set to true, this calls
* {@link FacesContext#renderResponse}
*/
static void __handleQueueEvent(UIComponent comp, FacesEvent event)
{
if (_isImmediateEvent(comp, event))
{
String immediateAttr = UIXTree.IMMEDIATE_KEY.getName();
Object isImmediate = comp.getAttributes().get(immediateAttr);
if (Boolean.TRUE.equals(isImmediate))
{
event.setPhaseId(PhaseId.ANY_PHASE);
FacesContext context = FacesContext.getCurrentInstance();
context.renderResponse();
}
else
{
// the event should not execute before model updates are done.
// otherwise, the updates will be done to the wrong rows.
// we can't do this at the end of the UPDATE_MODEL phase because
// if there are errors during that phase, then we want to immediately render
// the response, and not deliver this ui event:
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
}
}
示例8: __processChildren
import javax.faces.event.PhaseId; //导入依赖的package包/类
/**
* Process all the children of the given table
*/
@SuppressWarnings("unchecked")
static void __processChildren(
FacesContext context,
final UIXCollection comp,
final PhaseId phaseId)
{
// process the children
int childCount = comp.getChildCount();
if (childCount != 0)
{
List<UIComponent> children = comp.getChildren();
for (int i = 0; i < childCount; i++)
{
UIComponent child = children.get(i);
comp.processComponent(context, child, phaseId);
}
}
}
示例9: processComponent
import javax.faces.event.PhaseId; //导入依赖的package包/类
/**
* Process a component.
* This method calls {@link #processDecodes(FacesContext)},
* {@link #processValidators} or
* {@link #processUpdates}
* depending on the {#link PhaseId}.
*/
protected final void processComponent(
FacesContext context,
UIComponent component,
PhaseId phaseId)
{
if (component != null)
{
if (phaseId == PhaseId.APPLY_REQUEST_VALUES)
component.processDecodes(context);
else if (phaseId == PhaseId.PROCESS_VALIDATIONS)
component.processValidators(context);
else if (phaseId == PhaseId.UPDATE_MODEL_VALUES)
component.processUpdates(context);
else
throw new IllegalArgumentException(_LOG.getMessage(
"BAD_PHASEID",phaseId));
}
}
示例10: processFacetsAndChildren
import javax.faces.event.PhaseId; //导入依赖的package包/类
@Override
protected void processFacetsAndChildren(
FacesContext context,
PhaseId phaseId)
{
// process all the facets of this table just once
// (except for the "detailStamp" facet which must be processed once
// per row):
TableUtils.processFacets(context, this, this, phaseId,
UIXTable.DETAIL_STAMP_FACET);
// process all the facets of this table's column children:
TableUtils.processColumnFacets(context, this, this, phaseId);
// process all the children and the detailStamp as many times as necessary
processStamps(context, phaseId);
}
示例11: queueEvent
import javax.faces.event.PhaseId; //导入依赖的package包/类
@Override
public void queueEvent(FacesEvent e)
{
if ((e instanceof PollEvent) && (e.getSource() == this))
{
if (isImmediate())
{
e.setPhaseId(PhaseId.ANY_PHASE);
}
else
{
e.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
}
super.queueEvent(e);
}
示例12: processFacetsAndChildren
import javax.faces.event.PhaseId; //导入依赖的package包/类
@Override
protected void processFacetsAndChildren(
FacesContext context,
PhaseId phaseId)
{
Object oldPath = getRowKey();
try
{
Object focusPath = getFocusRowKey();
setRowKey(focusPath);
// process stamp for one level
HierarchyUtils.__processLevel(context, phaseId, this);
}
finally
{
setRowKey(oldPath);
}
// process the children
TableUtils.__processChildren(context, this, phaseId);
}
示例13: processFacetsAndChildren
import javax.faces.event.PhaseId; //导入依赖的package包/类
@Override
protected void processFacetsAndChildren(
FacesContext context,
PhaseId phaseId)
{
Object oldPath = getRowKey();
try
{
HierarchyUtils.__setStartDepthPath(this, getLevel());
// process stamp for one level
HierarchyUtils.__processLevel(context, phaseId, this);
}
finally
{
setRowKey(oldPath);
}
// process the children
TableUtils.__processChildren(context, this, phaseId);
}
示例14: queueEvent
import javax.faces.event.PhaseId; //导入依赖的package包/类
/**
* * We don't want to update model if we have validation errors
* on the page, so if not immediate, queue the event in
* INVOKE_APPLICATION phase.
*/
@Override
public void queueEvent(FacesEvent e)
{
if ((e instanceof RangeChangeEvent) && (e.getSource() == this))
{
if (isImmediate())
{
e.setPhaseId(PhaseId.ANY_PHASE);
}
else
{
e.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
}
super.queueEvent(e);
}
示例15: processFacetsAndChildren
import javax.faces.event.PhaseId; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected void processFacetsAndChildren(
FacesContext context,
PhaseId phaseId)
{
// this component has no facets that need to be processed once.
// instead process the "nodeStamp" facet as many times as necessary:
Object oldPath = getRowKey();
try
{
HierarchyUtils.__setStartDepthPath(this, getStartLevel());
HierarchyUtils.__iterateOverTree(context,
phaseId,
this,
getDisclosedRowKeys(),
true);
}
finally
{
setRowKey(oldPath);
}
}