ice.storm
Class Viewport

java.lang.Object
  extended byice.storm.Viewport
Direct Known Subclasses:
EmbeddedObject

public class Viewport
extends Object

This class represents a Viewport (html-frame). It can have children viewports (acts as a frameset), or embedded viewports (up to the pilot, ala IFRAME in html4).


Field Summary
protected  Container container
           
protected  Viewport parent
           
protected  Pilot pilot
           
 
Constructor Summary
Viewport(StormBase storm)
          Create a new viewport nameless viewport
Viewport(StormBase storm, String name)
          Create a new viewport
 
Method Summary
 void addChild(Viewport v)
          Add a child viewport (used during config phase only)
 Object addOnloadBlocker(Object blocker)
           
 void addPropertyChangeListener(PropertyChangeListener l)
          Add a property change listener for this view and all its descendents
protected  void dispose()
           
 Viewport findImmediateChild(String s)
          Find immediate child by name
 Viewport findViewportByName(String s)
          Find viewport by name (check this viewport and all its children)
 Viewport findViewportInTreeByName(String name)
          Look for closest viewport with given name in a whole viewport tree.
 String getBaseUrl()
          Get URL that should be used to resolve relative URLs.
 URL getBaseURL()
          Deprecated. Use getBaseUrl()
 Viewport getChildByIndex(int index)
          Get child viewport with given `index' or null if `index' is outside of [0..getChildrenCount()).
 Enumeration getChildren()
          Get a enumaration of children viewports.
 int getChildrenCount()
          Get number of immediate children
 Container getContainer()
          Get graphical container that this viewport lives in
 Viewport getContextViewport()
           
 int getDocumentId()
          Get number id of the current document
 DynamicObject getDocumentObject()
           
 DynamicObject getDynamicWrapper()
          Deprecated. Use getWindowObj() instead
 Viewport getFirstChild()
          Get first child viewport
 ViewportGuiParams getGuiParams()
           
 String getId()
          Get unique ID of this viewport
 Viewport getImmediateChildWithProperty(Object key, Object value)
          Find an immediate child whose property value for `key' is `value'
 String getLocation()
           
 String getName()
          Get name of this viewport
 Viewport getNextSibling()
          Get next sibling
 Viewport getParent()
          Get the parent viewport of this viewport.
 Pilot getParentChainPilot()
          Return pilot if non null otherwise recursively query parent chain
 Pilot getPilot()
           
 Component getPilotComponent()
          Get graphical component of the pilot
 Object getProperty(Object key)
           
 Container getTopLevelContainer()
          Get top-most ancestor of this viewport's container
 Viewport getTopParent()
          Get top-level parent for this viewport.
 void getViewAndAllChildren(Vector buffer)
          Append to `buffer' this view and all its children recursively
 DynamicObject getWindowObj()
           
 int getZoom()
           
 boolean isFrameArrayMember()
           
 boolean isStopRequested()
           
 boolean isSyntheticName()
          Check if the result of getName() is synthetic.
 boolean isTopLevel()
          Returns true if this is a top-level viewport
 void iterate(ViewportVisitor vc)
          Iterates over current viewport and all its children, issuing a callback for each viewport to the given ViewportVisitor.
 void removeOnloadBlocker(Object sessionObj, Object blocker)
           
protected  void removePilot()
           
 void removePilotComponent()
           
 void removeProperty(Object key)
           
 void removePropertyChangeListener(PropertyChangeListener l)
          Remove property change listener
protected  void scheduleValidate(Component c)
           
 void setBaseUrl(String url)
           
 void setContainer(Container c)
          Initialize this viewport and all its children.
 void setFrameArrayMember()
           
 void setGuiParams(ViewportGuiParams value)
           
 void setLocationUrl(String url)
           
 void setName(String s)
          Set the name of this viewport
protected  void setPilot(Pilot p)
           
 void setProperty(Object key, Object value)
          Note: If value can not be null.
 void setZoom(int z)
          Set zoom value for this viewport and all its descendents
 String toString()
           
 void viewportLayout(int x, int y, int w, int h)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected Viewport parent

container

protected Container container

pilot

protected Pilot pilot
Constructor Detail

Viewport

public Viewport(StormBase storm)
Create a new viewport nameless viewport


Viewport

public Viewport(StormBase storm,
                String name)
Create a new viewport

Parameters:
name - name of the viewport
Method Detail

toString

public String toString()

getId

public final String getId()
Get unique ID of this viewport


getName

public final String getName()
Get name of this viewport


isSyntheticName

public final boolean isSyntheticName()
Check if the result of getName() is synthetic. The name is synthetic if it was generated by the browser, ant set via document tags or by scripts


setName

public void setName(String s)
Set the name of this viewport


getDocumentId

public int getDocumentId()
Get number id of the current document


setZoom

public void setZoom(int z)
Set zoom value for this viewport and all its descendents

Parameters:
z - zoom value: 128 - 50%, 256 - 100%, 512 - 200%

getZoom

public int getZoom()

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener for this view and all its descendents


removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Remove property change listener


getContainer

public Container getContainer()
Get graphical container that this viewport lives in


getTopLevelContainer

public Container getTopLevelContainer()
Get top-most ancestor of this viewport's container


setContainer

public void setContainer(Container c)
Initialize this viewport and all its children.


setProperty

public void setProperty(Object key,
                        Object value)
Note: If value can not be null. Use DynEnv.DYNAMIC_NULL or similar tag instead


removeProperty

public void removeProperty(Object key)

getProperty

public Object getProperty(Object key)

getGuiParams

public ViewportGuiParams getGuiParams()

setGuiParams

public void setGuiParams(ViewportGuiParams value)

isStopRequested

public boolean isStopRequested()

getNextSibling

public Viewport getNextSibling()
Get next sibling


getFirstChild

public Viewport getFirstChild()
Get first child viewport


addChild

public void addChild(Viewport v)
Add a child viewport (used during config phase only)


getChildren

public Enumeration getChildren()
Get a enumaration of children viewports. or null is there are no children


getChildrenCount

public int getChildrenCount()
Get number of immediate children


getChildByIndex

public Viewport getChildByIndex(int index)
Get child viewport with given `index' or null if `index' is outside of [0..getChildrenCount()). Note that after any change in viewport hierarchy index mapping between indexes and viewports can change in arbitrary way.


getParent

public Viewport getParent()
Get the parent viewport of this viewport. Returns null if no parent is present (toplevel viewport)


getTopParent

public Viewport getTopParent()
Get top-level parent for this viewport. Returns this if the viewport has no parent


isTopLevel

public boolean isTopLevel()
Returns true if this is a top-level viewport


iterate

public void iterate(ViewportVisitor vc)
Iterates over current viewport and all its children, issuing a callback for each viewport to the given ViewportVisitor. Note that the iteration is done on the calling thread.


getViewAndAllChildren

public void getViewAndAllChildren(Vector buffer)
Append to `buffer' this view and all its children recursively


findViewportByName

public Viewport findViewportByName(String s)
Find viewport by name (check this viewport and all its children)


findImmediateChild

public Viewport findImmediateChild(String s)
Find immediate child by name


getImmediateChildWithProperty

public Viewport getImmediateChildWithProperty(Object key,
                                              Object value)
Find an immediate child whose property value for `key' is `value'


findViewportInTreeByName

public Viewport findViewportInTreeByName(String name)
Look for closest viewport with given name in a whole viewport tree. Treat the following names specially: _top refers to tree root, _self refers to this view, _parent refers to parent view.


getPilotComponent

public Component getPilotComponent()
Get graphical component of the pilot


getPilot

public Pilot getPilot()

getParentChainPilot

public Pilot getParentChainPilot()
Return pilot if non null otherwise recursively query parent chain


setPilot

protected void setPilot(Pilot p)

scheduleValidate

protected void scheduleValidate(Component c)
Parameters:
c - The container to validate

removePilot

protected void removePilot()

dispose

protected void dispose()

removePilotComponent

public void removePilotComponent()

viewportLayout

public void viewportLayout(int x,
                           int y,
                           int w,
                           int h)

getLocation

public String getLocation()

setLocationUrl

public void setLocationUrl(String url)

getBaseURL

public URL getBaseURL()
Deprecated. Use getBaseUrl()


getBaseUrl

public String getBaseUrl()
Get URL that should be used to resolve relative URLs. It can be different from getLocation(), for example, in HTML documents that specify the base tag.


setBaseUrl

public void setBaseUrl(String url)

getDynamicWrapper

public DynamicObject getDynamicWrapper()
Deprecated. Use getWindowObj() instead


getWindowObj

public final DynamicObject getWindowObj()

getContextViewport

public Viewport getContextViewport()

getDocumentObject

public DynamicObject getDocumentObject()

isFrameArrayMember

public boolean isFrameArrayMember()

setFrameArrayMember

public void setFrameArrayMember()

addOnloadBlocker

public final Object addOnloadBlocker(Object blocker)

removeOnloadBlocker

public final void removeOnloadBlocker(Object sessionObj,
                                      Object blocker)