org.lobobrowser.main
Class Extension

java.lang.Object
  extended by org.lobobrowser.main.Extension
All Implemented Interfaces:
java.lang.Comparable, NavigatorExtensionContext

public class Extension
extends java.lang.Object
implements java.lang.Comparable, NavigatorExtensionContext

Encapsulates a browser extension or plugin.


Field Summary
static int HIGH_PRIORITY
          The highest priority allowed for non-primary platform extensions.
static int LOW_PRIORITY
          The minimum priority.
static int NORMAL_PRIORITY
          The default priority.
static int PRIMARY_EXTENSION_PRIORITY
          The highest priority, only available to the default platform extension.
 
Constructor Summary
Extension(java.io.File extRoot)
           
 
Method Summary
 void addClientletSelector(ClientletSelector cs)
          Adds a clientlet selector.
 void addConnectionProcessor(ConnectionProcessor processor)
          Adds an object that can view connections made by the browser and potentially modify their headers and other data.
 void addNavigationListener(NavigationListener listener)
          Adds a global listener of navigation events.
 void addNavigatorErrorListener(NavigatorErrorListener listener)
          Adds a listener of navigator events.
 void addURLStreamHandlerFactory(java.net.URLStreamHandlerFactory factory)
          Registers a URL stream handler factory which may be used to implement custom protocols.
 void close()
           
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object other)
           
 java.lang.ClassLoader getClassLoader()
           
 Clientlet getClientlet(ClientletRequest request, ClientletResponse response)
           
 java.net.URL getCodeSource()
           
 java.lang.String getId()
           
 Clientlet getLastResortClientlet(ClientletRequest request, ClientletResponse response)
           
 NavigatorExtension getNavigatorExtension()
          Gets the NavigatorExtension implementation.
 UserAgent getUserAgent()
          Gets the UserAgent instance associated with this context.
 boolean handleError(NavigatorExceptionEvent event)
           
 int hashCode()
           
 void initClassLoader(java.lang.ClassLoader parentClassLoader)
           
 void initExtension()
           
 void initExtensionWindow(NavigatorWindow wcontext)
           
 boolean isLibraryOnly()
           
 boolean isPrimaryExtension()
           
 void removeClientletSelector(ClientletSelector selector)
           
 void removeConnectionProcessor(ConnectionProcessor processor)
           
 void removeNavigationListener(NavigationListener listener)
           
 void removeNavigatorErrorListener(NavigatorErrorListener listener)
          Removes a listener of navigation events.
 void shutdownExtensionWindow(NavigatorWindow wcontext)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOW_PRIORITY

public static final int LOW_PRIORITY
The minimum priority.

See Also:
Constant Field Values

PRIMARY_EXTENSION_PRIORITY

public static final int PRIMARY_EXTENSION_PRIORITY
The highest priority, only available to the default platform extension.

See Also:
Constant Field Values

HIGH_PRIORITY

public static final int HIGH_PRIORITY
The highest priority allowed for non-primary platform extensions.

See Also:
Constant Field Values

NORMAL_PRIORITY

public static final int NORMAL_PRIORITY
The default priority.

See Also:
Constant Field Values
Constructor Detail

Extension

public Extension(java.io.File extRoot)
          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getId

public java.lang.String getId()

getCodeSource

public java.net.URL getCodeSource()
                           throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

isPrimaryExtension

public boolean isPrimaryExtension()

isLibraryOnly

public boolean isLibraryOnly()

initClassLoader

public void initClassLoader(java.lang.ClassLoader parentClassLoader)
                     throws java.net.MalformedURLException,
                            java.lang.ClassNotFoundException,
                            java.lang.IllegalAccessException,
                            java.lang.InstantiationException
Throws:
java.net.MalformedURLException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException

getClassLoader

public java.lang.ClassLoader getClassLoader()

getNavigatorExtension

public NavigatorExtension getNavigatorExtension()
Gets the NavigatorExtension implementation. It may return null in the case of a library.


initExtension

public void initExtension()

initExtensionWindow

public void initExtensionWindow(NavigatorWindow wcontext)

shutdownExtensionWindow

public void shutdownExtensionWindow(NavigatorWindow wcontext)

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

addClientletSelector

public void addClientletSelector(ClientletSelector cs)
Description copied from interface: org.lobobrowser.ua.NavigatorExtensionContext
Adds a clientlet selector. This is how platform extensions register additional content handlers.

Specified by:
addClientletSelector in interface NavigatorExtensionContext

getClientlet

public Clientlet getClientlet(ClientletRequest request,
                              ClientletResponse response)

getLastResortClientlet

public Clientlet getLastResortClientlet(ClientletRequest request,
                                        ClientletResponse response)

addNavigatorErrorListener

public void addNavigatorErrorListener(NavigatorErrorListener listener)
Description copied from interface: org.lobobrowser.ua.NavigatorExtensionContext
Adds a listener of navigator events.

Specified by:
addNavigatorErrorListener in interface NavigatorExtensionContext

removeNavigatorErrorListener

public void removeNavigatorErrorListener(NavigatorErrorListener listener)
Description copied from interface: org.lobobrowser.ua.NavigatorExtensionContext
Removes a listener of navigation events.

Specified by:
removeNavigatorErrorListener in interface NavigatorExtensionContext

handleError

public boolean handleError(NavigatorExceptionEvent event)
Parameters:
event -
Returns:
True only if the event was dispatched to at least one listener.

addURLStreamHandlerFactory

public void addURLStreamHandlerFactory(java.net.URLStreamHandlerFactory factory)
Description copied from interface: org.lobobrowser.ua.NavigatorExtensionContext
Registers a URL stream handler factory which may be used to implement custom protocols. Note that Java platform protocols (HTTP, HTTPS, etc.) or protocols defined by extensions with higher priority cannot be overridden. The factory must return null if it does not know how to handle a particular protocol.

Specified by:
addURLStreamHandlerFactory in interface NavigatorExtensionContext
Parameters:
factory - An implementation of java.net.URLStreamHandlerFactory.

getUserAgent

public UserAgent getUserAgent()
Description copied from interface: org.lobobrowser.ua.NavigatorExtensionContext
Gets the UserAgent instance associated with this context.

Specified by:
getUserAgent in interface NavigatorExtensionContext

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addConnectionProcessor

public void addConnectionProcessor(ConnectionProcessor processor)
Description copied from interface: org.lobobrowser.ua.NavigatorExtensionContext
Adds an object that can view connections made by the browser and potentially modify their headers and other data.

Specified by:
addConnectionProcessor in interface NavigatorExtensionContext
Parameters:
processor - An connection processor.

addNavigationListener

public void addNavigationListener(NavigationListener listener)
Description copied from interface: org.lobobrowser.ua.NavigatorExtensionContext
Adds a global listener of navigation events.

Specified by:
addNavigationListener in interface NavigatorExtensionContext
Parameters:
listener - The listener.

removeClientletSelector

public void removeClientletSelector(ClientletSelector selector)
Specified by:
removeClientletSelector in interface NavigatorExtensionContext

removeConnectionProcessor

public void removeConnectionProcessor(ConnectionProcessor processor)
Specified by:
removeConnectionProcessor in interface NavigatorExtensionContext

removeNavigationListener

public void removeNavigationListener(NavigationListener listener)
Specified by:
removeNavigationListener in interface NavigatorExtensionContext


SourceForge.net LogoCopyright © 2005, 2006, 2007 The Lobo Project. All Rights Reserved.
[Lobo Home]