Package com.liferay.faces.alloy.component.nodemenunav

Examples of com.liferay.faces.alloy.component.nodemenunav.NodeMenuNav


  }

  @Override
  public void encodeJavaScriptCustom(FacesContext facesContext, UIComponent uiComponent) throws IOException {

    NodeMenuNav nodeMenuNav = (NodeMenuNav) uiComponent;
    ResponseWriter responseWriter = facesContext.getResponseWriter();

    boolean disabled = nodeMenuNav.isDisabled();

    if (!disabled) {

      String escapedOptionsDivId = RendererUtil.escapeClientId(getDefaultOptionsId(facesContext, uiComponent) +
          StringPool.COLON + "0");
View Full Code Here


  }

  @Override
  public void encodeMarkupBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException {

    NodeMenuNav nodeMenuNav = (NodeMenuNav) uiComponent;
    ResponseWriter responseWriter = facesContext.getResponseWriter();

    String clientId = uiComponent.getClientId(facesContext);

    // start yui3-menu div
    responseWriter.startElement(StringPool.DIV, uiComponent);
    responseWriter.writeAttribute(StringPool.ID, clientId, StringPool.ID);
    responseWriter.writeAttribute(StringPool.CLASS, "yui3-menu yui3-menu-horizontal yui3-splitbuttonnav",
      StringPool.CLASS);

    // start yui3-menu-content div
    responseWriter.startElement(StringPool.DIV, uiComponent);
    responseWriter.writeAttribute(StringPool.CLASS, "yui3-menu-content", StringPool.CLASS);

    responseWriter.startElement(StringPool.UL, uiComponent);
    responseWriter.startElement(StringPool.LI, uiComponent);

    // Start the span containing the btn-group
    responseWriter.startElement(StringPool.SPAN, uiComponent);
    responseWriter.writeAttribute(StringPool.CLASS, "yui3-menu-label btn-group", StringPool.CLASS);

    // ResponseWriter blocks the text value and blocks writing of URIAttributes, if necessary
    boolean disabled = nodeMenuNav.isDisabled();
    String styleClass = nodeMenuNav.getStyleClass();
    DelegationResponseWriter delegationResponseWriter = new NodeMenuNavResponseWriter(responseWriter, disabled,
        uiComponent.getClientId(facesContext), styleClass);

    //J-
    // We have now written out something like this:
View Full Code Here

    // close the main anchor tag
    super.encodeMarkupEnd(facesContext, uiComponent);

    ResponseWriter responseWriter = facesContext.getResponseWriter();
    NodeMenuNav nodeMenuNav = (NodeMenuNav) uiComponent;
    boolean disabled = nodeMenuNav.isDisabled();
    String styleClass = nodeMenuNav.getStyleClass();
    String defaultOptionsDivId = getDefaultOptionsId(facesContext, uiComponent);

    responseWriter.startElement("a", uiComponent);
    responseWriter.writeAttribute(StringPool.CLASS, styleClass, StringPool.CLASS);
View Full Code Here

  @Override
  public void decode(FacesContext facesContext, UIComponent uiComponent) {

    if (hasMenu(uiComponent)) {
      NodeMenuNav nodeMenuNav = NodeMenuNavFactory.getNodeMenuNav(uiComponent);
      RenderKit renderKit = facesContext.getRenderKit();
      Renderer nodeMenuNavRenderer = renderKit.getRenderer(nodeMenuNav.getFamily(),
          nodeMenuNav.getRendererType());
      nodeMenuNavRenderer.decode(facesContext, (UIComponent) nodeMenuNav);
    }
    else {
      super.decode(facesContext, uiComponent);
    }
View Full Code Here

  @Override
  public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException {

    if (hasMenu(uiComponent)) {
      NodeMenuNav nodeMenuNav = NodeMenuNavFactory.getNodeMenuNav(uiComponent);
      RenderKit renderKit = facesContext.getRenderKit();
      Renderer nodeMenuNavRenderer = renderKit.getRenderer(nodeMenuNav.getFamily(),
          nodeMenuNav.getRendererType());
      nodeMenuNavRenderer.encodeBegin(facesContext, (UIComponent) nodeMenuNav);
    }
    else {

      ResponseWriter responseWriter = facesContext.getResponseWriter();
View Full Code Here

  @Override
  public void encodeChildren(FacesContext facesContext, UIComponent uiComponent) throws IOException {

    if (hasMenu(uiComponent)) {
      NodeMenuNav nodeMenuNav = NodeMenuNavFactory.getNodeMenuNav(uiComponent);
      RenderKit renderKit = facesContext.getRenderKit();
      Renderer nodeMenuNavRenderer = renderKit.getRenderer(nodeMenuNav.getFamily(),
          nodeMenuNav.getRendererType());
      nodeMenuNavRenderer.encodeChildren(facesContext, (UIComponent) nodeMenuNav);
    }
    else {
      ResponseWriter responseWriter = facesContext.getResponseWriter();
      FacesButton facesButton = (FacesButton) uiComponent;
View Full Code Here

  @Override
  public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {

    if (hasMenu(uiComponent)) {
      NodeMenuNav nodeMenuNav = NodeMenuNavFactory.getNodeMenuNav(uiComponent);
      RenderKit renderKit = facesContext.getRenderKit();
      Renderer nodeMenuNavRenderer = renderKit.getRenderer(nodeMenuNav.getFamily(),
          nodeMenuNav.getRendererType());
      nodeMenuNavRenderer.encodeEnd(facesContext, (UIComponent) nodeMenuNav);
    }
    else {

      ResponseWriter responseWriter = facesContext.getResponseWriter();
View Full Code Here

  @Override
  public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue)
    throws ConverterException {

    if (hasMenu(uiComponent)) {
      NodeMenuNav nodeMenuNav = NodeMenuNavFactory.getNodeMenuNav(uiComponent);
      RenderKit renderKit = facesContext.getRenderKit();
      Renderer nodeMenuNavRenderer = renderKit.getRenderer(nodeMenuNav.getFamily(),
          nodeMenuNav.getRendererType());

      return nodeMenuNavRenderer.getConvertedValue(facesContext, (UIComponent) nodeMenuNav, submittedValue);
    }
    else {
      return super.getConvertedValue(facesContext, uiComponent, submittedValue);
View Full Code Here

  protected static final class NodeMenuNavFactory {

    public static NodeMenuNav getNodeMenuNav(UIComponent uiComponent) {

      NodeMenuNav nodeMenuNav = null;

      String componentName = uiComponent.getClass().getName();

      if (componentName.endsWith("CommandButton")) {
        nodeMenuNav = new SplitCommandButton((CommandButton) uiComponent);
View Full Code Here

TOP

Related Classes of com.liferay.faces.alloy.component.nodemenunav.NodeMenuNav

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.