Package org.primefaces.component.layout

Examples of org.primefaces.component.layout.LayoutUnit



  protected LayoutUnit getLayoutUnitByPosition(String name) {
    for(UIComponent child : getChildren()) {
      if(child instanceof LayoutUnit) {
        LayoutUnit layoutUnit = (LayoutUnit) child;
       
        if(layoutUnit.getPosition().equalsIgnoreCase(name))
          return layoutUnit;
      }
    }
   
    return null;
View Full Code Here


    private static final Collection<String> EVENT_NAMES = Collections.unmodifiableCollection(Arrays.asList("toggle","close", "resize"));

  protected LayoutUnit getLayoutUnitByPosition(String name) {
    for(UIComponent child : getChildren()) {
      if(child instanceof LayoutUnit) {
        LayoutUnit layoutUnit = (LayoutUnit) child;
       
        if(layoutUnit.getPosition().equalsIgnoreCase(name))
          return layoutUnit;
      }
    }
   
    return null;
View Full Code Here

            AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) event;
            FacesEvent wrapperEvent = null;

            if(eventName.equals("toggle")) {
                boolean collapsed = Boolean.valueOf(params.get(clientId + "_collapsed"));
                LayoutUnit unit = getLayoutUnitByPosition(params.get(clientId + "_unit"));
                Visibility visibility = collapsed ? Visibility.HIDDEN : Visibility.VISIBLE;
                unit.setCollapsed(collapsed);
               
                wrapperEvent = new ToggleEvent(unit, behaviorEvent.getBehavior(), visibility);
            }
            else if(eventName.equals("close")) {
                LayoutUnit unit = getLayoutUnitByPosition(params.get(clientId + "_unit"));
                unit.setVisible(false);

                wrapperEvent = new CloseEvent(unit, behaviorEvent.getBehavior());
            }
            else if(eventName.equals("resize")) {
                LayoutUnit unit = getLayoutUnitByPosition(params.get(clientId + "_unit"));
                String position = unit.getPosition();
                int width = Integer.valueOf(params.get(clientId + "_width"));
                int height = Integer.valueOf(params.get(clientId + "_height"));

                if(position.equals("west") || position.equals("east")) {
                    unit.setSize(String.valueOf(width));
                } else if(position.equals("north") || position.equals("south")) {
                    unit.setSize(String.valueOf(height));
                }

                wrapperEvent = new ResizeEvent(unit, behaviorEvent.getBehavior(), width, height);
            }
View Full Code Here


  protected LayoutUnit getLayoutUnitByPosition(String name) {
    for(UIComponent child : getChildren()) {
      if(child instanceof LayoutUnit) {
        LayoutUnit layoutUnit = (LayoutUnit) child;
       
        if(layoutUnit.getPosition().equalsIgnoreCase(name))
          return layoutUnit;
      }
    }
   
    return null;
View Full Code Here

TOP

Related Classes of org.primefaces.component.layout.LayoutUnit

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.