ice.pilots.html4
Class ThePilot

java.lang.Object
  extended byice.storm.Pilot
      extended byice.pilots.html4.ThePilot

public class ThePilot
extends Pilot


Field Summary
static boolean viewNoframes
           
 
Constructor Summary
ThePilot()
           
 
Method Summary
static void addColorDefinition(String name, Color color)
          Use to extend default color definitons.
 void addPersistentDOMEventListener(String type, EventListener listener, boolean useCapture)
          Register DOM event listener to the llist of listeners that are called for any event of the given type generated by the browser by this pilot instance.
protected  boolean allowedToRunHandler(DOMEvent de, DNode node)
           
 void applySnapshot(Object snapshot)
          Applies the specified snapshot to this ThePilot's DDocument in order to recreate the state represented by the snapshot.
 void beforeUnload()
           
 void clear(String contentType)
          Clear the displayed content
 void clearSelection()
          Clears the selected text highlighting.
 Component createComponent()
          Ask the pilot to create its GUI.
protected  ice.pilots.html4.CSSLayout createCSSLayout(String media, DDocument doc)
          Create a new CSSManager
 StormPrinter createPrinter()
          Create a new instance of a StormPrinter.
 void dispose()
          When the pilot is no longer needed, the system calls this method to allow the pilot to get rid of all resources it has been using.
protected  void evalScriptHandlerListeners(DNode node, DOMEvent domEvent, Object handler)
           
 Object execDynamicMethodOnWindow(DynamicObject window, String name, Object[] args, DynEnv env)
           
 DDocument getDDocument()
           
 DefaultEventHandler getDefaultEventHandler()
           
 DocPane getDocPane()
           
 Document getDocument()
          Get DOM Document that represents the content loaded into this pilot.
 Dimension getDocumentDimension(Dimension rv)
          Deprecated. Use Pilot.getDocPane(), and DocPane.getDocWidth() and DocPane.getDocHeight().
 DynamicObject getDocumentObject()
          Get pilot notion of a document object for scripters
 Object getDynamicValueOnWindow(DynamicObject window, String name, DynEnv env)
           
 String getEncoding()
          Get encoding.
 String getPageInfo(String name)
          Get a named HTTP header that arrived when loading this page
protected  DynamicObject getScriptHandlerThis(DNode node, DOMEvent domEvent)
           
 Search getSearch()
          Perform search
 String getSelectedText()
          Get selected text
 Object getSnapshot()
          Creates a snapshot of this ThePilot's DDocument in order to preserve its state.
static DStyleSheet getUserStyleSheet(StormBase storm)
          Return the default user stylesheet.
 TheView getView()
          Get layout information (default view) of the DOM document in this pilot.
 Dimension getViewDimension(Dimension rv)
          Deprecated. Use Pilot.getDocPane(), and DocPane.getPaneWidth() and DocPane.getPaneHeight().
 void gotoRef(String ref)
          If the Storm is asked to go to a URL with a Ref and the pilot is already displaing the URL, this method will be called to tell the pilot to go to a Ref in the document.
 void init(String componentToolkitName)
          Initialize a pilot.
 boolean isDisposed()
           
 boolean isSelectionActive()
          Determine if a text selection range is active in the viewport managed by this pilot
 void onLoadingDone()
           
 void onLowMemory()
          Tells the pilot to free resources while still be somewhat useful
 void parse(ContentLoader cl)
          Parse the data from the ContentLoader
 void parsingDone()
          This method is used by StormBase to notify that it has successfully completed parsing and sent propertychange "contentLoading=end".
protected  void processFrameset()
           
 boolean refExists(String ref)
           
 void refresh()
          This one can be called when e.g a lightweight pilot change it size, or something else out side the pilot context that require the pilot to redraw itself.
 void removePersistentDOMEventListener(String type, EventListener listener, boolean useCapture)
          Remove DOM event listener from the list of listeners that are called for any event of the given type generated by the browser by this pilot instance.
 void resume()
          Tells the pilot to wake up from the "suspend" mode.
protected  Object script_createActiveXObject(String resource)
           
protected  Object script_createOption(Object[] args)
           
protected  Object script_getDOMImplementation()
           
 void setDefaultEventHandler(DefaultEventHandler handler)
           
 int setDynamicValueOnWindow(DynamicObject window, String name, Object value, DynEnv env)
           
 void setEncoding(String enc)
          Set encoding.
protected  void setZoom(int z)
          Set zooming value.
 void stopImageAnimation()
           
 void stopLoading()
          Tells the pilot to stop loading
 void suspend()
          Tells the pilot to go into "suspend" mode and use as little resources as possible.
 void updateFrameList()
          Make sure that storm has proper list of child vieports representing all frame objects that should be visible to scripts.
 
Methods inherited from class ice.storm.Pilot
findOrCreateViewport, findOrCreateViewport, firePropertyChange, getAllPilotInstances, getPilotViewport, getStorm, getUrlMaster, getViewportContainer, getViewportId, getViewportProperty, isDetached, isStopRequested, modifiedByScript, refreshViewport, renderContent, viewportBecameActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewNoframes

public static final boolean viewNoframes
Constructor Detail

ThePilot

public ThePilot()
Method Detail

init

public void init(String componentToolkitName)
Description copied from class: Pilot
Initialize a pilot. After the pilot class is loaded this method, is the first one to get called. It provides the pilot with the context information as well as the name of the viewoprt it is in.

Overrides:
init in class Pilot
Parameters:
componentToolkitName - pilot context

isDisposed

public final boolean isDisposed()

beforeUnload

public void beforeUnload()
Overrides:
beforeUnload in class Pilot

dispose

public void dispose()
Description copied from class: Pilot
When the pilot is no longer needed, the system calls this method to allow the pilot to get rid of all resources it has been using. After a call to this method th epilot will no longer be used.

Overrides:
dispose in class Pilot

createCSSLayout

protected ice.pilots.html4.CSSLayout createCSSLayout(String media,
                                                     DDocument doc)
Create a new CSSManager


getDocumentDimension

public Dimension getDocumentDimension(Dimension rv)
Deprecated. Use Pilot.getDocPane(), and DocPane.getDocWidth() and DocPane.getDocHeight().


getViewDimension

public Dimension getViewDimension(Dimension rv)
Deprecated. Use Pilot.getDocPane(), and DocPane.getPaneWidth() and DocPane.getPaneHeight().


setEncoding

public void setEncoding(String enc)
Set encoding.


getEncoding

public String getEncoding()
Get encoding.


getPageInfo

public String getPageInfo(String name)
Get a named HTTP header that arrived when loading this page


createComponent

public Component createComponent()
Description copied from class: Pilot
Ask the pilot to create its GUI. Note that some lightweight pilots may return null

Overrides:
createComponent in class Pilot

createPrinter

public StormPrinter createPrinter()
Create a new instance of a StormPrinter. A StormPrinter object is only returned if the pilot contains a valid HTML document, null otherwise.

Overrides:
createPrinter in class Pilot
Returns:
a new StormPrinter object for the Pilot, if the pilot is not valid a null value is returned

refExists

public boolean refExists(String ref)
Overrides:
refExists in class Pilot

gotoRef

public void gotoRef(String ref)
Description copied from class: Pilot
If the Storm is asked to go to a URL with a Ref and the pilot is already displaing the URL, this method will be called to tell the pilot to go to a Ref in the document.

Overrides:
gotoRef in class Pilot

getDocument

public final Document getDocument()
Get DOM Document that represents the content loaded into this pilot.


getDDocument

public DDocument getDDocument()

getView

public TheView getView()
Get layout information (default view) of the DOM document in this pilot.


getDocPane

public DocPane getDocPane()
Overrides:
getDocPane in class Pilot

getSelectedText

public String getSelectedText()
Get selected text


isSelectionActive

public boolean isSelectionActive()
Determine if a text selection range is active in the viewport managed by this pilot

Returns:
true if selection is currently active
Since:
6.1

clearSelection

public void clearSelection()
Clears the selected text highlighting.


getSearch

public Search getSearch()
Perform search


refresh

public void refresh()
Description copied from class: Pilot
This one can be called when e.g a lightweight pilot change it size, or something else out side the pilot context that require the pilot to redraw itself.

Overrides:
refresh in class Pilot

setZoom

protected void setZoom(int z)
Description copied from class: Pilot
Set zooming value. 256 means 100%, 128 means 50% etc

Overrides:
setZoom in class Pilot

suspend

public void suspend()
Description copied from class: Pilot
Tells the pilot to go into "suspend" mode and use as little resources as possible.

Overrides:
suspend in class Pilot

resume

public void resume()
Description copied from class: Pilot
Tells the pilot to wake up from the "suspend" mode.

Overrides:
resume in class Pilot

clear

public void clear(String contentType)
Description copied from class: Pilot
Clear the displayed content

Overrides:
clear in class Pilot

stopImageAnimation

public void stopImageAnimation()

stopLoading

public void stopLoading()
Description copied from class: Pilot
Tells the pilot to stop loading

Overrides:
stopLoading in class Pilot

onLowMemory

public void onLowMemory()
Description copied from class: Pilot
Tells the pilot to free resources while still be somewhat useful

Overrides:
onLowMemory in class Pilot

addPersistentDOMEventListener

public void addPersistentDOMEventListener(String type,
                                          EventListener listener,
                                          boolean useCapture)
Register DOM event listener to the llist of listeners that are called for any event of the given type generated by the browser by this pilot instance. The following event types are supported:

Parameters:
type - The event type for which the user is registering
listener - The listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs.
useCapture - If true, listener will be called before the capture phase of event dispatch, otherwise it will be called after the bubbling phase.
See Also:
DNode.addEventListener(java.lang.String, org.w3c.dom.events.EventListener, boolean), removePersistentDOMEventListener(java.lang.String, org.w3c.dom.events.EventListener, boolean)

removePersistentDOMEventListener

public void removePersistentDOMEventListener(String type,
                                             EventListener listener,
                                             boolean useCapture)
Remove DOM event listener from the list of listeners that are called for any event of the given type generated by the browser by this pilot instance.


getDefaultEventHandler

public DefaultEventHandler getDefaultEventHandler()

setDefaultEventHandler

public void setDefaultEventHandler(DefaultEventHandler handler)

parse

public void parse(ContentLoader cl)
           throws IOException
Description copied from class: Pilot
Parse the data from the ContentLoader

Overrides:
parse in class Pilot
Throws:
IOException

parsingDone

public void parsingDone()
This method is used by StormBase to notify that it has successfully completed parsing and sent propertychange "contentLoading=end".

Overrides:
parsingDone in class Pilot

onLoadingDone

public void onLoadingDone()
Overrides:
onLoadingDone in class Pilot

processFrameset

protected void processFrameset()

allowedToRunHandler

protected boolean allowedToRunHandler(DOMEvent de,
                                      DNode node)

getScriptHandlerThis

protected DynamicObject getScriptHandlerThis(DNode node,
                                             DOMEvent domEvent)

evalScriptHandlerListeners

protected void evalScriptHandlerListeners(DNode node,
                                          DOMEvent domEvent,
                                          Object handler)

addColorDefinition

public static void addColorDefinition(String name,
                                      Color color)
Use to extend default color definitons. Typical usage would be:
 addColorDefinition("silver", new Color(0xC0,0xC0,0xC0));
 
Note however that this entry is already present by default.


getUserStyleSheet

public static DStyleSheet getUserStyleSheet(StormBase storm)
Return the default user stylesheet. This CSS could be used to apply user-defined styles, like default font, how links will look etc


script_createOption

protected Object script_createOption(Object[] args)

script_createActiveXObject

protected Object script_createActiveXObject(String resource)

script_getDOMImplementation

protected Object script_getDOMImplementation()

getDocumentObject

public final DynamicObject getDocumentObject()
Description copied from class: Pilot
Get pilot notion of a document object for scripters

Overrides:
getDocumentObject in class Pilot

updateFrameList

public void updateFrameList()
Description copied from class: Pilot
Make sure that storm has proper list of child vieports representing all frame objects that should be visible to scripts.

Overrides:
updateFrameList in class Pilot

getDynamicValueOnWindow

public Object getDynamicValueOnWindow(DynamicObject window,
                                      String name,
                                      DynEnv env)
Overrides:
getDynamicValueOnWindow in class Pilot

setDynamicValueOnWindow

public int setDynamicValueOnWindow(DynamicObject window,
                                   String name,
                                   Object value,
                                   DynEnv env)
Overrides:
setDynamicValueOnWindow in class Pilot

execDynamicMethodOnWindow

public Object execDynamicMethodOnWindow(DynamicObject window,
                                        String name,
                                        Object[] args,
                                        DynEnv env)
Overrides:
execDynamicMethodOnWindow in class Pilot

applySnapshot

public void applySnapshot(Object snapshot)

Applies the specified snapshot to this ThePilot's DDocument in order to recreate the state represented by the snapshot.

Overrides:
applySnapshot in class Pilot
Parameters:
snapshot - the snapshot to be applied to this ThePilot's DDocument.
See Also:
getSnapshot()

getSnapshot

public Object getSnapshot()

Creates a snapshot of this ThePilot's DDocument in order to preserve its state.

Overrides:
getSnapshot in class Pilot
Returns:
the created snapshot.
See Also:
applySnapshot(Object)