Examples of LayoutToken


Examples of org.apache.myfaces.tobago.layout.LayoutToken

    // process auto tokens
    int i = 0;

    for (BankHead head : heads) {
      LayoutToken token = head.getToken();

      if (token instanceof PixelLayoutToken && head.isRendered()) {
        int pixel = ((PixelLayoutToken) token).getPixel();
        heads[i].setCurrent(Measure.valueOf(pixel)); // XXX refactor
      }

      IntervalList intervalList = new IntervalList();
      for (int j = 0; j < heads2.length; j++) {
        Cell cell = grid.getCell(i, j, orientation);
        if (cell instanceof OriginCell) {
          OriginCell origin = (OriginCell) cell;
          LayoutComponent component = cell.getComponent();

          if (component instanceof LayoutContainer) {
            ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
          }

          if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
            if (origin.getSpan(orientation) == 1 && component.isRendered()) {
              intervalList.add(new Interval(component, orientation));
            } else {
              if (LOG.isDebugEnabled()) {
                LOG.debug("Components with span > 1 will be ignored in 'auto' layout rows/columns.");
                // todo: give this information to the developer
              }
            }
          }
        }
      }

      intervalList.evaluate();
      if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
        heads[i].setIntervalList(intervalList);
      }
      if (token instanceof AutoLayoutToken) {
        heads[i].setCurrent(intervalList.getCurrent());
      }
      i++;
    }

/*
    IntervalList relatives = new IntervalList();
    for (BankHead head : heads) {
      LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
        final int factor = ((RelativeLayoutToken) token).getFactor();
        for (Interval interval : head.getIntervalList()) {
          relatives.add(new Interval(interval, factor));
        }
      }
    }
    relatives.evaluate();
*/

    // set the size if all sizes of the grid are set
    Measure sum = Measure.ZERO;
    for (BankHead head : heads) {
      Measure size = null;
      final LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
//        final int factor = ((RelativeLayoutToken) token).getFactor();
//        size = relatives.getCurrent().multiply(factor);
      } else {
        size = head.getCurrent();
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.LayoutToken

  }

  private void parseFixedWidth(LayoutInfo layoutInfo, List<UIColumn> rendereredColumns) {
    LayoutTokens tokens = layoutInfo.getLayoutTokens();
    for (int i = 0; i < tokens.getSize(); i++) {
      LayoutToken token = tokens.get(i);
      if (token instanceof AutoLayoutToken) {
        int width = 0;
        if (!rendereredColumns.isEmpty()) {
          if (i < rendereredColumns.size()) {
            UIColumn column = rendereredColumns.get(i);
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.LayoutToken

    // process auto tokens
    int i = 0;

    for (BankHead head : heads) {
      LayoutToken token = head.getToken();

      if (token instanceof PixelLayoutToken && head.isRendered()) {
        int pixel = ((PixelLayoutToken) token).getPixel();
        heads[i].setCurrent(Measure.valueOf(pixel)); // XXX refactor
      }

      IntervalList intervalList = new IntervalList();
      for (int j = 0; j < heads2.length; j++) {
        Cell cell = grid.getCell(i, j, orientation);
        if (cell instanceof OriginCell) {
          OriginCell origin = (OriginCell) cell;
          LayoutComponent component = cell.getComponent();

          if (component instanceof LayoutContainer) {
            ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
          }

          if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
            if (origin.getSpan(orientation) == 1 && component.isRendered()) {
              intervalList.add(new Interval(component, orientation));
            } else {
              if (LOG.isDebugEnabled()) {
                LOG.debug("Components with span > 1 will be ignored in 'auto' layout rows/columns.");
                // todo: give this information to the developer
              }
            }
          }
        }
      }

      intervalList.evaluate();
      if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
        heads[i].setIntervalList(intervalList);
      }
      if (token instanceof AutoLayoutToken) {
        heads[i].setCurrent(intervalList.getCurrent());
      }
      i++;
    }

/*
    IntervalList relatives = new IntervalList();
    for (BankHead head : heads) {
      LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
        final int factor = ((RelativeLayoutToken) token).getFactor();
        for (Interval interval : head.getIntervalList()) {
          relatives.add(new Interval(interval, factor));
        }
      }
    }
    relatives.evaluate();
*/

    // set the size if all sizes of the grid are set
    Measure sum = Measure.ZERO;
    for (BankHead head : heads) {
      Measure size = null;
      final LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
//        final int factor = ((RelativeLayoutToken) token).getFactor();
//        size = relatives.getCurrent().multiply(factor);
      } else {
        size = head.getCurrent();
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.LayoutToken

    // process auto tokens
    int i = 0;

    for (final BankHead head : heads) {
      final LayoutToken token = head.getToken();

      if (token instanceof PixelLayoutToken) {
        if (head.isRendered() || isRigid()) {
          heads[i].setCurrent(((PixelLayoutToken) token).getMeasure());
        } else {
          heads[i].setCurrent(Measure.ZERO);
        }
      }

      final IntervalList intervalList = new IntervalList();
      for (int j = 0; j < heads2.length; j++) {
        final Cell cell = grid.getCell(i, j, orientation);
        if (cell instanceof OriginCell) {
          final OriginCell origin = (OriginCell) cell;
          final LayoutComponent component = cell.getComponent();

          if (component instanceof LayoutContainer && (component.isRendered() || isRigid())) {
            ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
          }

          if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
            if ((component.isRendered() || isRigid())) {
              if (origin.getSpan(orientation) == 1) {
                intervalList.add(new Interval(component, orientation));
              } else {
                if (LOG.isDebugEnabled()) {
                  LOG.debug("Components with span > 1 will be ignored in 'auto' layout rows/columns.");
                }
              }
            }
          }
        }
      }

      intervalList.evaluate();
      if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
        heads[i].setIntervalList(intervalList);
      }
      if (token instanceof AutoLayoutToken) {
        if (heads[i].isRendered()) {
          if (intervalList.size() > 0) {
            heads[i].setCurrent(intervalList.getCurrent());
          } else {
            heads[i].setCurrent(Measure.valueOf(100));
            LOG.warn("Found an 'auto' token in {} definition, but there is no component inside with span = 1! "
                + "So the value for 'auto' can't be evaluated (clientId={}). Using 100px.",
                orientation == Orientation.HORIZONTAL ? "columns" : "rows",
                getClientId(getFacesContext()));
          }
        } else {
          heads[i].setCurrent(Measure.ZERO);
        }
      }
      i++;
    }

/*
    IntervalList relatives = new IntervalList();
    for (BankHead head : heads) {
      LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
        final int factor = ((RelativeLayoutToken) token).getFactor();
        for (Interval interval : head.getIntervalList()) {
          relatives.add(new Interval(interval, factor));
        }
      }
    }
    relatives.evaluate();
*/

    // set the size if all sizes of the grid are set
    Measure sum = Measure.ZERO;
    for (final BankHead head : heads) {
      Measure size = null;
      final LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
//        final int factor = ((RelativeLayoutToken) token).getFactor();
//        size = relatives.getCurrent().multiply(factor);
      } else {
        size = head.getCurrent();
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.LayoutToken

    // process auto tokens
    int i = 0;

    for (BankHead head : heads) {
      LayoutToken token = head.getToken();

      if (token instanceof PixelLayoutToken && head.isRendered()) {
        int pixel = ((PixelLayoutToken) token).getPixel();
        heads[i].setCurrent(Measure.valueOf(pixel)); // XXX refactor
      }

      IntervalList intervalList = new IntervalList();
      for (int j = 0; j < heads2.length; j++) {
        Cell cell = grid.getCell(i, j, orientation);
        if (cell instanceof OriginCell) {
          OriginCell origin = (OriginCell) cell;
          LayoutComponent component = cell.getComponent();

          if (component instanceof LayoutContainer) {
            ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
          }

          if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
            if (origin.getSpan(orientation) == 1 && component.isRendered()) {
              intervalList.add(new Interval(component, orientation));
            } else {
              if (LOG.isDebugEnabled()) {
                LOG.debug("Components with span > 1 will be ignored in 'auto' layout rows/columns.");
                // todo: give this information to the developer
              }
            }
          }
        }
      }

      intervalList.evaluate();
      if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
        heads[i].setIntervalList(intervalList);
      }
      if (token instanceof AutoLayoutToken) {
        heads[i].setCurrent(intervalList.getCurrent());
      }
      i++;
    }

/*
    IntervalList relatives = new IntervalList();
    for (BankHead head : heads) {
      LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
        final int factor = ((RelativeLayoutToken) token).getFactor();
        for (Interval interval : head.getIntervalList()) {
          relatives.add(new Interval(interval, factor));
        }
      }
    }
    relatives.evaluate();
*/

    // set the size if all sizes of the grid are set
    Measure sum = Measure.ZERO;
    for (BankHead head : heads) {
      Measure size = null;
      final LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
//        final int factor = ((RelativeLayoutToken) token).getFactor();
//        size = relatives.getCurrent().multiply(factor);
      } else {
        size = head.getCurrent();
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.LayoutToken

    // process auto tokens
    int i = 0;

    for (final BankHead head : heads) {
      final LayoutToken token = head.getToken();

      if (token instanceof PixelLayoutToken) {
        if (head.isRendered() || isRigid()) {
          heads[i].setCurrent(((PixelLayoutToken) token).getMeasure());
        } else {
          heads[i].setCurrent(Measure.ZERO);
        }
      }

      final IntervalList intervalList = new IntervalList();
      for (int j = 0; j < heads2.length; j++) {
        final Cell cell = grid.getCell(i, j, orientation);
        if (cell instanceof OriginCell) {
          final OriginCell origin = (OriginCell) cell;
          final LayoutComponent component = cell.getComponent();

          if (component instanceof LayoutContainer && (component.isRendered() || isRigid())) {
            ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
          }

          if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
            if (origin.getSpan(orientation) == 1 && (component.isRendered() || isRigid())) {
              intervalList.add(new Interval(component, orientation));
            } else {
              if (LOG.isDebugEnabled()) {
                LOG.debug("Components with span > 1 will be ignored in 'auto' layout rows/columns.");
                // todo: give this information to the developer
              }
            }
          }
        }
      }

      intervalList.evaluate();
      if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
        heads[i].setIntervalList(intervalList);
      }
      if (token instanceof AutoLayoutToken) {
        heads[i].setCurrent(intervalList.getCurrent());
      }
      i++;
    }

/*
    IntervalList relatives = new IntervalList();
    for (BankHead head : heads) {
      LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
        final int factor = ((RelativeLayoutToken) token).getFactor();
        for (Interval interval : head.getIntervalList()) {
          relatives.add(new Interval(interval, factor));
        }
      }
    }
    relatives.evaluate();
*/

    // set the size if all sizes of the grid are set
    Measure sum = Measure.ZERO;
    for (final BankHead head : heads) {
      Measure size = null;
      final LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
//        final int factor = ((RelativeLayoutToken) token).getFactor();
//        size = relatives.getCurrent().multiply(factor);
      } else {
        size = head.getCurrent();
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.LayoutToken

    // process auto tokens
    int i = 0;

    for (final BankHead head : heads) {
      final LayoutToken token = head.getToken();

      if (token instanceof PixelLayoutToken) {
        if (head.isRendered() || isRigid()) {
          heads[i].setCurrent(((PixelLayoutToken) token).getMeasure());
        } else {
          heads[i].setCurrent(Measure.ZERO);
        }
      }

      final IntervalList intervalList = new IntervalList();
      for (int j = 0; j < heads2.length; j++) {
        final Cell cell = grid.getCell(i, j, orientation);
        if (cell instanceof OriginCell) {
          final OriginCell origin = (OriginCell) cell;
          final LayoutComponent component = cell.getComponent();

          if (component instanceof LayoutContainer && (component.isRendered() || isRigid())) {
            ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
          }

          if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
            if ((component.isRendered() || isRigid())) {
              if (origin.getSpan(orientation) == 1) {
                intervalList.add(new Interval(component, orientation));
              } else {
                if (LOG.isDebugEnabled()) {
                  LOG.debug("Components with span > 1 will be ignored in 'auto' layout rows/columns.");
                }
              }
            }
          }
        }
      }

      intervalList.evaluate();
      if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
        heads[i].setIntervalList(intervalList);
      }
      if (token instanceof AutoLayoutToken) {
        if (heads[i].isRendered()) {
          if (intervalList.size() > 0) {
            heads[i].setCurrent(intervalList.getCurrent());
          } else {
            heads[i].setCurrent(Measure.valueOf(100));
            LOG.warn("Found an 'auto' token in {} definition, but there is no component inside with span = 1! "
                + "So the value for 'auto' can't be evaluated (clientId={}). Using 100px.",
                orientation == Orientation.HORIZONTAL ? "columns" : "rows",
                getClientId(getFacesContext()));
          }
        } else {
          heads[i].setCurrent(Measure.ZERO);
        }
      }
      i++;
    }

/*
    IntervalList relatives = new IntervalList();
    for (BankHead head : heads) {
      LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
        final int factor = ((RelativeLayoutToken) token).getFactor();
        for (Interval interval : head.getIntervalList()) {
          relatives.add(new Interval(interval, factor));
        }
      }
    }
    relatives.evaluate();
*/

    // set the size if all sizes of the grid are set
    Measure sum = Measure.ZERO;
    for (final BankHead head : heads) {
      Measure size = null;
      final LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
//        final int factor = ((RelativeLayoutToken) token).getFactor();
//        size = relatives.getCurrent().multiply(factor);
      } else {
        size = head.getCurrent();
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.LayoutToken

  }

  private void parseFixedWidth(LayoutInfo layoutInfo, List<UIColumn> rendereredColumns) {
    LayoutTokens tokens = layoutInfo.getLayoutTokens();
    for (int i = 0; i < tokens.getSize(); i++) {
      LayoutToken token = tokens.get(i);
      if (token instanceof AutoLayoutToken) {
        int width = 0;
        if (!rendereredColumns.isEmpty()) {
          if (i < rendereredColumns.size()) {
            UIColumn column = rendereredColumns.get(i);
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.LayoutToken

    // process auto tokens
    int i = 0;

    for (BankHead head : heads) {
      LayoutToken token = head.getToken();

      if (token instanceof PixelLayoutToken && head.isRendered()) {
        int pixel = ((PixelLayoutToken) token).getPixel();
        heads[i].setCurrent(Measure.valueOf(pixel)); // XXX refactor
      }

      IntervalList intervalList = new IntervalList();
      for (int j = 0; j < heads2.length; j++) {
        Cell cell = grid.getCell(i, j, orientation);
        if (cell instanceof OriginCell) {
          OriginCell origin = (OriginCell) cell;
          LayoutComponent component = cell.getComponent();

          if (component instanceof LayoutContainer) {
            ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
          }

          if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
            if (origin.getSpan(orientation) == 1 && component.isRendered()) {
              intervalList.add(new Interval(component, orientation));
            } else {
              if (LOG.isDebugEnabled()) {
                LOG.debug("Components with span > 1 will be ignored in 'auto' layout rows/columns.");
                // todo: give this information to the developer
              }
            }
          }
        }
      }

      intervalList.evaluate();
      if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
        heads[i].setIntervalList(intervalList);
      }
      if (token instanceof AutoLayoutToken) {
        heads[i].setCurrent(intervalList.getCurrent());
      }
      i++;
    }

    IntervalList relatives = new IntervalList();
    for (BankHead head : heads) {
      LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
        final int factor = ((RelativeLayoutToken) token).getFactor();
        for (Interval interval : head.getIntervalList()) {
          relatives.add(new Interval(interval, factor));
        }
      }
    }
    relatives.evaluate();

    // set the size if all sizes of the grid are set
    Measure sum = Measure.ZERO;
    for (BankHead head : heads) {
      Measure size;
      final LayoutToken token = head.getToken();
      if (token instanceof RelativeLayoutToken) {
        final int factor = ((RelativeLayoutToken) token).getFactor();
        size = relatives.getCurrent().multiply(factor);
      } else {
        size = head.getCurrent();
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.LayoutToken

  private void parseFixedWidth(
      LayoutInfo layoutInfo, List<AbstractUIColumn> renderedColumns, Measure columnSelectorWidth) {
    LayoutTokens tokens = layoutInfo.getLayoutTokens();
    for (int i = 0; i < tokens.getSize(); i++) {
      LayoutToken token = tokens.get(i);
      if (token instanceof AutoLayoutToken) {
        int width = 0;
        if (!renderedColumns.isEmpty()) {
          if (i < renderedColumns.size()) {
            AbstractUIColumn column = renderedColumns.get(i);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.