@Override
protected void doAddPageComponent(PageComponent pageComponent) {
Assert.notNull(pageComponent);
// If we have at least one content, then dock into that one!
MultiSplitConstraint constraint;
final Iterator<Entry<Dockable, PageComponent>> iterator = contentAndPageComponentById.values().iterator();
if (iterator.hasNext()) {
Dockable dock = iterator.next().getKey();
if (dock instanceof Content) {
constraint = new MultiSplitConstraint((Content) dock);
}
else {
constraint = new MultiSplitConstraint(AggregationPosition.DEFAULT);
}
}
else {
constraint = new MultiSplitConstraint(AggregationPosition.DEFAULT);
}
final Dockable dockable;
ViewDescriptor viewDescriptor = getViewDescriptor(pageComponent.getId());