Java UIComponent类代码示例(javax.faces.component典型用法代码示例汇总)

本文整理汇总了Java中javax.faces.component.UIComponent的典型用法代码示例。如果您正苦于以下问题:Java UIComponent类的具体用法?Java UIComponent怎么用?Java UIComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Java UIComponent类代码示例(javax.faces.component典型用法代码示例汇总)

UIComponent类属于javax.faces.component包,在下文中一共展示了UIComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getOnblur

import javax.faces.component.UIComponent; //导入依赖的package包/类
/**
 * 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;
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:24,代码来源:SimpleSelectOneChoiceRenderer.java

示例2: outputHiddenLabel

import javax.faces.component.UIComponent; //导入依赖的package包/类
/**
 * 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");
    }
  }
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:29,代码来源:HiddenLabelUtils.java

示例3: templateChanged_toSameValue

import javax.faces.component.UIComponent; //导入依赖的package包/类
@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));
} 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:ManageOperatorRevenueShareCtrlTest.java

示例4: getAsString

import javax.faces.component.UIComponent; //导入依赖的package包/类
@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;
	}
} 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:17,代码来源:IDVOConverter.java

示例5: encodeAll

import javax.faces.component.UIComponent; //导入依赖的package包/类
@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");
} 
开发者ID:elielwaltrick,项目名称:ol3jsf,代码行数:24,代码来源:InputVectorLayer.java

示例6: partialEncodeVisit

import javax.faces.component.UIComponent; //导入依赖的package包/类
/**
 * <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;
  }
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:40,代码来源:CoreRenderer.java

示例7: findSortState

import javax.faces.component.UIComponent; //导入依赖的package包/类
/**
 * @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;
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:29,代码来源:ColumnGroupRenderer.java

示例8: _getSourceExtension

import javax.faces.component.UIComponent; //导入依赖的package包/类
/**
 * 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;
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:24,代码来源:MediaRenderer.java

示例9: _renderChildren

import javax.faces.component.UIComponent; //导入依赖的package包/类
@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++;
  }
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:25,代码来源:ColumnGroupRenderer.java

示例10: parse

import javax.faces.component.UIComponent; //导入依赖的package包/类
/**
 * 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);
} 
开发者ID:servicecatalog,项目名称:oscm,代码行数:29,代码来源:LongValidator.java

示例11: _getTrNumberConverter

import javax.faces.component.UIComponent; //导入依赖的package包/类
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();
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:26,代码来源:NumberConverter.java

示例12: _executeValidate

import javax.faces.component.UIComponent; //导入依赖的package包/类
/**
 * 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();
  }
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:27,代码来源:UIXEditableValueTemplate.java

示例13: removeChildren

import javax.faces.component.UIComponent; //导入依赖的package包/类
/**
 * 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");
  }
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:24,代码来源:ChangeBean.java

示例14: _getNodeAttributeMap

import javax.faces.component.UIComponent; //导入依赖的package包/类
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;
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:24,代码来源:IconRenderer.java

示例15: renderAllAttributes

import javax.faces.component.UIComponent; //导入依赖的package包/类
@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);
} 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:18,代码来源:SeparatorRenderer.java

本文标签属性:

示例:示例图

代码:代码大全可复制

java:java面试题

UIComponent:UIComponent

上一篇:Java AdapterView类代码示例(javaadapterview类代码示例汇总)
下一篇:C# CSharp.PredefinedAttributes类代码示例

为您推荐