Esri Geoportal Server
1.0

com.esri.gpt.control.view
Class PageCursorPanel

java.lang.Object
  extended by com.esri.gpt.control.view.PageCursorPanel

public class PageCursorPanel
extends Object

Provides support for binding a page cursor associated with a query result to an HtmlPanelGroup.

The cursor requires message resource keys. All resource keys used are prefixed with the supplied resourceKeyPrefix property (the default value is "general.pageCursor.").

The following resource keys are used by the cursor:
nomatch results first previous next last

Examples:
catalog.general.pageCursor.nomatch = No matching records were located.
catalog.general.pageCursor.results = Results {0}-{1} of {2} record(s)
catalog.general.pageCursor.first = First
catalog.general.pageCursor.previous = <
catalog.general.pageCursor.next = >
catalog.general.pageCursor.last = Last

The "results" resource key is record (not page based) and takes the following 3 arguments:
The starting record for the current page, the ending record for the current page and the total number of records.


Constructor Summary
PageCursorPanel()
          Default constructor.
 
Method Summary
 void build()
          Builds the components of the top and bottom HtmlPanelGroup based upon the content of the PageCursor.
 boolean checkActionEvent(ActionEvent event, boolean resetPageIfNot)
          Checks an action event to determine if this is a page cursor navigation event.
 String getActionListenerExpression()
          Gets the expression used to bind generated command links to the controller.
 HtmlPanelGroup getBottomHtmlPanelGroup()
          Gets the bound HtmlPanelGroup for the bottom portion of the page.
 String getChangeListenerExpression()
           
 String getCommandAttributeName()
          Gets the name of the attribute used to indicate the command that should be executed.
 String getCommandAttributeValue()
          Gets value of the command attribute indicating that a page cursor navigation event has occurred.
 String getCurrentStyleClass()
          Gets the style class associated with the current page.
 String getCursorPageAttributeName()
          Gets the name of the attribute used to indicate the cursor page.
 PageCursor getPageCursor()
          Gets the underlying page cursor.
 String getResourceKeyPrefix()
          Gets the resource key prefix to be used when generating UI components.
 String getResultStyleClass()
          Gets the style class associated with the result text.
 HtmlPanelGroup getTopHtmlPanelGroup()
          Gets the bound HtmlPanelGroup for the top portion of the page.
 void onChange(ValueChangeEvent event)
          Calles when record per page has changed.
 void setActionListenerExpression(String expression)
          Sets the expression used to bind generated command links to the controller.
 void setBottomHtmlPanelGroup(HtmlPanelGroup htmlPanelGroup)
          Sets the bound HtmlPanelGroup for the bottom portion of the page.
 void setChangeListenerExpression(String expression)
           
 void setCommandAttributeName(String name)
          Sets the name of the attribute used to indicate the command that should be executed.
 void setCommandAttributeValue(String value)
          Sets value of the command attribute indicating that a page cursor navigation event has occurred.
 void setCurrenStyleClass(String styleClass)
          Sets the style class associated with the current page.
 void setCursorPageAttributeName(String name)
          Sets the name of the attribute used to indicate the cursor page.
 void setPageCursor(PageCursor cursor)
          Sets the underlying page cursor.
 void setResourceKeyPrefix(String resourceKeyPrefix)
          Sets the resource key prefix to be used when generating UI components.
 void setResultStyleClass(String styleClass)
          Sets the style class associated with the result text.
 void setTopHtmlPanelGroup(HtmlPanelGroup htmlPanelGroup)
          Sets the bound HtmlPanelGroup for the top portion of the page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageCursorPanel

public PageCursorPanel()
Default constructor.

Method Detail

getActionListenerExpression

public String getActionListenerExpression()
Gets the expression used to bind generated command links to the controller.
Typically the expression will have the following form:
#{SomeController.processAction}

Returns:
the action listener binding expression

setActionListenerExpression

public void setActionListenerExpression(String expression)
Sets the expression used to bind generated command links to the controller.
Typically the expression will have the following form:
#{SomeController.processAction}

Parameters:
expression - the action listener binding expression

getChangeListenerExpression

public String getChangeListenerExpression()

setChangeListenerExpression

public void setChangeListenerExpression(String expression)

getBottomHtmlPanelGroup

public HtmlPanelGroup getBottomHtmlPanelGroup()
Gets the bound HtmlPanelGroup for the bottom portion of the page.
This object is used during the Faces component binding process.

Returns:
the bound HtmlPanelGroup

setBottomHtmlPanelGroup

public void setBottomHtmlPanelGroup(HtmlPanelGroup htmlPanelGroup)
Sets the bound HtmlPanelGroup for the bottom portion of the page.
This object is used during the Faces component binding process.

Parameters:
htmlPanelGroup - the bound HtmlPanelGroup

getCommandAttributeName

public String getCommandAttributeName()
Gets the name of the attribute used to indicate the command that should be executed.
The default value is "command".

Returns:
the command attribute name

setCommandAttributeName

public void setCommandAttributeName(String name)
Sets the name of the attribute used to indicate the command that should be executed.
The default value is "command".

Parameters:
name - the command attribute name

getCommandAttributeValue

public String getCommandAttributeValue()
Gets value of the command attribute indicating that a page cursor navigation event has occurred.
The default value is "setCursorPage".

Returns:
the command attribute value for a page cursor navigation event

setCommandAttributeValue

public void setCommandAttributeValue(String value)
Sets value of the command attribute indicating that a page cursor navigation event has occurred.
The default value is "setCursorPage".

Parameters:
value - the command attribute value for a page cursor navigation event

getCurrentStyleClass

public String getCurrentStyleClass()
Gets the style class associated with the current page.
The default value is "current".

Returns:
the current page style class

setCurrenStyleClass

public void setCurrenStyleClass(String styleClass)
Sets the style class associated with the current page.
The default value is "current".

Parameters:
styleClass - the current page style class

getCursorPageAttributeName

public String getCursorPageAttributeName()
Gets the name of the attribute used to indicate the cursor page.
The default value is "cursorPage".

Returns:
the cursor page attribute name

setCursorPageAttributeName

public void setCursorPageAttributeName(String name)
Sets the name of the attribute used to indicate the cursor page.
The default value is "cursorPage".

Parameters:
name - the cursor page attribute name

getPageCursor

public PageCursor getPageCursor()
Gets the underlying page cursor.
The page cursor UI will be generated from the content of this cursor.

Returns:
the page cursor

setPageCursor

public void setPageCursor(PageCursor cursor)
Sets the underlying page cursor.
The page cursor UI will be generated from the content of this cursor.
Setting the page cursor triggers the building of the HtmlPanelGroup UI components.
This method should be invoked immediately following the generation of query results.

Parameters:
cursor - the page cursor

getResourceKeyPrefix

public String getResourceKeyPrefix()
Gets the resource key prefix to be used when generating UI components.
The default value is "general.pageCursor.".

Returns:
the resource key prefix

setResourceKeyPrefix

public void setResourceKeyPrefix(String resourceKeyPrefix)
Sets the resource key prefix to be used when generating UI components.
The default value is "general.pageCursor.".

Parameters:
resourceKeyPrefix - the resource key prefix

getResultStyleClass

public String getResultStyleClass()
Gets the style class associated with the result text.
The result text takes the form:
Results 1-10 of 61 record(s)
The default value is "result".

Returns:
the result text style class

setResultStyleClass

public void setResultStyleClass(String styleClass)
Sets the style class associated with the result text.
The result text takes the form:
Results 1-10 of 61 record(s)
The default value is "result".

Parameters:
styleClass - the result text style class

getTopHtmlPanelGroup

public HtmlPanelGroup getTopHtmlPanelGroup()
Gets the bound HtmlPanelGroup for the top portion of the page.
This object is used during the Faces component binding process.

Returns:
the bound HtmlPanelGroup

setTopHtmlPanelGroup

public void setTopHtmlPanelGroup(HtmlPanelGroup htmlPanelGroup)
Sets the bound HtmlPanelGroup for the top portion of the page.
This object is used during the Faces component binding process.

Parameters:
htmlPanelGroup - the bound HtmlPanelGroup

build

public void build()
Builds the components of the top and bottom HtmlPanelGroup based upon the content of the PageCursor.


onChange

public void onChange(ValueChangeEvent event)
Calles when record per page has changed.

Parameters:
event - event

checkActionEvent

public boolean checkActionEvent(ActionEvent event,
                                boolean resetPageIfNot)
Checks an action event to determine if this is a page cursor navigation event.
If so, the current page of the associated page cursor is set.
This method will not re-execute a query, it will simply reset the current page.
To rebuild the underlying UI components, user the setPageCursor() or build() methods.

Parameters:
event - the associated JSF action event
resetPageIfNot - if true, reset the current page to 1 if this was not a page cursor navigation event
Returns:
true page cursor event detected

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.