EchoPoint
1.0

echopoint
Class JspTemplatePanel

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Panel
          extended byechopoint.Panel
              extended byechopoint.ScrollablePanel
                  extended byechopoint.JspTemplatePanel
All Implemented Interfaces:
Borderable, Clippable, LayoutManageable, MouseCursorable, Positionable, ReflectionSetter, Scrollable, ScrollableContainer, java.io.Serializable

public class JspTemplatePanel
extends ScrollablePanel

Generates content from a JSP page and adds it as a component. Echo components can also be added to the JSP.

This component uses an underlying JspTemplateLayoutManager class as the basis for providing JSP support.

Author:
Sam Taha (tahasam@yahoo.com)
See Also:
for more details on how to use this component.

Most of the methods in this class are convenience methods to the JspTemplateLayoutManager equivalents., Serialized Form


Nested Class Summary
 
Nested classes inherited from class echopoint.positionable.ScrollableContainer
ScrollableContainer.NestedStyleInfo
 
Nested classes inherited from class echopoint.positionable.MouseCursorable
MouseCursorable.NestedStyleInfo
 
Field Summary
static java.lang.String JSPBEAN_CHANGE_PROPERTY
          The JSP beans have changed
 
Fields inherited from class echopoint.ScrollablePanel
DEFAULT_POSITONABLE_POLICY, DEFAULT_SCROLLBAR_POLICY
 
Fields inherited from class nextapp.echo.Panel
DEFAULT_INSETS, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, INSETS_CHANGED_PROPERTY, STYLE_HORIZONTAL_ALIGNMENT, STYLE_INSETS, STYLE_VERTICAL_ALIGNMENT, VERTICAL_ALIGNMENT_CHANGED_PROPERTY
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.ScrollableContainer
HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, INSETS_CHANGED_PROPERTY, STYLE_HORIZONTAL_ALIGNMENT, STYLE_INSETS, STYLE_VERTICAL_ALIGNMENT, VERTICAL_ALIGNMENT_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.Scrollable
HEIGHT_CHANGED_PROPERTY, SCROLL_BAR_X_CHANGED_PROPERTY, SCROLL_BAR_Y_CHANGED_PROPERTY, SCROLLBAR_POLICY_CHANGED_PROPERTY, SCROLLBARS_ALWAYS, SCROLLBARS_AUTO, SCROLLBARS_CLIPHIDE, SCROLLBARS_NEVER, STYLE_HEIGHT, STYLE_SCROLL_BAR_POLICY, STYLE_WIDTH, UNDEFINED, undefinedSymbolic, WIDTH_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.Positionable
POSITION_CHANGED_PROPERTY, POSITIONING_ABSOLUTE, POSITIONING_FLOW, POSITIONING_RELATIVE, positioningSymbolics, STYLE_BOTTOM, STYLE_LEFT, STYLE_POSITIONING, STYLE_RIGHT, STYLE_TOP, STYLE_ZINDEX, UNDEFINED, undefinedSymbolic
 
Fields inherited from interface echopoint.positionable.Clippable
CLIP_RECT_CHANGED_PROPERTY, STYLE_CLIP_RECT
 
Fields inherited from interface echopoint.positionable.Borderable
BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_GROOVE, BORDER_INSET, BORDER_NONE, BORDER_OUTSET, BORDER_RIDGE, BORDER_SOLID, borderStyleSymbolics, STYLE_BORDER_COLOR, STYLE_BORDER_SIZE, STYLE_BORDER_STYLE, STYLE_BOTTOM_BORDER_COLOR, STYLE_BOTTOM_BORDER_SIZE, STYLE_BOTTOM_BORDER_STYLE, STYLE_LEFT_BORDER_COLOR, STYLE_LEFT_BORDER_SIZE, STYLE_LEFT_BORDER_STYLE, STYLE_RIGHT_BORDER_COLOR, STYLE_RIGHT_BORDER_SIZE, STYLE_RIGHT_BORDER_STYLE, STYLE_TOP_BORDER_COLOR, STYLE_TOP_BORDER_SIZE, STYLE_TOP_BORDER_STYLE
 
Fields inherited from interface echopoint.layout.LayoutManageable
LAYOUT_MANAGED_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.MouseCursorable
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI
 
Constructor Summary
JspTemplatePanel()
          This default constructor creates a JspTemplatePanel with a default path of "index.jsp".
JspTemplatePanel(java.lang.String path)
          This constructor will allow for multiple beans to be passed to the JSP using the addJspBeanGenerator methods.
JspTemplatePanel(java.lang.String path, java.lang.Object bean, java.lang.String beanName)
          This constuctor allows for only one bean to be passed the JSP.
 
Method Summary
 void addBean(java.lang.Object bean, java.lang.String beanName)
           
 void addJspBeanGenerator(JspBeanGenerator beanGen, java.lang.String beanName)
           
 java.lang.Object getBean()
           
 java.lang.Object getBean(java.lang.String beanName)
           
 java.lang.String getBeanName()
           
 java.util.Map getBeans()
           
 java.util.Map getJspBeanGenerators()
           
 java.lang.String getPath()
          Location of the JSP file.
 boolean isLoudErrorsUsed()
          This returns true if "loud" error messages are to be used during template compilation.
 void removeAllBeans()
           
 void removeAllJspBeanGenerator()
           
 void removeBean(java.lang.String beanName)
           
 void removeJspBeanGenerator(java.lang.String beanName)
           
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setBean(java.lang.Object bean)
           
 void setBeans(java.util.Map beanMap)
           
 void setLayoutManager(LayoutManager newLayoutManager)
          Sets a new LayoutManager into the LayoutManageable container.
 void setLoudErrorsUsed(boolean b)
          Controls whether loud error messages are to be used during template compilation.
 void setPath(java.lang.String path)
          Set/Change the location of the JSP file.
 
Methods inherited from class echopoint.ScrollablePanel
applyStyle, clearPositioning, getBottom, getClipRect, getHeight, getLeft, getPositioning, getRight, getScreenHeight, getScreenWidth, getScrollBarPolicy, getScrollBarX, getScrollBarY, getTop, getWidth, getzIndex, isPositioned, setBottom, setClipRect, setClipRect, setClipRect, setHeight, setLeft, setPositioning, setRight, setScrollBarPolicy, setScrollBarX, setScrollBarY, setTop, setWidth, setzIndex
 
Methods inherited from class echopoint.Panel
add, add, add, add, addImpl, getBorderColor, getBorderSize, getBorderStyle, getBottomBorderColor, getBottomBorderSize, getBottomBorderStyle, getLayoutManager, getLeftBorderColor, getLeftBorderSize, getLeftBorderStyle, getMouseCursor, getMouseCursorURI, getRightBorderColor, getRightBorderSize, getRightBorderStyle, getTopBorderColor, getTopBorderSize, getTopBorderStyle, remove, remove, setBorderColor, setBorderSize, setBorderStyle, setBottomBorderColor, setBottomBorderSize, setBottomBorderStyle, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setMouseCursor, setMouseCursorURI, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setTopBorderColor, setTopBorderSize, setTopBorderStyle
 
Methods inherited from class nextapp.echo.Panel
getHorizontalAlignment, getInsets, getVerticalAlignment, setHorizontalAlignment, setInsets, setVerticalAlignment
 
Methods inherited from class nextapp.echo.Component
addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface echopoint.positionable.ScrollableContainer
getHorizontalAlignment, getInsets, getVerticalAlignment, setHorizontalAlignment, setInsets, setVerticalAlignment
 
Methods inherited from interface echopoint.positionable.Borderable
getBorderColor, getBorderSize, getBorderStyle, getBottomBorderColor, getBottomBorderSize, getBottomBorderStyle, getLeftBorderColor, getLeftBorderSize, getLeftBorderStyle, getRightBorderColor, getRightBorderSize, getRightBorderStyle, getTopBorderColor, getTopBorderSize, getTopBorderStyle, setBorderColor, setBorderSize, setBorderStyle, setBottomBorderColor, setBottomBorderSize, setBottomBorderStyle, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setTopBorderColor, setTopBorderSize, setTopBorderStyle
 
Methods inherited from interface echopoint.layout.LayoutManageable
add, add, add, add, getLayoutManager, remove, remove
 

Field Detail

JSPBEAN_CHANGE_PROPERTY

public static final java.lang.String JSPBEAN_CHANGE_PROPERTY
The JSP beans have changed

See Also:
Constant Field Values
Constructor Detail

JspTemplatePanel

public JspTemplatePanel()
This default constructor creates a JspTemplatePanel with a default path of "index.jsp".


JspTemplatePanel

public JspTemplatePanel(java.lang.String path)
This constructor will allow for multiple beans to be passed to the JSP using the addJspBeanGenerator methods. JspBeanGenerators can be added removed as needed.

Parameters:
path - Location of the JSP file.

JspTemplatePanel

public JspTemplatePanel(java.lang.String path,
                        java.lang.Object bean,
                        java.lang.String beanName)
This constuctor allows for only one bean to be passed the JSP. The bean can be reset using the setBean method.

Parameters:
path - Location of the JSP file.
bean - JavaBean to be used in JSP.
beanName - Name that will be used within the JSP to read the bean from request scope.
Method Detail

addJspBeanGenerator

public void addJspBeanGenerator(JspBeanGenerator beanGen,
                                java.lang.String beanName)
See Also:
JspTemplateLayoutManager.addJspBeanGenerator(JspBeanGenerator, String)

addBean

public void addBean(java.lang.Object bean,
                    java.lang.String beanName)
See Also:
JspTemplateLayoutManager.addBean(Object, String)

getBean

public java.lang.Object getBean()
See Also:
JspTemplateLayoutManager.getBean()

getBean

public java.lang.Object getBean(java.lang.String beanName)
See Also:
JspTemplateLayoutManager.getBean(String)

getBeanName

public java.lang.String getBeanName()
See Also:
JspTemplateLayoutManager.getBeanName()

getJspBeanGenerators

public java.util.Map getJspBeanGenerators()
See Also:
JspTemplateLayoutManager.getJspBeanGenerators()

getBeans

public java.util.Map getBeans()
See Also:
JspTemplateLayoutManager.getBeans()

getPath

public java.lang.String getPath()
Location of the JSP file.


removeAllJspBeanGenerator

public void removeAllJspBeanGenerator()
See Also:
JspTemplateLayoutManager.removeAllJspBeanGenerator()

removeJspBeanGenerator

public void removeJspBeanGenerator(java.lang.String beanName)
See Also:
JspTemplateLayoutManager.removeJspBeanGenerator(String)

removeBean

public void removeBean(java.lang.String beanName)
See Also:
JspTemplateLayoutManager.removeBean(String)

removeAllBeans

public void removeAllBeans()
See Also:
JspTemplateLayoutManager.removeAllBeans()

setBean

public void setBean(java.lang.Object bean)
See Also:
JspTemplateLayoutManager.setBean(Object)

setBeans

public void setBeans(java.util.Map beanMap)
See Also:
JspTemplateLayoutManager.setBeans(Map)

setLayoutManager

public void setLayoutManager(LayoutManager newLayoutManager)
Sets a new LayoutManager into the LayoutManageable container. This must non null and an JspTemplateLayoutManager otherwise an IllegalArgumentException is thrown.

Specified by:
setLayoutManager in interface LayoutManageable
Overrides:
setLayoutManager in class Panel
See Also:
LayoutManageable.setLayoutManager(echopoint.layout.LayoutManager)

setPath

public void setPath(java.lang.String path)
Set/Change the location of the JSP file.


isLoudErrorsUsed

public boolean isLoudErrorsUsed()
This returns true if "loud" error messages are to be used during template compilation.

Returns:
true if lound error messages are to be displayed

setLoudErrorsUsed

public void setLoudErrorsUsed(boolean b)
Controls whether loud error messages are to be used during template compilation.


set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Overrides:
set in class ScrollablePanel
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0