com.sdm.quasar.client.jsf.dialog.features
Class BrowserWindowFeature

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialog.AbstractFeature
      extended bycom.sdm.quasar.client.jsf.dialog.features.BrowserWindowFeature
All Implemented Interfaces:
BrowserWindowManagerService, BrowserWindowService, Feature, ResponseParameterService, Service, SystemInfoProvider

public class BrowserWindowFeature
extends AbstractFeature
implements BrowserWindowService, ResponseParameterService, BrowserWindowManagerService


Field Summary
 java.lang.String DEFAULT_WINDOW_ID
           
 
Constructor Summary
BrowserWindowFeature()
           
 
Method Summary
 java.lang.String buildActionURL(java.lang.String requestContextPath)
          Request to build the action url based upon the given path
 java.lang.String buildIdFromPostParameters()
          Builds a token out of the post parameters.
protected  void dispose()
          Called when the feature or dialog is disposed.
protected  BrowserWindow[] getAllBrowserWindows()
           
 BrowserWindow getCurrentBrowserWindow()
           
protected  java.lang.String getCurrentWindowId()
           
 GetParameters getGetParameters()
           
 PostParameters getPostParameters()
           
 boolean hasBrowserWindow(java.lang.String browserWindowId)
           
 void hideVisualRepresentation(VisualRepresentation representation, boolean recreate)
          Hides the VisualRepresentation at all BrowserWindows with hide and reopen or hide an and do not show again strategy
 void hideVisualRepresentation(VisualRepresentation representation, boolean recreate, java.lang.String redirectUrl, java.lang.String replacingDialogId, java.lang.Object context)
           
 void hideVisualRepresentation(VisualRepresentation representation, java.lang.String redirectUrl)
          Hides the VisualRepresentation at all BrowserWindows.
 void hideVisualRepresentation(VisualRepresentation representation, java.lang.String replacingDialogId, java.lang.Object context)
          Hides the VisualRepresentation at all BrowserWindows. with hide and replace by an other dielog strategy
protected  void init()
          Called when the feature is initializing.
 void registerNewBrowserWindow(java.lang.String browserWiondowId)
           
 java.lang.String setCurrentBrowserWindow(java.lang.String browserWindowId)
           
protected  void setCurrentWindowId(java.lang.String currentWindowId)
           
 void showVisualRepresentation(VisualRepresentation representation)
          Show the VisualRepresentation at the current BrowserWindow
 void showVisualRepresentation(VisualRepresentation representation, boolean modal)
          Show the VisualRepresentation at the current BrowserWindow
 void writePostParameters(UIComponent component, ResponseWriter writer)
          wites the post parameters as hidden fields to the page
 
Methods inherited from class com.sdm.quasar.client.core.dialog.AbstractFeature
activate, attachDialogControl, collectSystemInfo, deactivate, disposeFeature, getDialogControl, isInitialized, prepare, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WINDOW_ID

public java.lang.String DEFAULT_WINDOW_ID
Constructor Detail

BrowserWindowFeature

public BrowserWindowFeature()
Method Detail

dispose

protected void dispose()
                throws DisposeException
Description copied from class: AbstractFeature
Called when the feature or dialog is disposed. Override this method to clean up resources and free memory when disposing.

Specified by:
dispose in class AbstractFeature
Throws:
DisposeException

init

protected void init()
Description copied from class: AbstractFeature
Called when the feature is initializing. This is normally done, when the feature is connected to the lifecycle of the DialogControl installed to. To access the DialogControl use the AbstractFeature.getDialogControl() method.

Override this method to perform some action on initialization e.g. register public services.

Specified by:
init in class AbstractFeature

hideVisualRepresentation

public void hideVisualRepresentation(VisualRepresentation representation,
                                     boolean recreate)
Description copied from interface: BrowserWindowService
Hides the VisualRepresentation at all BrowserWindows with hide and reopen or hide an and do not show again strategy

Specified by:
hideVisualRepresentation in interface BrowserWindowService
Parameters:
representation - the VisualRepresentation to hide.
recreate - true: hide and reopen strategy; false: hide an and do not show again strategy
See Also:
com.sdm.quasar.client.jsf.dialog.services.BrowserWindowService#hideRepresentation(com.sdm.quasar.client.jsf.dialog.VisualRepresentation, java.lang.String)

hideVisualRepresentation

public void hideVisualRepresentation(VisualRepresentation representation,
                                     java.lang.String redirectUrl)
Description copied from interface: BrowserWindowService
Hides the VisualRepresentation at all BrowserWindows. with hide and replace by an other page strategy

Specified by:
hideVisualRepresentation in interface BrowserWindowService
Parameters:
representation - the VisualRepresentation to hide.
redirectUrl - the url used to redirect to the replacing page
See Also:
com.sdm.quasar.client.jsf.dialog.services.BrowserWindowService#hideRepresentation(com.sdm.quasar.client.jsf.dialog.VisualRepresentation, java.lang.String)

hideVisualRepresentation

public void hideVisualRepresentation(VisualRepresentation representation,
                                     java.lang.String replacingDialogId,
                                     java.lang.Object context)
Description copied from interface: BrowserWindowService
Hides the VisualRepresentation at all BrowserWindows. with hide and replace by an other dielog strategy

Specified by:
hideVisualRepresentation in interface BrowserWindowService
Parameters:
representation - the VisualRepresentation to hide.
replacingDialogId - the dialog id of the dialog to be shown instead of this VisualRepresentation
context - an optionally context to be used when creation the replacing dialog, may be null
See Also:
BrowserWindowService.hideVisualRepresentation(com.sdm.quasar.client.jsf.dialog.VisualRepresentation, java.lang.String, java.lang.Object)

hideVisualRepresentation

public void hideVisualRepresentation(VisualRepresentation representation,
                                     boolean recreate,
                                     java.lang.String redirectUrl,
                                     java.lang.String replacingDialogId,
                                     java.lang.Object context)

showVisualRepresentation

public void showVisualRepresentation(VisualRepresentation representation)
Description copied from interface: BrowserWindowService
Show the VisualRepresentation at the current BrowserWindow

Specified by:
showVisualRepresentation in interface BrowserWindowService
Parameters:
representation - the VisualRepresentation be shown.

showVisualRepresentation

public void showVisualRepresentation(VisualRepresentation representation,
                                     boolean modal)
Description copied from interface: BrowserWindowService
Show the VisualRepresentation at the current BrowserWindow

Specified by:
showVisualRepresentation in interface BrowserWindowService
Parameters:
representation - the VisualRepresentation be shown.
modal - true if the VisualRepresentation will be modal.

getCurrentBrowserWindow

public BrowserWindow getCurrentBrowserWindow()
Specified by:
getCurrentBrowserWindow in interface BrowserWindowManagerService
See Also:
BrowserWindowManagerService.getCurrentBrowserWindow()

hasBrowserWindow

public boolean hasBrowserWindow(java.lang.String browserWindowId)
Specified by:
hasBrowserWindow in interface BrowserWindowManagerService
See Also:
BrowserWindowManagerService.hasBrowserWindow(java.lang.String)

registerNewBrowserWindow

public void registerNewBrowserWindow(java.lang.String browserWiondowId)
Specified by:
registerNewBrowserWindow in interface BrowserWindowManagerService
See Also:
BrowserWindowManagerService.registerNewBrowserWindow(java.lang.String)

setCurrentBrowserWindow

public java.lang.String setCurrentBrowserWindow(java.lang.String browserWindowId)
Specified by:
setCurrentBrowserWindow in interface BrowserWindowManagerService
See Also:
BrowserWindowManagerService.setCurrentBrowserWindow(java.lang.String)

getAllBrowserWindows

protected BrowserWindow[] getAllBrowserWindows()

buildActionURL

public java.lang.String buildActionURL(java.lang.String requestContextPath)
Description copied from interface: ResponseParameterService
Request to build the action url based upon the given path

Specified by:
buildActionURL in interface ResponseParameterService
Parameters:
requestContextPath - the base path
Returns:
the build action url
See Also:
ResponseParameterService.buildActionURL(java.lang.String)

buildIdFromPostParameters

public java.lang.String buildIdFromPostParameters()
Description copied from interface: ResponseParameterService
Builds a token out of the post parameters. This is used as fall back when the values of the hidden fields are not passed by every submit, e.g. when no JavaScript is valid

Specified by:
buildIdFromPostParameters in interface ResponseParameterService
Returns:
the token
See Also:
ResponseParameterService.buildIdFromPostParameters()

writePostParameters

public void writePostParameters(UIComponent component,
                                ResponseWriter writer)
                         throws java.io.IOException
Description copied from interface: ResponseParameterService
wites the post parameters as hidden fields to the page

Specified by:
writePostParameters in interface ResponseParameterService
Throws:
java.io.IOException
See Also:
com.sdm.quasar.client.jsf.dialog.services.ResponseParameterService#writePostParameters(javax.faces.component.UIComponent, javax.faces.context.ResponseWriter)

getCurrentWindowId

protected java.lang.String getCurrentWindowId()

setCurrentWindowId

protected void setCurrentWindowId(java.lang.String currentWindowId)

getGetParameters

public GetParameters getGetParameters()
Specified by:
getGetParameters in interface ResponseParameterService
Returns:
the GetParameters for the response

getPostParameters

public PostParameters getPostParameters()
Specified by:
getPostParameters in interface ResponseParameterService
Returns:
The PostParameters for the response