コード例 #1
0
 private static void applyCssVisibility(final Component component, final boolean visible) {
   final AttributeModifier modifier =
       visible
           ? new AttributeModifier(
               "class",
               String.valueOf(component.getMarkupAttributes().get("class"))
                   .replaceFirst(INVISIBLE_CLASS, ""))
           : new AttributeAppender("class", " " + INVISIBLE_CLASS);
   component.add(modifier);
 }
コード例 #2
0
 public String getAttributeValue(final Component c) {
   String value = null;
   try {
     final ValueMap atts = c.getMarkupAttributes();
     value = toStringOrNull(atts.get(getAttribute()));
   } catch (MarkupNotFoundException e) {
     LOGGER.debug(e, e);
   }
   final String newValue = newValue(value, toStringOrNull(getReplaceModel().getObject()));
   return newValue;
 }