Package org.richfaces.component

Examples of org.richfaces.component.UIContextMenu


    return s == null || s.trim().length() == 0;
  }
 
  private void ensureParentPresent(UIComponent component) {
    UIComponent parent = component.getParent();
    UIContextMenu menu = (UIContextMenu) component;
   
    if (parent != null) {
      if (!HtmlUtil.shouldWriteId(parent) && menu.isAttached() && isEmpty(menu.getAttachTo())) {
        throw new FacesException(
            "Context menu cannot be attached to the component with id = "
            + parent.getId()
            + ", because a client identifier of the component won't be rendered onto the page. Please, set the identifier.");
      }
View Full Code Here


  }
 

  public void encodeChildren(FacesContext context, UIComponent component)
  throws IOException {
    UIContextMenu menu = (UIContextMenu) component;
    ResponseWriter writer = context.getResponseWriter();
   
    String event = menu.getEvent();
   
    if (event == null) {
      throw new FacesException("Attribute 'event' is not set for component " + component.getClientId(context));
    }
   
    writer.startElement("script", component);
    writer.writeText("var contextMenu = new Richfaces.ContextMenu('", null);
    writer.writeText(component.getClientId(context), null);
    writer.writeText("', ", null);
    writer.writeText(menu.getShowDelay() + ", ", null);
    writeScriptBody(context, component, true);
    writer.writeText(")", null);
    writer.writeText(";", null);
    writer.writeText(getClientAttachmentOptions(context, menu), null);
   
    if (menu.isDisableDefaultMenu()) {
      writer.writeText("Richfaces.disableDefaultHandler('", null);
      writer.writeText(event, null);
      writer.writeText("');", null);
    }
   
View Full Code Here

    return s == null || s.trim().length() == 0;
  }
 
  private void ensureParentPresent(UIComponent component) {
    UIComponent parent = component.getParent();
    UIContextMenu menu = (UIContextMenu) component;
   
    if (parent != null) {
      if (!HtmlUtil.shouldWriteId(parent) && menu.isAttached() && isEmpty(menu.getAttachTo())) {
        throw new FacesException(
            "Context menu cannot be attached to the component with id = "
            + parent.getId()
            + ", because a client identifier of the component won't be rendered onto the page. Please, set the identifier.");
      }
View Full Code Here

   * Perform validation of the contextMenu configuration.
   *
   * @param component - menu component
   */
  protected void checkAttachTimingValidity(FacesContext context, UIComponent component) {
    UIContextMenu menu = (UIContextMenu) component;
    String attachTiming = menu.getAttachTiming();
      if (!ON_LOAD.equals(attachTiming) && !IMMEDIATE.equals(attachTiming) && !ON_AVAILABLE.equals(attachTiming)) {
        context.getExternalContext().log(attachTiming + " value of attachTiming attribute is not a legal one for component: "
              + MessageUtil.getLabel(context, component)
              + ". Default value was applied.");
        menu.setAttachTiming(ON_AVAILABLE);
      }
  }
View Full Code Here

  }
 

  public void encodeChildren(FacesContext context, UIComponent component)
  throws IOException {
    UIContextMenu menu = (UIContextMenu) component;
    ResponseWriter writer = context.getResponseWriter();
   
    String event = menu.getEvent();
   
    if (event == null) {
      throw new FacesException("Attribute 'event' is not set for component " + component.getClientId(context));
    }
   
    writer.startElement("script", component);
    getUtils().writeAttribute(writer, "type", "text/javascript" );
    writer.writeText("var contextMenu = new Richfaces.ContextMenu('", null);
    writer.writeText(component.getClientId(context), null);
    writer.writeText("', ", null);
    writer.writeText(menu.getShowDelay() + ", ", null);
    writeScriptBody(context, component, true);
    writer.writeText(")", null);
    writer.writeText(";", null);
    writer.writeText(getClientAttachmentOptions(context, menu), null);
   
    if (menu.isDisableDefaultMenu()) {
      writer.writeText("Richfaces.disableDefaultHandler('", null);
      writer.writeText(event, null);
      writer.writeText("');", null);
    }
   
View Full Code Here

    return s == null || s.trim().length() == 0;
  }
 
  private void ensureParentPresent(UIComponent component) {
    UIComponent parent = component.getParent();
    UIContextMenu menu = (UIContextMenu) component;
   
    if (parent != null) {
      if (!HtmlUtil.shouldWriteId(parent) && menu.isAttached() && isEmpty(menu.getAttachTo())) {
        throw new FacesException(
            "Context menu cannot be attached to the component with id = "
            + parent.getId()
            + ", because a client identifier of the component won't be rendered onto the page. Please, set the identifier.");
      }
View Full Code Here

   * Perform validation of the contextMenu configuration.
   *
   * @param component - menu component
   */
  protected void checkAttachTimingValidity(FacesContext context, UIComponent component) {
    UIContextMenu menu = (UIContextMenu) component;
    String attachTiming = menu.getAttachTiming();
      if (!ON_LOAD.equals(attachTiming) && !IMMEDIATE.equals(attachTiming) && !ON_AVAILABLE.equals(attachTiming)) {
        context.getExternalContext().log(attachTiming + " value of attachTiming attribute is not a legal one for component: "
              + MessageUtil.getLabel(context, component)
              + ". Default value was applied.");
        menu.setAttachTiming(ON_AVAILABLE);
      }
  }
View Full Code Here

  }
 

  public void encodeChildren(FacesContext context, UIComponent component)
  throws IOException {
    UIContextMenu menu = (UIContextMenu) component;
    ResponseWriter writer = context.getResponseWriter();
   
    String event = menu.getEvent();
   
    if (event == null) {
      throw new FacesException("Attribute 'event' is not set for component " + component.getClientId(context));
    }
   
    writer.startElement("script", component);
    getUtils().writeAttribute(writer, "type", "text/javascript" );
    writer.writeText("var contextMenu = new Richfaces.ContextMenu('", null);
    writer.writeText(component.getClientId(context), null);
    writer.writeText("', ", null);
    writer.writeText(menu.getShowDelay() + ", ", null);
    writeScriptBody(context, component, true);
    writer.writeText(")", null);
    writer.writeText(";", null);
    writer.writeText(getClientAttachmentOptions(context, menu), null);
   
    if (menu.isDisableDefaultMenu()) {
      writer.writeText("Richfaces.disableDefaultHandler('", null);
      writer.writeText(event, null);
      writer.writeText("');", null);
    }
   
View Full Code Here

  }
 

  public void encodeChildren(FacesContext context, UIComponent component)
  throws IOException {
    UIContextMenu menu = (UIContextMenu) component;
    ResponseWriter writer = context.getResponseWriter();
   
    String event = menu.getEvent();
   
    if (event == null) {
      throw new FacesException("Attribute 'event' is not set for component " + component.getClientId(context));
    }
   
    writer.startElement("script", component);
    writer.writeText("new Richfaces.ContextMenu('", null);
    writer.writeText(component.getClientId(context), null);
    writer.writeText("', ", null);
    writer.writeText(menu.getShowDelay() + ", ", null);
    writeScriptBody(context, component, true);
    writer.writeText(")", null);
    writer.writeText(getClientAttachmentOptions(context, menu), null);
    writer.writeText(";", null);
   
    if (menu.isDisableDefaultMenu()) {
      writer.writeText("Richfaces.disableDefaultHandler('", null);
      writer.writeText(event, null);
      writer.writeText("');", null);
    }
   
View Full Code Here

TOP

Related Classes of org.richfaces.component.UIContextMenu

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.