@Override public void setXslFO(Element foElement) { if (((U)this.getObject()).getVal()==null ) { // This does happen foElement.setAttribute(FO_NAME, "underline"); } else if (!((U)this.getObject()).getVal().equals( UnderlineEnumeration.NONE ) ) { foElement.setAttribute(FO_NAME, "underline"); } else { // } }
public static boolean isEmpty(U u) { return (u == null) || ((u.getVal() == null) && isEmpty(u.getColor()) ); }
@Override public String getCssProperty() { if (((U)this.getObject()).getVal()==null ) { // This does happen return composeCss(CSS_NAME, "underline"); } else if (!((U)this.getObject()).getVal().equals( UnderlineEnumeration.NONE ) ) { return composeCss(CSS_NAME, "underline"); } else { return CSS_NULL; // text-decoration is also used for Strike (a la line-through) } // How to handle <w:u w:color="FF0000"> ie coloured underline? }
public static U apply(U source, U destination) { if (!isEmpty(source)) { if (destination == null) destination = Context.getWmlObjectFactory().createU(); destination.setVal(source.getVal()); } return destination; }
public U keepDiff(U orig, U from) { if (from != null && orig != null) { if (orig.getVal() != null && from.getVal() != null && orig.getVal().compareTo(from.getVal()) == 0) orig.setVal(null); if (orig.getColor() != null && from.getColor() != null && orig.getColor().compareTo(from.getColor()) == 0) orig.setColor(null); if (orig.getThemeColor() != null && from.getThemeColor() != null && orig.getThemeColor().compareTo(from.getThemeColor()) == 0) orig.setThemeColor(null); if (orig.getThemeTint() != null && from.getThemeTint() != null && orig.getThemeTint().compareTo(from.getThemeTint()) == 0) orig.setThemeTint(null); if (orig.getThemeShade() != null && from.getThemeShade() != null && orig.getThemeShade().compareTo(from.getThemeShade()) == 0) orig.setThemeShade(null); } return StyleUtil.isEmpty(orig) ? null : orig; }
public U getCopy(U copy, boolean whenNull) { if (copy != null) { U result = myFactory.createU(); result.setVal(copy.getVal()); result.setColor(copy.getColor()); result.setThemeColor(copy.getThemeColor()); result.setThemeTint(copy.getThemeTint()); result.setThemeShade(copy.getThemeShade()); return result; } if (whenNull) { return myFactory.createU(); } return null; }
@Override public void setXslFO(Element foElement) { if (((U)this.getObject()).getVal()==null ) { // This does happen foElement.setAttribute(FO_NAME, "underline"); } else if (!((U)this.getObject()).getVal().equals( UnderlineEnumeration.NONE ) ) { foElement.setAttribute(FO_NAME, "underline"); } else { // } }
public static boolean isEmpty(U u) { return (u == null) || ((u.getVal() == null) && isEmpty(u.getColor()) ); }
@Override public String getCssProperty() { if (((U)this.getObject()).getVal()==null ) { // This does happen return composeCss(CSS_NAME, "underline"); } else if (!((U)this.getObject()).getVal().equals( UnderlineEnumeration.NONE ) ) { return composeCss(CSS_NAME, "underline"); } else { return CSS_NULL; // text-decoration is also used for Strike (a la line-through) } // How to handle <w:u w:color="FF0000"> ie coloured underline? }
public static U apply(U source, U destination) { if (!isEmpty(source)) { if (destination == null) destination = Context.getWmlObjectFactory().createU(); destination.setVal(source.getVal()); } return destination; }