/** * Create an instance of {@link U } * */ public U createU() { return new U(); }
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; }
@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 Underline(CSSValue value) { //debug(CSS_NAME, value); U u = Context.getWmlObjectFactory().createU(); if (value.getCssText().toLowerCase().equals("underline") || value.getCssText().toLowerCase().equals("[underline]")) { u.setVal(UnderlineEnumeration.SINGLE); // } else if (value.getCssText().toLowerCase().equals("underline")) { // u.setVal(UnderlineEnumeration.NONE); } else { log.error("How to handle " + CSS_NAME + " " + value.getCssText().toLowerCase()); } this.setObject( u ); }
/** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); }
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 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? }
u.setVal(UnderlineEnumeration.SINGLE); rPr.setU(u);
/** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); }
/** * Create an instance of {@link U } * */ public U createU() { return new U(); }
public Underline(CSSValue value) { //debug(CSS_NAME, value); U u = Context.getWmlObjectFactory().createU(); if (value.getCssText().toLowerCase().equals("underline") || value.getCssText().toLowerCase().equals("[underline]")) { u.setVal(UnderlineEnumeration.SINGLE); // } else if (value.getCssText().toLowerCase().equals("underline")) { // u.setVal(UnderlineEnumeration.NONE); } else { log.error("How to handle " + CSS_NAME + " " + value.getCssText().toLowerCase()); } this.setObject( u ); }
@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 interface I { public Class U{ I me; U(I me){ this.me = me; } public void complexFunction(String s){ me.f(); me.g(s) } } U getUtilities(); } class implementationOfI implements I{ U u=new U(this); U getUtilities(){ return u; } }
u.setVal(UnderlineEnumeration.SINGLE); rPr.setU(u);