本文整理匯總了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);
}
}