Java Code Examples for javax.faces.component.UIComponent

The following are top voted examples for showing how to use javax.faces.component.UIComponent. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: myfaces-trinidad   File: SimpleSelectOneChoiceRenderer.java   View source code 7 votes vote down vote up
/**
 * In Internet Explorer, handle autosubmit.
 */
@Override
protected String getOnblur(
  UIComponent component,
  FacesBean   bean)
{
  RenderingContext rc = RenderingContext.getCurrentInstance();
  String onblur = super.getOnblur(component, bean);

  //PH: onblur should be included only for desktop IE since PIE and
  //IE mobile do not support onblur on a select component
  if (isIE(rc) &&  isDesktop(rc) && isAutoSubmit(component, bean))
  {
    String auto = getAutoSubmitScript(rc, component, bean);
    // See getOnclick()
    auto = _IE_ACTION_HANDLER_PREFIX + auto;
    onblur = XhtmlUtils.getChainedJS(onblur, auto, true);
  }

  return onblur;
}
 
Example 2
Project: myfaces-trinidad   File: HiddenLabelUtils.java   View source code 6 votes vote down vote up
/**
 * Outputs a hidden label.
 * @param component 
 */
static public void outputHiddenLabel(
  UIXRenderingContext context,
  String           id,
  Object           text, 
  UIComponent component
  ) throws IOException
{
  if (!XhtmlLafRenderer.isInaccessibleMode(context) &&
      (text != null) &&
      (id   != null))
  {
    if (!id.equals(context.getProperty(UIConstants.MARLIN_NAMESPACE,
                                       _LABEL_KEY)))
    {
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement("label", component);
      writer.writeAttribute("for", id, null);
      XhtmlLafRenderer.renderStyleClassAttribute(context,
                                                 _HIDDEN_LABEL_CLASS);
      writer.writeText(text, null);
      writer.endElement("label");
    }
  }
}
 
Example 3
Project: oscm   File: ManageOperatorRevenueShareCtrlTest.java   View source code 6 votes vote down vote up
@Test
public void templateChanged_toSameValue() {
    // given
    ValueChangeEvent event = new ValueChangeEvent(mock(UIComponent.class),
            Long.valueOf(101L), Long.valueOf(101L));
    ManageOperatorRevenueShareModel model = new ManageOperatorRevenueShareModel();
    model.setSelectedTemplateKey(101L);
    ctrl.setModel(spy(model));

    // when
    ctrl.templateChanged(event);

    // then
    assertEquals(101L, ctrl.getModel().getSelectedTemplateKey());
    verify(ctrl.getModel(), times(0)).setSelectedTemplateKey(eq(101L));
}
 
Example 4
Project: ctsms   File: IDVOConverter.java   View source code 6 votes vote down vote up
@Override
public String getAsString(FacesContext facesContext, UIComponent component, Object value) {
	if (value == null) {
		return CommonUtil.NO_SELECTION_VALUE;
	} else if (value instanceof String) {
		if (CommonUtil.NO_SELECTION_VALUE.equals(value)) {
			return CommonUtil.NO_SELECTION_VALUE;
		} else {
			return WebUtil.stringToLong((String) value).toString();
		}
	} else if (value instanceof IDVO) {
		return ((IDVO) value).getId().toString();
	} else {
		return CommonUtil.NO_SELECTION_VALUE;
	}
}
 
Example 5
Project: ol3jsf   File: InputVectorLayer.java   View source code 6 votes vote down vote up
@Override
public void encodeAll(FacesContext context) throws IOException {
	ResponseWriter writer = context.getResponseWriter();
	String features = ComponentUtils.getValueToRender(context, this);
	UIComponent parent = this;

	while (!(parent instanceof Map)) {
		parent = parent.getParent();
	}

	Map mapComponent = (Map) parent;
	String mapVar = mapComponent.getJsVariable();

	if (features == null || features.length() == 0) {
		features = "[]";
	}

	writer.write("var vector = new ol.layer.Vector({" + "  source: new ol.source.Vector(), " + "  style: new ol.style.Style({" + "	   fill: new ol.style.Fill({"
			+ "	     color: 'rgba(50,30,230, 0.3)'" + "	   })," + "	   stroke: new ol.style.Stroke({" + "	     color: 'rgba(50,25,180, 1)'," + "		 width: 2" + "	   })" + "  })" + "});\n");

	writer.write(mapVar + ".addLayer(vector);\n");
	writer.write("vector.getSource().addFeatures(" + features + ");\n");
}
 
Example 6
Project: myfaces-trinidad   File: CoreRenderer.java   View source code 6 votes vote down vote up
/**
 * <p>
 * Called when visiting the CoreRenderer's component during optimized partial page encoding so
 * that the CoreRenderer can modify what is actually encoded.  For example tab controls often
 * render the tabs for the ShowDetailItems in the tab bar before delegating to the
 * disclosed ShowDetailItem to render the tab content.  As a result, the tab control
 * needs to encode its tab bar if any of its ShowDetailItems are partial targets so that
 * the tab labels, for example, are up-to-date.
 * </p>
 * <p>
 * The default implementation calls the VisitCallback and returns its result if this UIXComponent
 * is a partial target of the current encoding.
 * </p>
 * @param visitContext VisitContext to pass to the VisitCallback
 * @param partialContext PartialPageContext for the current partial encoding
 * @param component The component for the CoreRenderer to visit
 * @param callback VisitCallback to call if this component is a partial target
 * @return The VisitResult controlling continued iteration of the visit.
 */
public VisitResult partialEncodeVisit(
  VisitContext       visitContext,
  PartialPageContext partialContext,
  UIComponent        component,
  VisitCallback      callback)
{
  if (partialContext.isPossiblePartialTarget(component.getId()) &&
      partialContext.isPartialTarget(component.getClientId(visitContext.getFacesContext())))
  {
    // visit the component instance
    return callback.visit(visitContext, component);
  }
  else
  {
    // Not visiting this component, but allow visit to
    // continue into this subtree in case we've got
    // visit targets there.
    return VisitResult.ACCEPT;
  }
}
 
Example 7
Project: myfaces-trinidad   File: ColumnGroupRenderer.java   View source code 6 votes vote down vote up
/**
 * @return the state of the sorting after the page submition
 */
private String findSortState(
  int         sortability,
  UIComponent component,
  FacesBean   bean)
{
  String state;
  if (sortability == SORT_ASCENDING)
  {
    state = XhtmlConstants.SORTABLE_ASCENDING;
  }
  else if (sortability == SORT_DESCENDING)
  {
    state = XhtmlConstants.SORTABLE_DESCENDING;
  }
  else if ("descending".equals(getDefaultSortOrder(component, bean)))
  {
    state = XhtmlConstants.SORTABLE_ASCENDING;
  }
  else
  {
    state = "";
  }

  return state;
}
 
Example 8
Project: myfaces-trinidad   File: MediaRenderer.java   View source code 6 votes vote down vote up
/**
 * Returns the lowercase extension of any source URL
 */
private String _getSourceExtension(
  UIComponent component,
  FacesBean   bean)
{
  String sourceURLString = getSource(component, bean);

  if (sourceURLString != null)
  {
    int extensionIndex = sourceURLString.lastIndexOf('.');

    if ((extensionIndex != -1) &&
        (extensionIndex != sourceURLString.length() -1))
    {
      return sourceURLString.substring(extensionIndex + 1).toLowerCase();
    }
  }

  // no extension
  return null;
}
 
Example 9
Project: myfaces-trinidad   File: ColumnGroupRenderer.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void _renderChildren(
  FacesContext context,
  UIComponent  component,
  NodeData     parentNode
  ) throws IOException
{
  int i = 0;
  for(UIComponent child : (List<UIComponent>)component.getChildren())
  {
    if (child.isRendered())
    {
      // Tell the parent node - if there is one - which child we're rendering
      if (parentNode != null)
      {
        parentNode.currentChild = i;
      }

      encodeChild(context, child);
    }

    i++;
  }
}
 
Example 10
Project: oscm   File: LongValidator.java   View source code 6 votes vote down vote up
/**
 * Parses the specified string into a long integer.
 * 
 * @param context
 *            FacesContext for the request we are processing
 * @param component
 *            UIComponent we are checking for correctness
 * @param value
 *            the value to parse
 * @throws ValidatorException
 *             if the specified string could not be parsed into a valid long
 *             integer.
 */
public static long parse(FacesContext context, UIComponent uiComponent,
        String value) throws ValidatorException {
    if (!GenericValidator.isLong(value)) {
        Object[] args = null;
        String label = JSFUtils.getLabel(uiComponent);
        if (label != null) {
            args = new Object[] { label };
        }
        ValidationException e = new ValidationException(
                ValidationException.ReasonEnum.LONG, label, null);
        String message = JSFUtils.getText(e.getMessageKey(), args, context);
        throw getException(message);
    }
    return Long.parseLong(value);
}
 
Example 11
Project: myfaces-trinidad   File: NumberConverter.java   View source code 6 votes vote down vote up
private String _getTrNumberConverter(
  FacesContext context,
  UIComponent  component,
  Map<?, ?>    messages)
{
  StringBuilder outBuffer = new StringBuilder(250);
  outBuffer.append("new TrNumberConverter(");

  Object[] params = _getClientConstructorParams(context, messages);
  for (int i = 0; i < params.length; i++)
  {
    try
    {
      JsonUtils.writeObject(outBuffer, params[i], false); 
    } 
    catch (Exception e)
    {
      outBuffer.append("null");
    }
    if (i < params.length-1)
      outBuffer.append(',');
  }
  outBuffer.append(')');
  return outBuffer.toString();
}
 
Example 12
Project: myfaces-trinidad   File: UIXEditableValueTemplate.java   View source code 6 votes vote down vote up
/**
 * Executes validation logic.
 */
private void _executeValidate(FacesContext context)
{
  Application application = context.getApplication();
  application.publishEvent(context, PreValidateEvent.class, UIComponent.class, this);
  try
  {
    validate(context);
  }
  catch (RuntimeException e)
  {
    context.renderResponse();
    throw e;
  }
  finally
  {
    application.publishEvent(context, PostValidateEvent.class, UIComponent.class, this);
  }

  if (!isValid())
  {
    context.renderResponse();
  }
}
 
Example 13
Project: myfaces-trinidad   File: ChangeBean.java   View source code 6 votes vote down vote up
/**
 * Removes a pair of children, based on some characteristic of the
 *  event source.
 */
public void removeChildren(ActionEvent event)
{
  UIComponent eventSource = event.getComponent();
  UIComponent uic = eventSource.findComponent("pg1");
  int numChildren = uic.getChildCount();
  if (numChildren == 0)
    return;
  String eventSourceId = eventSource.getId();    
  if (eventSourceId.equals("cb2"))
  {
    _removeChild(uic, "sic1");
    _removeChild(uic, "cc1");
  }
  else if (eventSourceId.equals("cb3"))
  {
    _removeChild(uic, "cd1");
    _removeChild(uic, "sid1");
  }
}
 
Example 14
Project: myfaces-trinidad   File: IconRenderer.java   View source code 6 votes vote down vote up
private Map<String, Object> _getNodeAttributeMap(
  FacesContext context,
  UIComponent  comp,
  FacesBean    bean,
  boolean      embed)
{
  Map<String, Object> attrs = null;
  attrs = new ArrayMap<String, Object>(1);

  attrs.put(Icon.SHORT_DESC_KEY, getShortDesc(comp, bean));
  attrs.put(Icon.STYLE_CLASS_KEY, getStyleClass(comp, bean));

  if (embed)
  {
    attrs.put(Icon.EMBEDDED_KEY, Boolean.TRUE);
  }
  else
  {
    attrs.put(Icon.ID_KEY, getClientId(context, comp));
  }

  return attrs;
}
 
Example 15
Project: myfaces-trinidad   File: SeparatorRenderer.java   View source code 6 votes vote down vote up
@Override
protected void renderAllAttributes(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  ResponseWriter rw = context.getResponseWriter();

  renderAllAttributes(context, rc, component, bean, false);
  renderStyleAttributes(context, rc, component, bean);

  // Old PDA renderer rule
  if (isPDA(rc))
    rw.writeAttribute("size", "1", null);
}
 
Example 16
Project: myfaces-trinidad   File: DesktopPanelPageHeaderRenderer.java   View source code 6 votes vote down vote up
@Override
protected void encodeAll(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{

 // =-=AEW We don't have any real agent switching
  if (!isDesktop(rc))
  {
    delegateRenderer(context, rc, component, bean, _pdaRenderer);
  }
  else
  {
    encodeAllDesktop(context, rc, component, bean);
  }

}
 
Example 17
Project: oscm   File: JSFUtils.java   View source code 6 votes vote down vote up
/**
 * Reset the values of all UIInput children. This might be necessary after a
 * validation error to successfully process an AJAX request. See [Bug 5449]
 * and http://wiki.apache.org/myfaces/ClearInputComponents
 * 
 * @param uiComponent
 *            the root component to be processed.
 */
public static void resetUIInputChildren(UIComponent uiComponent) {
    if (uiComponent != null) {
        List<UIComponent> children = uiComponent.getChildren();
        for (UIComponent child : children) {
            if (child instanceof UIInput) {
                UIInput uiInput = (UIInput) child;
                uiInput.setSubmittedValue(null);
                uiInput.setValue(null);
                uiInput.setLocalValueSet(false);
            } else {
                resetUIInputChildren(child);
            }
        }
    }
}
 
Example 18
Project: myfaces-trinidad   File: DoubleConverter.java   View source code 6 votes vote down vote up
@Override
public Object getAsObject(
  FacesContext context, 
  UIComponent component,
  String value) 
{
  try
  {
    return super.getAsObject(context, component, value);
  }
  catch(ConverterException ce)
  {
    throw ConverterUtils.createConverterException(context, 
                                                       component,
                                                       CONVERT_MESSAGE_ID, 
                                                       value);                                                      
  }     
  
}
 
Example 19
Project: myfaces-trinidad   File: UIXNavigationLevelTemplate.java   View source code 6 votes vote down vote up
private boolean _visitChildrenIterating(
  VisitContext  visitContext,
  VisitCallback callback)
{
  boolean done = visitData(visitContext, callback);

  if (!done)
  {
    // process the children
    int childCount = getChildCount();
    if (childCount > 0)
    {
      for (UIComponent child : getChildren())
      {
        done = UIXComponent.visitTree(visitContext, child, callback);

        if (done)
          break;
      }
    }
  }

  return done;
}
 
Example 20
Project: myfaces-trinidad   File: ShowOneUtils.java   View source code 6 votes vote down vote up
/**
 *  Creates encoded partial targets for UIComponent.
 *  Adds the compId to the list of partial targets available in component
 *  attribute map.
 *
 * @param component the UIComponent object
 * @param compId the id to be added to already available partial targets
 * @return String encoded partialTarget string
 */
static String getEncodedPartialTargets(UIComponent component, String compId)
{
  String[] pprTargets =
    (String []) component.getAttributes().get("partialTargets");
  String encodedPartialTargets = null;
  if ( (pprTargets != null) && (pprTargets.length > 0)  )
  {
    String[] pprTargetsNew = new String[pprTargets.length + 1];
    System.arraycopy(pprTargets, 0, pprTargetsNew, 0, pprTargets.length);
    pprTargetsNew[pprTargets.length] = compId;
    encodedPartialTargets =
      PartialPageRendererUtils.encodePartialTargets(pprTargetsNew);
  }
  else
  {
    encodedPartialTargets =
      PartialPageRendererUtils.encodePartialTargets(new String[] {compId});
  }
  return encodedPartialTargets;
}
 
Example 21
Project: myfaces-trinidad   File: OutputLabelRenderer.java   View source code 5 votes vote down vote up
protected boolean getShowRequired(
  UIComponent component,
  FacesBean   bean)
{
  Object o = bean.getProperty(_showRequiredKey);
  if (o == null)
    o = _showRequiredKey.getDefault();

  return Boolean.TRUE.equals(o);
}
 
Example 22
Project: myfaces-trinidad   File: NavigationPaneRenderer.java   View source code 5 votes vote down vote up
protected boolean getDisabled(
  UIComponent component,
  FacesBean   bean)
{
  Object o = bean.getProperty(_disabledKey);
  if (o == null)
    o = _disabledKey.getDefault();
  return Boolean.TRUE.equals(o);
}
 
Example 23
Project: myfaces-trinidad   File: PanelBorderLayoutRenderer.java   View source code 5 votes vote down vote up
protected String getEndWidth(
  UIComponent component,
  FacesBean   bean)
{
  return ComponentUtils.resolveString(bean.getProperty(_endWidthKey),
           (String)_endWidthKey.getDefault());
}
 
Example 24
Project: myfaces-trinidad   File: CellFormatRenderer.java   View source code 5 votes vote down vote up
@Override
protected void encodeAll(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  ResponseWriter rw = context.getResponseWriter();
  String element = isHeader(component, bean) ? "th" : "td";

  rw.startElement(element, component);
  renderId(context, component);
  renderAllAttributes(context, rc, component, bean);
  renderHAlign(context, rc, getHalign(component, bean));
  rw.writeAttribute("valign", getValign(component, bean), "valign");
  rw.writeAttribute("abbr", getShortText(component, bean), "shortText");
  rw.writeAttribute("headers", getHeaders(component, bean), "headers");
  rw.writeAttribute("width", getWidth(component, bean), "width");
  rw.writeAttribute("height", getHeight(component, bean), "height");

  int colspan = getColumnSpan(component, bean);
  if (colspan > 1)
    rw.writeAttribute("colspan", colspan, "columnSpan");
  int rowspan = getRowSpan(component, bean);
  if (rowspan > 1)
    rw.writeAttribute("rowspan", rowspan, "rowSpan");
  if (isWrappingDisabled(component, bean))
  {
    // On PDA browser where the width is limited, nowrap will not be set.
    if (isDesktop(rc))
    {
      rw.writeAttribute("nowrap", Boolean.TRUE, "wrappingDisabled");
    }
  }

  encodeAllChildren(context, component);

  rw.endElement(element);
}
 
Example 25
Project: myfaces-trinidad   File: XhtmlUtils.java   View source code 5 votes vote down vote up
/**
 * Skip over pure iteration components to find a "structural" parent.
 * This code is not guaranteed to work, but will work well enough.
 * @return a structural parent, or null if none exists
 */
static public UIComponent getStructuralParent(UIComponent component)
{
  while (true)
  {
    component = component.getParent();
    if (component == null)
      return null;

    if (_NON_STRUCTURAL_COMPONENT_FAMILIES.contains(component.getFamily()))
      continue;

    return component;
  }
}
 
Example 26
Project: myfaces-trinidad   File: SimpleInputTextRenderer.java   View source code 5 votes vote down vote up
@Override
protected String getOnchange(
  UIComponent component,
  FacesBean   bean)
{
  String onchange = super.getOnchange(component, bean);
  if (isAutoSubmit(component, bean))
  {
    RenderingContext rc = RenderingContext.getCurrentInstance();
    String source = LabelAndMessageRenderer.__getCachedClientId(rc);
    boolean immediate = isImmediate(component, bean);
    String auto = AutoSubmitUtils.getSubmitScript(rc, source, XhtmlConstants.AUTOSUBMIT_EVENT,
                    immediate);
    if (onchange == null)
      onchange = auto;
    else if (auto != null)
      onchange = XhtmlUtils.getChainedJS(onchange, auto, true);
  }

  if (isTextArea(component, bean))
  {
    Number maxLength = getMaximumLength(component, bean);
    if (maxLength != null && maxLength.intValue()> 0)
    {
      onchange = _getMaxLengthFunction(onchange,
                                       maxLength.intValue());
    }
  }

  return onchange;
}
 
Example 27
Project: myfaces-trinidad   File: SimpleSelectOneListboxRenderer.java   View source code 5 votes vote down vote up
@Override
protected String getUnselectedLabel(
  UIComponent component,
  FacesBean   bean)
{
  return toString(bean.getProperty(_unselectedLabelKey));
}
 
Example 28
Project: myfaces-trinidad   File: SimpleInputFileRenderer.java   View source code 5 votes vote down vote up
@Override
protected Object getSubmittedValue(
  FacesContext context,
  UIComponent  component,
  String       clientId)
{
  // Since we override getSubmittedValue() entirely,
  // detect auto submit manually
  detectAutoSubmit(context, component, clientId);

  Object result = null;
  UploadedFile file = null;

  UploadedFiles files = UploadedFiles.getUploadedFiles(context);
  if (files != null)
  {
    file = files.getUploadedFile(clientId);
  }

  // If we couldn't find a file (e.g. does not exist OR the file is empty),
  // return "FALSE" to indicate that...
  // the file upload *was* available, but didn't upload a file
  // this time.
  if (file == null || file.getLength() == 0)
    result = Boolean.FALSE;
  else
    result = file;

  return result;
}
 
Example 29
Project: myfaces-trinidad   File: InputLabelAndMessageRenderer.java   View source code 5 votes vote down vote up
@Override
protected void renderFieldCellContents(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  delegateRenderer(context, rc, component, bean, getFormInputRenderer());
}
 
Example 30
Project: myfaces-trinidad   File: TreeRenderer.java   View source code 5 votes vote down vote up
@Override
protected void encodeAll(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  // Since Train is a naming container, we can be more
  // efficient about skipping its children
  if (!PartialPageUtils.containsPprTargets(rc,
                                           component,
                                           getClientId(context, component)))
  {
    return;
  }

  UIXHierarchy tree = (UIXHierarchy) component;
  TreeUtils.expandFocusRowKey((UIXTree) component);

  Object oldPath = tree.getRowKey();
  try
  {
    boolean continueRendering = setInitialPath(tree, bean);
    if (!continueRendering)
      return;

    _renderContent(context, rc, tree, bean);
  }
  finally
  {
    tree.setRowKey(oldPath);
  }
}
 
Example 31
Project: myfaces-trinidad   File: FormInputRenderer.java   View source code 5 votes vote down vote up
protected void renderDisabledAttribute(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{

  if (getDisabled(component, bean))
  {
    context.getResponseWriter().writeAttribute("disabled",
                                               Boolean.TRUE,
                                               "disabled");
  }
}
 
Example 32
Project: myfaces-trinidad   File: LabelAndMessageRenderer.java   View source code 5 votes vote down vote up
@Override
protected String getForId(
  FacesContext context,
  UIComponent  component,
  FacesBean    bean)
{
  return getLabelFor(context,
                     RenderingContext.getCurrentInstance(),
                     component,
                     bean);
}
 
Example 33
Project: myfaces-trinidad   File: PanelBorderLayoutRenderer.java   View source code 5 votes vote down vote up
/**
 * @see org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#getDefaultStyleClass
 */
@Override
protected String getDefaultStyleClass(
  UIComponent component,
  FacesBean   bean)
{
  return "positioned".equals(getLayout(component, bean)) ?
    SkinSelectors.AF_PANEL_BORDER_POSITIONED_ROOT_STYLE_CLASS : null;
}
 
Example 34
Project: myfaces-trinidad   File: DetailColumnRenderer.java   View source code 5 votes vote down vote up
@Override
protected boolean getNoWrap(
  UIComponent component,
  FacesBean   bean)
{
  return true;
}
 
Example 35
Project: myfaces-trinidad   File: FastRenderer2.java   View source code 5 votes vote down vote up
protected int getTruncateAt(
  UIComponent  component,
  FacesBean    bean)
{
  Object o = bean.getProperty(_truncateAtKey);
  if (o == null)
    o = _truncateAtKey.getDefault();

  assert(o != null);
  return ((Number) o).intValue();
}
 
Example 36
Project: oscm   File: PSPConverter.java   View source code 5 votes vote down vote up
@Override
public Object getAsObject(FacesContext context, UIComponent component,
                          String value) {
    VOPSP retVal = null;
    for (VOPSP vopsp : oob.getPSPs()) {
        if ((Long.valueOf(vopsp.getKey()).toString().equals(value))) {
            retVal = vopsp;
        }
    }
    return retVal;
}
 
Example 37
Project: myfaces-trinidad   File: SingleStepButtonBarRenderer.java   View source code 5 votes vote down vote up
@Override
protected boolean getImmediate(
  UIComponent component,
  FacesBean   bean)
{
  return !_next;
}
 
Example 38
Project: myfaces-trinidad   File: OutputLabelRenderer.java   View source code 5 votes vote down vote up
protected boolean isLabelTagNeeded(
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean,
  String           forId,
  int              accessKeyIndex
)
{
  return (((forId != null) &&
          !isInaccessibleMode(rc)) ||
          (accessKeyIndex >= 0));
}
 
Example 39
Project: oscm   File: DurationConverterTest.java   View source code 5 votes vote down vote up
@Test
public void testGetAsStringEmpty() {
    UIComponent component = ConverterTestHelper.getComponent(false, null,
            null, "duration");
    String result = converter.getAsString(context, component, "");
    Assert.assertNull(result);
}
 
Example 40
Project: myfaces-trinidad   File: SelectManyShuttleRenderer.java   View source code 5 votes vote down vote up
@Override
protected boolean getReadOnly(
  FacesContext context,
  UIComponent  component,
  FacesBean    bean)
{
  return false;
}