com.sdm.quasar.client.jsf.dialog
Class VisualRepresentation

java.lang.Object
  extended bycom.sdm.quasar.client.jsf.dialog.VisualRepresentation

public class VisualRepresentation
extends java.lang.Object

This represents a visual representation of a dialog, e.g. the displayed jsp, facelet, .. . It is definde by the #presentationURI and is connected to a dialog of the given #dialogInstanceId. In addition bookmarks can be set at this VisualRepresentation.

The VisualRepresentation is shown or hidden at a BrowserWindow. Normally show the VisualRepresentation when the dialog is activated and hide it when deactivated.

Vice versa, you can register an VisualRepresentation.VisualRepresentationListener to be informed when your VisualRepresentation is left or reentered at the browser window due to activating an other dialog or due to browser navigation

Author:
Martin Haft

Nested Class Summary
static interface VisualRepresentation.VisualRepresentationListener
           Register a VisualRepresentationListener at a VisualRepresentation if you want to be informed when the VisualRepresentation is entered or left by browser navigation or when an other dialog is shown (and this dialog is left) or hidden (and this dialog is entered).
 
Constructor Summary
VisualRepresentation(java.lang.String presentationURI, DialogInstanceId dialogInstanceId)
          Constructos a new VisualRepresentation.
 
Method Summary
protected  void addedAt(BrowserWindow browserWindow)
          Callback from the BrowserWindow informing, that the VisualRepresentation is added and normally shwon at the BrowserWindow.
 void addVisualRepresentationListener(VisualRepresentation.VisualRepresentationListener listener)
          Add a VisualRepresentation.VisualRepresentationListener to this VisualRepresentation.
 java.lang.String buildActionURL(java.lang.String requestContextPath)
          Build the action url based on the given requestContextPath.
 java.lang.String buildIdFromPostParameters()
          The VisualRepresentationId is provided as token.
 boolean equals(java.lang.Object obj)
           
 java.util.Properties getBookmarkParameters()
           
 DialogInstanceId getDialogInstanceId()
           
 java.lang.String getPresentationURI()
           
protected  VisualRepresentationId getVisualRepresentationId()
          The VisualRepresentationId of the VisualRepresentation is build and returned
 int hashCode()
           
 boolean isShowing()
           
protected  boolean isShowingElsewhere(BrowserWindow browserWindow)
           
protected  void notifyPageUnvisible()
           
protected  void notifyPageVisible()
           
protected  void pageEnteredAt(BrowserWindow browserWindow)
          Callback from the BrowserWindow informing, that the VisualRepresentation is visible again at the BrowserWindow due to browser naivigation or because a VisualRepresentation is hidden and this VisualRepresentation is the next to be shown.
protected  void pageLeftAt(BrowserWindow browserWindow)
          Callback from the BrowserWindow informing, that the VisualRepresentation is left at the BrowserWindow due to browser navigation or because an other VisualRepresentation is shwn.
 void removeChangeListener(VisualRepresentation.VisualRepresentationListener listener)
          Remove a VisualRepresentation.VisualRepresentationListener from this VisualRepresentation.
protected  void removedAt(BrowserWindow browserWindow)
          Callback from the BrowserWindow informing, that the VisualRepresentation is removed from the BrowserWindow.
 void setBookmarkParameters(java.util.Properties bookmarkParameters)
          Sets the bookmark parameters: the aarameters will be addad as get parameters to the url.
 void setPresentationURI(java.lang.String presentationURI)
          Sets the Url of the page, which is represented by this VisualRepresentation.
 java.lang.String toString()
           
 void writePostParameters(UIComponent component, ResponseWriter writer)
          The post parameters are supplemented by the VisualRepresentationId and written to the request (normally as hidden fields).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VisualRepresentation

public VisualRepresentation(java.lang.String presentationURI,
                            DialogInstanceId dialogInstanceId)
Constructos a new VisualRepresentation.

Parameters:
presentationURI - The Url of the page, which is represented by this VisualRepresentation.
dialogInstanceId - The Id of the dialog connected to the VisualRepresentation
Method Detail

getDialogInstanceId

public DialogInstanceId getDialogInstanceId()
Returns:
The Id of the dialog connected to the VisualRepresentation

getPresentationURI

public java.lang.String getPresentationURI()
Returns:
The Url of the page, which is represented by this VisualRepresentation.

getBookmarkParameters

public java.util.Properties getBookmarkParameters()
Returns:
Parameters that will be addad as get parameters to the url. Use these parameters for bookmarking. Null, if no bookmarking parameters are needed.

setBookmarkParameters

public void setBookmarkParameters(java.util.Properties bookmarkParameters)
Sets the bookmark parameters: the aarameters will be addad as get parameters to the url. Use these parameters for bookmarking. Null, if no bookmarking parameters are needed. Note: If a value of a property is no string, the toString method will be invoked to get the parameter value.

Parameters:
bookmarkParameters - the bookmark parameters

buildActionURL

public java.lang.String buildActionURL(java.lang.String requestContextPath)
Build the action url based on the given requestContextPath. The url is supplemeted by the #presentationURI and by the get parameters consistiong out of the VisualRepresentationId and the #bookmarkParameters.

Returns:
the supplemented action url

writePostParameters

public void writePostParameters(UIComponent component,
                                ResponseWriter writer)
                         throws java.io.IOException
The post parameters are supplemented by the VisualRepresentationId and written to the request (normally as hidden fields).

Throws:
java.io.IOException

getVisualRepresentationId

protected VisualRepresentationId getVisualRepresentationId()
The VisualRepresentationId of the VisualRepresentation is build and returned

Returns:
the VisualRepresentationId of the VisualRepresentation.

buildIdFromPostParameters

public java.lang.String buildIdFromPostParameters()
The VisualRepresentationId is provided as token. This may be added to the view or to links. Thus the VisualRepresentation may be reconstructed based on the view id or when a link pointing to this VisualRepresentation is fired. The former can be used when no JacaScript is valid.

Returns:
VisualRepresentationId as token

setPresentationURI

public void setPresentationURI(java.lang.String presentationURI)
Sets the Url of the page, which is represented by this VisualRepresentation.

Parameters:
presentationURI - Url of the page, which is represented by this VisualRepresentation.

addedAt

protected void addedAt(BrowserWindow browserWindow)
Callback from the BrowserWindow informing, that the VisualRepresentation is added and normally shwon at the BrowserWindow.

Parameters:
browserWindow - the BrowserWindow, this VisualRepresentation is addad at

removedAt

protected void removedAt(BrowserWindow browserWindow)
Callback from the BrowserWindow informing, that the VisualRepresentation is removed from the BrowserWindow.

Parameters:
browserWindow - the BrowserWindow, this VisualRepresentation is removed from

pageEnteredAt

protected void pageEnteredAt(BrowserWindow browserWindow)
Callback from the BrowserWindow informing, that the VisualRepresentation is visible again at the BrowserWindow due to browser naivigation or because a VisualRepresentation is hidden and this VisualRepresentation is the next to be shown.

Parameters:
browserWindow - the BrowserWindow, this VisualRepresentation shown again

pageLeftAt

protected void pageLeftAt(BrowserWindow browserWindow)
Callback from the BrowserWindow informing, that the VisualRepresentation is left at the BrowserWindow due to browser navigation or because an other VisualRepresentation is shwn.

Parameters:
browserWindow - the BrowserWindow, this VisualRepresentation shown again

isShowing

public boolean isShowing()
Returns:
true if the VisualRepresentation is currently shown at at least one BrowserWindow

isShowingElsewhere

protected boolean isShowingElsewhere(BrowserWindow browserWindow)

notifyPageVisible

protected void notifyPageVisible()

notifyPageUnvisible

protected void notifyPageUnvisible()

addVisualRepresentationListener

public void addVisualRepresentationListener(VisualRepresentation.VisualRepresentationListener listener)
Add a VisualRepresentation.VisualRepresentationListener to this VisualRepresentation.

Parameters:
listener - the Listener to add

removeChangeListener

public void removeChangeListener(VisualRepresentation.VisualRepresentationListener listener)
Remove a VisualRepresentation.VisualRepresentationListener from this VisualRepresentation.

Parameters:
listener - the Listener to remove

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)

toString

public java.lang.String toString()