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");
}
}
I entered a new bug in JIRA for it:
http://jira.jboss.org/jira/browse/JBSEAM-2914