本文整理匯總了Java中javax.faces.component.UIComponent.getValueBinding方法的典型用法代碼示例。如果您正苦於以下問題:Java UIComponent.getValueBinding方法的具體用法?Java UIComponent.getValueBinding怎麽用?Java UIComponent.getValueBinding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.faces.component.UIComponent
的用法示例。
在下文中一共展示了UIComponent.getValueBinding方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: _getLabel
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
private static final Object _getLabel(
UIComponent component
)
{
Object o = component.getAttributes().get("label");
if (o == null)
o = component.getValueBinding("label");
return o;
}
示例2: getComponentLabel
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
static Object getComponentLabel(UIComponent component)
{
Object label = component.getAttributes().get("label");
if ( null == label)
label = component.getValueBinding("label");
return label;
}
示例3: getAttributes
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
public List<PropertyOfComponent> getAttributes()
{
if (_list != null)
return _list;
UIComponent comp = getComponent();
if (comp == null)
return null;
List<PropertyOfComponent> list = new ArrayList<PropertyOfComponent>();
try
{
BeanInfo beanInfo = Introspector.getBeanInfo(comp.getClass());
PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
for (int i = 0; i < descriptors.length; i++)
{
PropertyDescriptor descriptor = descriptors[i];
// "Write-only" properties - no go
if (descriptor.getReadMethod() == null)
continue;
PropertyOfComponent poc = null;
boolean readOnly = descriptor.getWriteMethod() == null;
if (readOnly)
continue;
// For now, skip any attributes with ValueBindings
String name = descriptor.getName();
if (comp.getValueBinding(name) != null)
continue;
Class<?> type = descriptor.getPropertyType();
if ((type == String.class) ||
(type == Object.class))
{
if (!isJavascriptShown() &&
name.startsWith("on"))
continue;
poc = new StringProperty(comp, descriptor);
}
else if ((type == Integer.class) ||
(type == Integer.TYPE))
{
poc = new IntegerProperty(comp, descriptor);
}
else if ((type == Boolean.class) ||
(type == Boolean.TYPE))
{
poc = new BooleanProperty(comp, descriptor);
}
else if (type == Date.class)
{
poc = new DateProperty(comp, descriptor);
}
if (poc != null)
list.add(poc);
}
// Sort the list by property name
Collections.sort(list);
_list = list;
return list;
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}