[
http://jira.jboss.com/jira/browse/JBSEAM-2914?page=all ]
Norman Richards closed JBSEAM-2914.
-----------------------------------
Fix Version/s: 2.1.0.BETA1
Resolution: Done
Fixed. Thanks!
PDF: Image inside a cell cannot be aligned properly
---------------------------------------------------
Key: JBSEAM-2914
URL:
http://jira.jboss.com/jira/browse/JBSEAM-2914
Project: Seam
Issue Type: Bug
Components: PDF
Affects Versions: 2.0.1.GA
Reporter: Richard Leherpeur
Assigned To: Norman Richards
Fix For: 2.1.0.BETA1
I noticed that this is not possible to properly align an image inside a cell. I
investigated a little and found out that one case is missing the UICell.handleAdd method.
The actual method is implemented as:
public void handleAdd(Object o) {
if (o instanceof Phrase) {
cell.setPhrase((Phrase) o);
} else if (o instanceof Element) {
// calling addElement negates setPhrase, etc...
cell.addElement((Element) o);
} else {
throw new RuntimeException("Can't add " +
o.getClass().getName() + " to cell");
}
}
The correct implementation should be:
public void handleAdd(Object o) {
if (o instanceof Phrase) {
cell.setPhrase((Phrase) o);
} else if (o instanceof Image) {
// Allow proper control over image alignment
cell.setImage((Image) o);
} else if (o instanceof Element) {
// calling addElement negates setPhrase, etc...
cell.addElement((Element) o);
} else {
throw new RuntimeException("Can't add " +
o.getClass().getName() + " to cell");
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira