// Check to be sure everything is instantiated
if (_paneManagerView == null) {
return;
}
final PaneManagerModel model = _paneManagerView.getModel();
TitleView header = _paneManagerView.getTitle();
if (header == null || model == null) {
return;
}
PaneManagerController controller = null;
// Switch the header style based on current style
if (header instanceof HorizontalScrollableTitleView) {
header = new HorizontalTabTitleView(Field.FOCUSABLE);
((HorizontalTabTitleView) header)
.setNumberOfDisplayedTabs(model.numberOfPanes());
controller = new HorizontalTabController();
} else if (header instanceof HorizontalTabTitleView) {
header = new HorizontalScrollableTitleView(Field.FOCUSABLE);
((HorizontalScrollableTitleView) header).enableArrows(true);
controller = new HorizontalScrollableController();
if (_leftArrow != null) {
header.setLeftArrow(_leftArrow);
}
if (_rightArrow != null) {
header.setRightArrow(_rightArrow);
}
}
// Set up references between objects
header.setModel(model);
header.setBorder(BorderFactory.createRoundedBorder(_edgesFour));
if (controller != null) {
_paneManagerView.setController(controller);
model.setController(controller);
controller.setView(_paneManagerView);
controller.setModel(model);