org.olat.core.gui.control.winmgr
Class WindowBackOfficeImpl

java.lang.Object
  extended by org.olat.core.gui.control.winmgr.WindowBackOfficeImpl
All Implemented Interfaces:
Disposable, WindowBackOffice

public class WindowBackOfficeImpl
extends java.lang.Object
implements WindowBackOffice

Description:
impl of windowbackoffice - responsible for several activities around a (browser)window

Initial Date: 10.02.2007

Author:
Felix Jost, http://www.goodsolutions.ch

Field Summary
 
Fields inherited from interface org.olat.core.gui.control.WindowBackOffice
IGNORE_BOOKMARK_ONE_TIME
 
Method Summary
 void acquireBackHandling(BackHandler backHandler)
          when set, all browser-back and forward moves are sent to the backHandler instead of the ordinary handling (which reverts to the latest gui path in case of back).
 void addCycleListener(GenericEventListener gel)
          not used normally! normally you do not have to care about when happens what - you should only need to know what to do in your event-methods of your controllers.
 void adjustGuiPathCenter(WindowControlInfo wci)
           
 void browserBackOrForward(UserRequest ureq, int diff)
          diff == 0 -> reload (->ignore, so it will cause a simple rerendering)
diff < 0 -> browser-back
diff > 0 -> browser-forward
 Controller createAJAXController(UserRequest ureq)
           
 Controller createDebugDispatcherController(UserRequest ureq, WindowControl windowControl)
           
 Controller createDevelopmentController(UserRequest ureq, WindowControl windowControl)
           
 GuiStack createGuiStack(Component initialComponent)
           
 Controller createInlineTranslationDispatcherController(UserRequest ureq, WindowControl windowControl)
          Factory method to create the inline translation tool dispatcher controller.
 JSAndCSSAdderImpl createJSAndCSSAdder()
           
 void dispose()
          disposes the disposable
 MediaResource extractCommands(boolean wrapHTML)
           
 void fireCycleEvent(Event cycleEvent)
           
 java.lang.String getBusinessControlPath()
           
 java.lang.Object getData(java.lang.String key)
          gets the data
 GlobalSettings getGlobalSettings()
           
 java.lang.String getIframeTargetName()
           
 InterceptHandler getInterceptHandler()
           
 Window getWindow()
           
 WindowManager getWindowManager()
           
 WindowManagerImpl getWinmgrImpl()
           
 void informControllerCreated(WindowControl wControl, Controller controller)
           
 void informControllerDispatched(WindowControl wControl, Controller controller, Component source, Event event)
           
 void invokeLater(java.lang.Runnable runnable)
          Use this method for asynchronous updates to the gui.
 boolean isDebuging()
           
 void putData(java.lang.String key, java.lang.Object value)
          together with getData and registerForCycleEvents, this serves to exchange request-transient render-related data amongst parties, e.g.
 void releaseBackHandling(BackHandler backHandler)
          releases any back handler.
 void removeCycleListener(GenericEventListener gel)
           
 void sendCommandTo(Command wco)
           
 void setAjaxEnabled(boolean enabled)
           
 void setHighLightingEnabled(boolean enabled)
           
 void setRequiredRefreshInterval(int refreshInterval)
           
 void setShowDebugInfo(boolean showDebugInfo)
           
 void setShowJSON(boolean enabled)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWindow

public Window getWindow()
Specified by:
getWindow in interface WindowBackOffice
Returns:
the window associated

createDevelopmentController

public Controller createDevelopmentController(UserRequest ureq,
                                              WindowControl windowControl)
Specified by:
createDevelopmentController in interface WindowBackOffice
Returns:

getGlobalSettings

public GlobalSettings getGlobalSettings()
Specified by:
getGlobalSettings in interface WindowBackOffice
Returns:

createJSAndCSSAdder

public JSAndCSSAdderImpl createJSAndCSSAdder()
Returns:

sendCommandTo

public void sendCommandTo(Command wco)
Specified by:
sendCommandTo in interface WindowBackOffice
Parameters:
wco - the Command to be sent to the client (all requests are queued and sent in a batch at the end of the request)
See Also:
WindowBackOffice.sendCommandTo(org.olat.core.gui.control.winmgr.Command)

extractCommands

public MediaResource extractCommands(boolean wrapHTML)
Parameters:
wrapHTML -
Returns:

getInterceptHandler

public InterceptHandler getInterceptHandler()
Returns:

createDebugDispatcherController

public Controller createDebugDispatcherController(UserRequest ureq,
                                                  WindowControl windowControl)
Specified by:
createDebugDispatcherController in interface WindowBackOffice
Parameters:
ureq -
windowControl -
Returns:
the debug controller (not visible on screen, only in debug mode it wraps around each component for dispatching of gui debug info)

createInlineTranslationDispatcherController

public Controller createInlineTranslationDispatcherController(UserRequest ureq,
                                                              WindowControl windowControl)
Factory method to create the inline translation tool dispatcher controller. This implicitly sets the translation controller on the window back office

Specified by:
createInlineTranslationDispatcherController in interface WindowBackOffice
Parameters:
ureq -
windowControl -
Returns:

createAJAXController

public Controller createAJAXController(UserRequest ureq)
Specified by:
createAJAXController in interface WindowBackOffice
Returns:

isDebuging

public boolean isDebuging()
Specified by:
isDebuging in interface WindowBackOffice
Returns:

getWinmgrImpl

public WindowManagerImpl getWinmgrImpl()

dispose

public void dispose()
Description copied from interface: Disposable
disposes the disposable

Specified by:
dispose in interface Disposable

setAjaxEnabled

public void setAjaxEnabled(boolean enabled)
Parameters:
enabled -

setHighLightingEnabled

public void setHighLightingEnabled(boolean enabled)
Parameters:
enabled -

setShowJSON

public void setShowJSON(boolean enabled)
Parameters:
enabled -

setRequiredRefreshInterval

public void setRequiredRefreshInterval(int refreshInterval)
Parameters:
refreshInterval -

setShowDebugInfo

public void setShowDebugInfo(boolean showDebugInfo)
Parameters:
showDebugInfo -

getWindowManager

public WindowManager getWindowManager()
Specified by:
getWindowManager in interface WindowBackOffice

informControllerDispatched

public void informControllerDispatched(WindowControl wControl,
                                       Controller controller,
                                       Component source,
                                       Event event)
Specified by:
informControllerDispatched in interface WindowBackOffice

informControllerCreated

public void informControllerCreated(WindowControl wControl,
                                    Controller controller)
Specified by:
informControllerCreated in interface WindowBackOffice

browserBackOrForward

public void browserBackOrForward(UserRequest ureq,
                                 int diff)
diff == 0 -> reload (->ignore, so it will cause a simple rerendering)
diff < 0 -> browser-back
diff > 0 -> browser-forward

Parameters:
diff -

getBusinessControlPath

public java.lang.String getBusinessControlPath()
Specified by:
getBusinessControlPath in interface WindowBackOffice

getIframeTargetName

public java.lang.String getIframeTargetName()
Returns:

createGuiStack

public GuiStack createGuiStack(Component initialComponent)
Specified by:
createGuiStack in interface WindowBackOffice
Returns:

invokeLater

public void invokeLater(java.lang.Runnable runnable)
Description copied from interface: WindowBackOffice
Use this method for asynchronous updates to the gui.
invokes the runnable at a time when it is safe, that is the dispatching and rendering of the window is not disturbed.

Specified by:
invokeLater in interface WindowBackOffice
Parameters:
runnable - the runnable

fireCycleEvent

public void fireCycleEvent(Event cycleEvent)

addCycleListener

public void addCycleListener(GenericEventListener gel)
Description copied from interface: WindowBackOffice
not used normally! normally you do not have to care about when happens what - you should only need to know what to do in your event-methods of your controllers. when listeners want to be informed about cycles in the dispatching/validating/rendering

Specified by:
addCycleListener in interface WindowBackOffice
Parameters:
gel - the listener

removeCycleListener

public void removeCycleListener(GenericEventListener gel)
Specified by:
removeCycleListener in interface WindowBackOffice

getData

public java.lang.Object getData(java.lang.String key)
Description copied from interface: WindowBackOffice
gets the data

Specified by:
getData in interface WindowBackOffice
Parameters:
key - the key
Returns:
See Also:
WindowBackOffice.putData(String key, Object value)

putData

public void putData(java.lang.String key,
                    java.lang.Object value)
Description copied from interface: WindowBackOffice
together with getData and registerForCycleEvents, this serves to exchange request-transient render-related data amongst parties, e.g. layoutcontrollers telling the implementor of the windowcontrol/guimessage receiver where to visually put the guimessage.
all the data is clear before the inline-rendering-about-to-start event, since after that point no state change must occur.

Specified by:
putData in interface WindowBackOffice
Parameters:
key - the key (to be agreed upon by the inter-communicating parties)
value - any object

adjustGuiPathCenter

public void adjustGuiPathCenter(WindowControlInfo wci)
Specified by:
adjustGuiPathCenter in interface WindowBackOffice

acquireBackHandling

public void acquireBackHandling(BackHandler backHandler)
Description copied from interface: WindowBackOffice
when set, all browser-back and forward moves are sent to the backHandler instead of the ordinary handling (which reverts to the latest gui path in case of back). use when "critical" use cases/controllers are in progress, such as a qti-test where a (unintended) back-button-click should not leave the current workflow.
this method should be called from the constructor of the controller that wishes to control the back-handling.
an existing backhandler will be overridden, that is, only the latest set has any effect TODO: check if boolean (done/skip) instead of void makes sense here to backevent-bubble. or if the back-handlers should be stacked (what would be real use cases for such a thing?)

Specified by:
acquireBackHandling in interface WindowBackOffice

releaseBackHandling

public void releaseBackHandling(BackHandler backHandler)
Description copied from interface: WindowBackOffice
releases any back handler. must be called by a controller in its dispose method when it acquired a backhandling in its contructor.

Specified by:
releaseBackHandling in interface WindowBackOffice
Parameters:
backHandler - the backhandler to release