Package org.xulfaces.bridge

Examples of org.xulfaces.bridge.Bridge


  }

  public static Bridge getBridge(){
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ValueBinding valueBinding = facesContext.getApplication().createValueBinding("#{bridge}");
    Bridge bridge = (Bridge) valueBinding.getValue(facesContext);
    return bridge;
  }
View Full Code Here


      throws IOException {
    super.encodeBegin(facesContext, component);
    if (component instanceof EditableValueHolder) {
      EditableValueHolder editableValueHolder = (EditableValueHolder) component;
      if (!editableValueHolder.isValid()) {
        Bridge bridge = XulUtils.getBridge();
        Zone zone = new Zone(component.getClientId(facesContext));
        bridge.addCommand(new NotValidCommand(zone));
      }
    }
  }
View Full Code Here

  private void renderXFC(FacesContext facesContext,
      BridgeComponent bridgeComponent) throws IOException {

    ResponseWriter responseWriter = facesContext.getResponseWriter();
    Bridge bridge = XulUtils.getBridge();
    responseWriter.startElement("xfc:bridge", bridgeComponent);
    for (Command command : bridge.getCommands()) {
      StringBuffer stringBuffer = new StringBuffer("xfc:");
      stringBuffer.append(command.getName());

      if (log.isDebugEnabled()) {
        log.debug("Command " + stringBuffer.toString() + " on "
            + command.getTarget());
      }

      responseWriter.startElement(stringBuffer.toString(),
          bridgeComponent);
      for (Parameter parameter : command.getParameters()) {

        if (log.isDebugEnabled()) {
          log.debug("parameter " + parameter.getName() + " value "
              + parameter.getValue());
        }

        responseWriter.writeAttribute(parameter.getName(), parameter
            .getValue().toString(), null);
      }
      responseWriter.endElement(stringBuffer.toString());
    }

    facesContext.getApplication().getViewHandler().writeState(facesContext);

    responseWriter.endElement("xfc:bridge");
    bridge.getCommands().clear();
  }
View Full Code Here

    // the bridge for client side update. The parent will be updated and then all its children.
    if(!isParentSmoothlyUpdateable(component)){   
      if (component instanceof SmoothlyUpdateable) {
        SmoothlyUpdateable smoothlyUpdateable = (SmoothlyUpdateable) component;
        if (smoothlyUpdateable.needsUpdate()) {
          Bridge bridge = XulUtils.getBridge();
          Zone zone = new Zone(component.getClientId(facesContext));
          if (log.isDebugEnabled()) {
            log.debug("Add UpdateZoneCommand for DOM zone " + zone.getNodeId());
          }
         
          bridge.addCommand(new UpdateZoneCommand(zone,buildTargetName(component)));
        }
      }
    }
  }
View Full Code Here

    responseWriter.writeAttribute("id",treeRowComponent.getNodeId(), "id");
    if(!isParentSmoothlyUpdateable(component)){
      if (component instanceof SmoothlyUpdateable) {
        SmoothlyUpdateable smoothlyUpdateable = (SmoothlyUpdateable) component;
        if (smoothlyUpdateable.needsUpdate()) {
          Bridge bridge = XulUtils.getBridge();
          Zone zone = new Zone(treeRowComponent.getNodeId());
          bridge.addCommand(new UpdateZoneCommand(zone,buildTargetName(component)));
        }
      }
    }
   
    renderAttributes(facesContext, component, (List) component
View Full Code Here

                    
        if(!isParentSmoothlyUpdateable(component)){
          if (treeItemComponent instanceof SmoothlyUpdateable) {
          SmoothlyUpdateable smoothlyUpdateable = (SmoothlyUpdateable) treeItemComponent;
          if (smoothlyUpdateable.needsUpdate()) {
            Bridge bridge = XulUtils.getBridge();
            Zone zone = new Zone(nodeId);
            bridge.addCommand(new UpdateZoneCommand(zone,buildTargetName(component)));
          }
        } 
        }
   
       
View Full Code Here

    responseWriter.startElement("tabpanels",component);
    responseWriter.writeAttribute("id",component.getClientId(facesContext), "id");
    renderAttributes(facesContext,component,(List) component.getAttributes().get("annotatedAttributes"));

    // Add command for the bridge
    Bridge bridge = XulUtils.getBridge();
    Zone zone = new Zone(component.getClientId(facesContext));
    if (log.isDebugEnabled()) {
      log.debug("Add WatchZonePropertyCommand for <selectedIndex> to DOM zone " + zone.getNodeId());
    }   
    bridge.addCommand(new WatchZonePropertyCommand(zone,buildTargetName(component),"selectedIndex"));
  }
View Full Code Here

TOP

Related Classes of org.xulfaces.bridge.Bridge

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.