guiMessage = new GUIMessage();
guimsgPanel = new OncePanel("guimsgPanel");
// define the new windowcontrol
final WindowControl origWCo = ouisc_wControl;
WindowControl myWControl = new WindowControl() {
private WindowControlInfo wci;
{
wci = new WindowControlInfoImpl(BaseFullWebappController.this, origWCo.getWindowControlInfo());
}
/**
* @see org.olat.core.gui.control.WindowControl#pushToMainArea(org.olat.core.gui.components.Component)
*/
@SuppressWarnings("synthetic-access")
public void pushToMainArea(Component newMainArea) {
currentGuiStack.pushContent(newMainArea);
}
/**
* @see org.olat.core.gui.control.WindowControl#pushAsModalDialog(java.lang.String,
* org.olat.core.gui.components.Component)
*/
@SuppressWarnings("synthetic-access")
public void pushAsModalDialog(Component newModalDialog) {
currentGuiStack.pushModalDialog(newModalDialog);
}
/**
* @see org.olat.core.gui.control.WindowControl#pop()
*/
@SuppressWarnings("synthetic-access")
public void pop() {
// reactivate latest dialog from stack, dumping current one
currentGuiStack.popContent();
}
/**
* @see org.olat.core.gui.control.WindowControl#setInfo(java.lang.String)
*/
@SuppressWarnings("synthetic-access")
public void setInfo(String info) {
guiMessage.setInfo(info);
guimsgPanel.setContent(guimsgVc);
// setInfo is called input guimsgPanel into the correct place
}
/**
* @see org.olat.core.gui.control.WindowControl#setError(java.lang.String)
*/
@SuppressWarnings("synthetic-access")
public void setError(String error) {
guiMessage.setError(error);
guimsgPanel.setContent(guimsgVc);
}
/**
* @see org.olat.core.gui.control.WindowControl#setWarning(java.lang.String)
*/
@SuppressWarnings("synthetic-access")
public void setWarning(String warning) {
guiMessage.setWarn(warning);
guimsgPanel.setContent(guimsgVc);
}
public WindowControlInfo getWindowControlInfo() {
return wci;
}
public void makeFlat() {
throw new AssertException("should never be called!");
}
public BusinessControl getBusinessControl() {
return origWCo.getBusinessControl();
}
public WindowBackOffice getWindowBackOffice() {
return origWCo.getWindowBackOffice();
}
};
overrideWindowControl(myWControl);
/*
* BaseFullWebappController provides access to Dynamic Tabs
* on the same window and not on all Windows!
* TODO:pb discuss with HJZ multi window concept.
*/
// detach DTabs implementation from the controller - DTabs may be fetched from the window and locked on (synchronized access).
// if this is controller the controller is locked instead of only the DTabs part.
myDTabsImpl = new DTabs() {
public void activate(UserRequest ureq, DTab dTab, String viewIdentifier) {
BaseFullWebappController.this.activate(ureq, dTab, viewIdentifier);
}
public void activateStatic(UserRequest ureq, String className, String viewIdentifier) {
BaseFullWebappController.this.activateStatic(ureq, className, viewIdentifier);
}
public void addDTab(DTab dt) {
BaseFullWebappController.this.addDTab(dt);
}
public DTab createDTab(OLATResourceable ores, String title) {
return BaseFullWebappController.this.createDTab(ores, title);
}
public DTab getDTab(OLATResourceable ores) {
return BaseFullWebappController.this.getDTab(ores);
}
public void removeDTab(DTab dt) {
BaseFullWebappController.this.removeDTab(dt);
}
};
Window myWindow = myWControl.getWindowBackOffice().getWindow();
myWindow.setAttribute("DTabs", myDTabsImpl);
//REVIEW:PB remove if back support is desired
myWindow.addListener(this);//to be able to report BACK / FORWARD / RELOAD
/*
* use getAttribute on i.e. Windows(ureq).getWindow(ureq) to retrieve this "service"