public static String getComponentLabel(UIComponent uiComponent) { String componentLabel = null; if (uiComponent != null) { componentLabel = getParentFieldLabelValue(uiComponent); if (componentLabel == null) { componentLabel = getSiblingLabelValue((uiComponent)); } } return componentLabel; }
public static String getComponentLabel(UIComponent uiComponent) { String componentLabel = null; if (uiComponent != null) { componentLabel = getParentFieldLabelValue(uiComponent); if (componentLabel == null) { componentLabel = getSiblingLabelValue((uiComponent)); } } return componentLabel; }
public static String getComponentLabel(UIComponent uiComponent) { String componentLabel = null; if (uiComponent != null) { componentLabel = getParentFieldLabelValue(uiComponent); if (componentLabel == null) { componentLabel = getSiblingLabelValue((uiComponent)); } } return componentLabel; }
private static String getParentFieldLabelValue(UIComponent uiComponent) { String parentFieldLabel = null; if (uiComponent != null) { UIComponent parent = uiComponent.getParent(); if (parent != null) { Method method = null; try { method = parent.getClass().getMethod("getLabel", (Class<?>[]) null); } catch (NoSuchMethodException e) { // ignore } if (method != null) { try { parentFieldLabel = (String) method.invoke(parent, (Object[]) null); } catch (Exception e) { // ignore } } else { parentFieldLabel = getParentFieldLabelValue(parent); } } } return parentFieldLabel; }
private static String getParentFieldLabelValue(UIComponent uiComponent) { String parentFieldLabel = null; if (uiComponent != null) { UIComponent parent = uiComponent.getParent(); if (parent != null) { Method method = null; try { method = parent.getClass().getMethod("getLabel", (Class<?>[]) null); } catch (NoSuchMethodException e) { // ignore } if (method != null) { try { parentFieldLabel = (String) method.invoke(parent, (Object[]) null); } catch (Exception e) { // ignore } } else { parentFieldLabel = getParentFieldLabelValue(parent); } } } return parentFieldLabel; }
private static String getParentFieldLabelValue(UIComponent uiComponent) { String parentFieldLabel = null; if (uiComponent != null) { UIComponent parent = uiComponent.getParent(); if (parent != null) { Method method = null; try { method = parent.getClass().getMethod("getLabel", (Class<?>[]) null); } catch (NoSuchMethodException e) { // ignore } if (method != null) { try { parentFieldLabel = (String) method.invoke(parent, (Object[]) null); } catch (Exception e) { // ignore } } else { parentFieldLabel = getParentFieldLabelValue(parent); } } } return parentFieldLabel; }