/**
* Sets the current view given a presently cached view container.
* @param e primary cache element
*/
private void setCurrentView(CView e) {
final ViewContainer vc = e.vc;
final ViewOptions options = e.init.getViewKey().getViewClass().getViewOptions();
final boolean rmvCrnt = current != null;
final boolean pinPndg = rmvCrnt || (!e.vc.isAttached() || !e.vc.isVisible());
if(rmvCrnt) {
// remove or hide the current pinned view
if(current.init.getViewKey().getViewClass().getViewOptions().isKeepInDom()) {
current.vc.setVisible(false);
}
else {
current.vc.removeFromParent();
}
RootPanel.get().removeStyleName(current.vc.getView().getViewClass().getName());
}
if(pinPndg) {
// add the current view's view class name to the root panel
RootPanel.get().addStyleName(e.vc.getView().getViewClass().getName());
// ** pin the view (the current view in the dom) **
// vc.makePinReady();
if(options.isKeepInDom() && parentViewPanel.panel.getWidgetIndex(vc) >= 0) {
vc.setVisible(true);
}
else {
parentViewPanel.panel.add(vc);
}
}