當前位置: 首頁>>代碼示例>>Java>>正文


Java UIComponent.getValueBinding方法代碼示例

本文整理匯總了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;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:11,代碼來源:ConverterUtils.java

示例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;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:9,代碼來源:ValidatorUtils.java

示例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;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:77,代碼來源:ComponentEditorHandler.java


注:本文中的javax.faces.component.UIComponent.getValueBinding方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。