本文整理匯總了Java中javax.faces.component.UIComponent.getFamily方法的典型用法代碼示例。如果您正苦於以下問題:Java UIComponent.getFamily方法的具體用法?Java UIComponent.getFamily怎麽用?Java UIComponent.getFamily使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.faces.component.UIComponent
的用法示例。
在下文中一共展示了UIComponent.getFamily方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: _needsTableTag
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
private boolean _needsTableTag(
UIComponent component)
{
// Find the first content-generating parent
UIComponent parent = XhtmlUtils.getStructuralParent(component);
if (parent == null)
return true;
// =-=AEW We should review this code.
// Either the parent should mark down that it rendered
// a table, or we should lean on the ResponseWriter
// to tell us if a table had been used.
// Hardcoding some packages 'cause I need this code to change!
String family = parent.getFamily();
if (HtmlTableLayout.COMPONENT_FAMILY.equals(family))
{
return false;
}
return true;
}
示例2: startElement
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
public void startElement(String name, UIComponent component) throws IOException
{
if ((component != null) && (_lastComponentStarted != component))
{
String componentAsString = component.getFamily();
String id = component.getId();
if (id != null)
{
componentAsString = componentAsString + "[\"" + id + "\"]";
}
writeComment("Start: " + componentAsString);
_lastComponentStarted = component;
}
super.startElement(name, component);
_inElement = true;
_elementStack.push(name);
_attributes.clear();
}
示例3: getRendererClientId
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
* Returns the clientId used by the renderer in place of the clientId used by the component.
* Certain renderers render their root element with a clientId that differs from the one
* used by the component.
* @param context FacesContent.
* @param component UIComponent.
* @return component clientId if the renderer clientId is null. Otherwise clientId used by
* renderer.
*/
public static String getRendererClientId(
FacesContext context,
UIComponent component)
{
String clientId = component.getClientId(context);
String family = component.getFamily();
String rendererType = component.getRendererType();
if (rendererType != null)
{
Renderer renderer = context.getRenderKit().getRenderer(family, rendererType);
if (renderer instanceof CoreRenderer)
{
CoreRenderer coreRenderer = (CoreRenderer) renderer;
String rendererClientId = coreRenderer.getClientId(context, component);
return rendererClientId == null ? clientId : rendererClientId;
}
}
return clientId;
}
示例4: _getRenderer
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
* Helper method to return a <code>Renderer</code> instance for a given <code>UIComponent</code>
* object.
* @param context the <code>FacesContext</code> for the request we currently processing
* @param component the child component
* @return <code>Renderer</code> for the given <code>UIComponent</code>.
*/
private Renderer _getRenderer(
FacesContext context,
UIComponent component)
{
// =-= AEW Might consider altering the following approach of getting the
// child renderer in case anyone wants to use renderer decoration.
String family = component.getFamily();
String rendererType = component.getRendererType();
if (rendererType == null)
return null;
else
return context.getRenderKit().getRenderer(family, rendererType);
}
示例5: _isParentPanelForm
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
private boolean _isParentPanelForm(
FacesContext context,
UIComponent component)
{
if (PanelFormLayoutRenderer.__isInPanelFormLayout(context, component))
{
return true;
}
// We must know if the immediate parent is a PanelForm because if there is
// even just one other component inbetween this component and a PanelForm,
// we must render different DOM--the same DOM as if there were no parent
// PanelForm.
UIComponent parentComponent = component.getParent();
String family = parentComponent.getFamily();
// FIXME: OK... This is another strong coupling
// We could add a an interface instead like ComponentHolder or something
// instead of checking against a specific component family.
while (UIXGroup.COMPONENT_FAMILY.equals(family))
{
// Special case:
// Since UIXGroup components are purely organizational, it is valid to
// have them inbetween panelForm-friendly components and the panelForm,
// so we need to look further up the chain:
parentComponent = parentComponent.getParent();
if (parentComponent == null)
{
return false;
}
family = parentComponent.getFamily();
}
if (UIXPanel.COMPONENT_FAMILY.equals(family))
{
String rendererType = parentComponent.getRendererType();
if (_isFormRendererType(rendererType))
return true;
}
return false;
}