Package org.apache.myfaces.tobago.layout

Examples of org.apache.myfaces.tobago.layout.Measure.multiply()


    Measure heightOfOne = super.getHeight(facesContext, component);
    if (select.isInline()) {
      return heightOfOne;
    } else {
      List<SelectItem> items = RenderUtils.getItemsToRender((UISelectOne) component);
      return heightOfOne.multiply(items.size());
    }
  }
}
View Full Code Here


    LabelWithAccessKey label = new LabelWithAccessKey(button);

    width = width.add(RenderUtils.calculateStringWidth(facesContext, button, label.getText()));
    Measure padding = getResourceManager().getThemeMeasure(facesContext, button, "paddingWidth");
    // left padding, right padding and when an image and an text then a middle padding.
    width = width.add(padding.multiply(image && label.getText() != null ? 3 : 2));

    return width;
  }
}
View Full Code Here

    final int level = parent.getLevel();
//    final boolean folder = parent.isFolder();

    Style style = new Style();
    Measure paddingLeft = getResourceManager().getThemeMeasure(facesContext, node, "custom.padding-left");
    paddingLeft = paddingLeft.multiply(level);
    style.setPaddingLeft(paddingLeft);
/*
    Measure width = ((UITreeMenu)(node.getParent().getParent().getParent())).getCurrentWidth();
    width = width.subtract(4); // XXX 4 = border + padding
    width = width.subtractNotNegative(paddingLeft);
View Full Code Here

    final int level = parent.getLevel();
//    final boolean folder = parent.isFolder();

    Style style = new Style();
    Measure paddingLeft = getResourceManager().getThemeMeasure(facesContext, node, "custom.padding-left");
    paddingLeft = paddingLeft.multiply(level);
    style.setPaddingLeft(paddingLeft);
/*
    Measure width = ((UITreeMenu)(node.getParent().getParent().getParent())).getCurrentWidth();
    width = width.subtract(4); // XXX 4 = border + padding
    width = width.subtractNotNegative(paddingLeft);
View Full Code Here

  @Override
  public Measure getPreferredHeight(FacesContext facesContext, Configurable component) {
    Measure measure = super.getPreferredHeight(facesContext, component);
    UIMessages messages = (UIMessages) component;
    int count = messages.createMessageList(facesContext).size();
    return measure.multiply(count);
  }
}
View Full Code Here

    for (int level = 0; level < depth; level++) {

      writer.startElement(HtmlElements.DIV, null);
      writer.writeClassAttribute(Classes.create(tree, "level"));
      Style levelStyle = new Style();
      levelStyle.setLeft(width.multiply(level));
      levelStyle.setWidth(width);
      writer.writeStyleAttribute(levelStyle);
      // at the start of each div there is an empty and disabled select tag to show empty area.
      // this is not needed for the 1st level.
      if (level > 0) {
View Full Code Here

    Measure heightOfOne = super.getHeight(facesContext, component);
    if (select.isInline()) {
      return heightOfOne;
    } else {
      List<SelectItem> items = RenderUtils.getItemsToRender((UISelectMany) component);
      return heightOfOne.multiply(items.size());
    }
  }
}
View Full Code Here

    LabelWithAccessKey label = new LabelWithAccessKey(button);

    width = width.add(RenderUtils.calculateStringWidth(facesContext, button, label.getText()));
    Measure padding = getResourceManager().getThemeMeasure(facesContext, button, "paddingWidth");
    // left padding, right padding and when an image and an text then a middle padding.
    width = width.add(padding.multiply(image && label.getText() != null ? 3 : 2));

    return width;
  }
}
View Full Code Here

    Measure heightOfOne = super.getHeight(facesContext, component);
    if (select.isInline()) {
      return heightOfOne;
    } else {
      List<SelectItem> items = RenderUtils.getItemsToRender((UISelectOne) component);
      return heightOfOne.multiply(items.size());
    }
  }
}
View Full Code Here

    Measure heightOfOne = super.getHeight(facesContext, component);
    if (select.isInline()) {
      return heightOfOne;
    } else {
      List<SelectItem> items = RenderUtils.getItemsToRender((UISelectOne) component);
      return heightOfOne.multiply(items.size());
    }
  }
}
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.