org.lobobrowser.gui
Class FramePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.lobobrowser.gui.FramePanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, NavigatorFrame

public class FramePanel
extends javax.swing.JPanel
implements NavigatorFrame

A browser frame panel. It may be used as any other Swing component. The navigate(String) method may be invoked to load content into the browser frame.

Content types supported depend on available browser extensions.

It's recommended that FramePanels be placed in windows that extend AbstractBrowserWindow or implement BrowserWindow. Such windows may receive navigation notifications via WindowCallback.

A frame panel with navigation controls and a status bar can be obtained with BrowserPanel.

See Also:
PlatformInit.init(boolean, boolean), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FramePanel()
          Constructs a standalone FramePanel that can be added to any Swing window or component.
FramePanel(FramePanel parentFrame)
          Constructs a FramePanel specifying a non-null parent frame.
FramePanel(java.lang.String windowId)
          Constructs a FramePanel specifying a "window" ID.
 
Method Summary
 void addContentListener(ContentListener listener)
          Adds a listener of content events.
protected  void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
           
 void addNavigationListener(NavigationListener listener)
          Adds a listener of navigation events.
 void addResponseListener(ResponseListener listener)
          Adds a listener of response events.
 void alert(java.lang.String message)
          Opens an alert dialog.
 boolean back()
          Navigates back.
 boolean canBack()
          Determines whether the frame can navigate back.
 boolean canCopy()
          Determines whether there's a selection with content to be copied in this frame.
 boolean canForward()
          Determines whether the frame can navigate forward.
 boolean canReload()
          Determines whether the current document can be reloaded.
 void clear()
          Clears current content.
 void closeWindow()
          Closes the window this frame belongs to.
 boolean confirm(java.lang.String message)
          Opens a confirmation dialog.
 boolean copy()
          Copies the selection, if any, to the clipboard.
 NavigatorFrame createFrame()
          Creates a frame that is expected to be used as a child of the current one.
 NetworkRequest createNetworkRequest()
          Creates a NetworkRequest object that can be used to load data over HTTP and other network protocols.
 boolean forward()
          Navigates forward.
 NavigationEntry[] getBackNavigationEntries()
          Gets an array of navigation entries that came before the current one.
 java.awt.Component getComponent()
          Implements NavigatorFrame.getComponent().
 ComponentContent getComponentContent()
          Gets the component content currently set in the frame.
 java.lang.Object getContentObject()
          Gets an object that is used to represent the current frame content.
 java.lang.String getCurrentMimeType()
          Gets a mime type that goes with the object returned by getContentObject().
 NavigationEntry getCurrentNavigationEntry()
          Gets the current navigation entry.
 java.lang.String getDefaultStatus()
          Gets the default window status.
 NavigationEntry[] getForwardNavigationEntries()
          Gets an array of navigation entries that would be visited with consecutive forward calls.
 int getHistoryLength()
          Gets the length for the frame's history.
 java.lang.Object getItem(java.lang.String name)
           
 java.awt.Dimension getMaximumSize()
           
 java.awt.Dimension getMinimumSize()
           
 NavigationEntry getNextNavigationEntry()
           
 NavigatorFrame getOpenerFrame()
          Gets the frame that opened the current frame, if any.
 NavigatorFrame getParentFrame()
          Gets the parent frame.
 java.awt.Dimension getPreferredSize()
           
 NavigationEntry getPreviousNavigationEntry()
           
 NavigatorProgressEvent getProgressEvent()
          Gets the most recent progress event.
 java.lang.String getSourceCode()
          Gets source code for content currently showing, if any.
 java.lang.String getStatus()
          Gets the current window status.
 NavigatorFrame getTopFrame()
          Gets the top-most frame in a window.
 java.awt.Window getTopFrameWindow()
           
protected  WindowCallback getWindowCallback()
          Gets a WindowCallback instance that is used to dispatch information during local navigation.
 java.lang.String getWindowId()
          Gets the window ID if this is the top frame in a window.
 boolean goTo(NavigationEntry entry)
          Navigates to the given entry without adding the entry to frame history.
 boolean hasSource()
          Determines if the current navigation entry has associated source code.
 void informResponseProcessed(ClientletResponse response)
          Causes an event to be fired.
 void invokeLater(java.lang.Runnable runnable)
          Implements NavigatorFrame.invokeLater(Runnable).
protected  boolean isOKToAddReferrer(RequestType requestType)
           
 boolean isWindowClosed()
          Determines if the window is closed.
 void linkClicked(java.net.URL url, TargetType targetType, java.lang.Object linkObject)
          Similar to NavigatorFrame.navigate(java.net.URL, String, ParameterInfo, TargetType, RequestType), except this method should be called when navigation is triggered by a user click.
 void moveInHistory(int offset)
          Switches to a new navigation entry in the frame's history, according to the given offset.
 void navigate(java.lang.String urlOrPath)
          Navigates to a URL in the current frame.
 void navigate(java.lang.String urlOrPath, RequestType requestType)
          Navigates to a URL in the current frame.
 void navigate(java.net.URL url)
          Navigates to a URL in the current frame.
 void navigate(java.net.URL url, RequestType requestType)
          Navigates to a URL in the current frame.
 void navigate(java.net.URL url, java.lang.String method, ParameterInfo paramInfo, TargetType type, RequestType requestType)
          Navigates to a URL in the current frame.
 void navigate(java.net.URL url, java.lang.String method, ParameterInfo paramInfo, TargetType type, RequestType requestType, NavigatorFrame originatingFrame)
          Navigates to a URL in the current frame.
 void navigateInHistory(java.lang.String absoluteURL)
          Navigates to a URL that exists in the frame's history.
 NavigatorFrame open(java.lang.String urlOrPath)
          Opens a window and renders the URL or path provided.
 NavigatorFrame open(java.net.URL url)
          Opens a window and renders the URL provided.
 NavigatorFrame open(java.net.URL url, java.util.Properties windowProperties)
          Opens a window and renders the URL provided.
 NavigatorFrame open(java.net.URL url, java.lang.String method, ParameterInfo pinfo)
          Opens a window and renders the URL provided.
 NavigatorFrame open(java.net.URL url, java.lang.String method, ParameterInfo pinfo, java.lang.String windowId, java.util.Properties windowProperties)
          Opens a window and renders the URL provided.
 NavigatorFrame open(java.net.URL url, java.lang.String windowId, java.util.Properties windowProperties)
          Opens a window and renders the URL provided.
static NavigatorFrame openWindow(FramePanel opener, java.net.URL url, java.lang.String windowId, java.util.Properties windowProperties, java.lang.String method, ParameterInfo pinfo)
          Static method for opening a window.
 void paint(java.awt.Graphics g)
           
 java.lang.String prompt(java.lang.String message, java.lang.String inputDefault)
          Opens a message prompt dialog.
 void reload()
          Reloads the current document.
 void remove(java.awt.Component comp)
           
 void remove(int index)
           
 void removeAll()
           
 void removeContentListener(ContentListener listener)
          Removes a listener of content events previously added with addNavigationListener(NavigationListener).
 void removeNavigationListener(NavigationListener listener)
          Removes a listener of navigation events previously added with addNavigationListener(NavigationListener).
 void removeResponseListener(ResponseListener listener)
          Removes a listener of navigation events previously added with addNavigationListener(NavigationListener).
 void replaceContent(ClientletResponse response, ComponentContent content)
          Replaces the content of the frame.
 void replaceContent(java.awt.Component component)
          A simple alternative to NavigatorFrame.replaceContent(org.lobobrowser.clientlet.ClientletResponse, org.lobobrowser.clientlet.ComponentContent) provided for convenience.
protected  void replaceContentImpl(ClientletResponse response, ComponentContent content)
           
 void resizeWindowBy(int byWidth, int byHeight)
          Resizes the browser window.
 void resizeWindowTo(int width, int height)
          Resizes the browser window.
 void setDefaultStatus(java.lang.String value)
          Sets the default window status.
 void setItem(java.lang.String name, java.lang.Object value)
           
 void setOpenerFrame(NavigatorFrame opener)
           
 void setProgressEvent(NavigatorProgressEvent event)
          Requests the frame to update its progress state.
 void setProperty(java.lang.String name, java.lang.Object value)
          Sets an implementation-dependent property of the underlying component currently rendered.
 void setStatus(java.lang.String status)
          Sets the window status.
 void setTopFrameWindow(java.awt.Window topFrameWindow)
           
 java.lang.String toString()
           
 void windowToBack()
          Sends the window to the back (blur).
 void windowToFront()
          Sends the window to the front and grabs focus for the frame.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FramePanel

public FramePanel(java.lang.String windowId)
Constructs a FramePanel specifying a "window" ID.


FramePanel

public FramePanel(FramePanel parentFrame)
Constructs a FramePanel specifying a non-null parent frame. This constructor is useful when navigation in the new frame must occur before the frame is added to the GUI component hierarchy.


FramePanel

public FramePanel()
Constructs a standalone FramePanel that can be added to any Swing window or component. Note that the FramePanel should be part of a Swing or AWT window before it becomes functional.

Method Detail

setOpenerFrame

public void setOpenerFrame(NavigatorFrame opener)

informResponseProcessed

public void informResponseProcessed(ClientletResponse response)
Causes an event to be fired. This method is for internal use.

Parameters:
response - A clientlet response.

addNavigationListener

public void addNavigationListener(NavigationListener listener)
Adds a listener of navigation events.

Parameters:
listener - The listener.

removeNavigationListener

public void removeNavigationListener(NavigationListener listener)
Removes a listener of navigation events previously added with addNavigationListener(NavigationListener).

Parameters:
listener - The listener.

addContentListener

public void addContentListener(ContentListener listener)
Adds a listener of content events.

Parameters:
listener - The listener.
See Also:
getComponentContent()

removeContentListener

public void removeContentListener(ContentListener listener)
Removes a listener of content events previously added with addNavigationListener(NavigationListener).

Parameters:
listener - The listener.

addResponseListener

public void addResponseListener(ResponseListener listener)
Adds a listener of response events.

Parameters:
listener - The listener.

removeResponseListener

public void removeResponseListener(ResponseListener listener)
Removes a listener of navigation events previously added with addNavigationListener(NavigationListener).

Parameters:
listener - The listener.

getWindowCallback

protected WindowCallback getWindowCallback()
Gets a WindowCallback instance that is used to dispatch information during local navigation. The FramePanel tries to find an implementor of the interface among its ancestor components. Unless overridden, this implementation of getWindowCallback only looks for instances of the BrowserWindow interface.


getParentFrame

public NavigatorFrame getParentFrame()
Gets the parent frame. This is null for the top-most frame in a window or when the FramePanel is detached.

Specified by:
getParentFrame in interface NavigatorFrame

getTopFrame

public NavigatorFrame getTopFrame()
Gets the top-most frame in a window. It may return the current frame if its parent is null.

Specified by:
getTopFrame in interface NavigatorFrame

getComponent

public java.awt.Component getComponent()
Implements NavigatorFrame.getComponent().

Specified by:
getComponent in interface NavigatorFrame
See Also:
NavigatorFrame.getComponentContent()

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class javax.swing.JComponent

getBackNavigationEntries

public NavigationEntry[] getBackNavigationEntries()
Gets an array of navigation entries that came before the current one.


getForwardNavigationEntries

public NavigationEntry[] getForwardNavigationEntries()
Gets an array of navigation entries that would be visited with consecutive forward calls.


hasSource

public boolean hasSource()
Determines if the current navigation entry has associated source code.


canCopy

public boolean canCopy()
Determines whether there's a selection with content to be copied in this frame.


copy

public boolean copy()
Copies the selection, if any, to the clipboard. Whether this method is supported depends on content being rendered.


replaceContent

public final void replaceContent(java.awt.Component component)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
A simple alternative to NavigatorFrame.replaceContent(org.lobobrowser.clientlet.ClientletResponse, org.lobobrowser.clientlet.ComponentContent) provided for convenience.

Specified by:
replaceContent in interface NavigatorFrame
Parameters:
component - A AWT or Swing component.

replaceContent

public void replaceContent(ClientletResponse response,
                           ComponentContent content)
Replaces the content of the frame. This method can be safely called outside the GUI dispatch thread.

Specified by:
replaceContent in interface NavigatorFrame
See Also:
ClientletContext.setResultingContent(Component)

addImpl

protected void addImpl(java.awt.Component comp,
                       java.lang.Object constraints,
                       int index)
Overrides:
addImpl in class java.awt.Container

remove

public void remove(java.awt.Component comp)
Overrides:
remove in class java.awt.Container

remove

public void remove(int index)
Overrides:
remove in class java.awt.Container

removeAll

public void removeAll()
Overrides:
removeAll in class java.awt.Container

replaceContentImpl

protected void replaceContentImpl(ClientletResponse response,
                                  ComponentContent content)

clear

public void clear()
Clears current content. This method should be invoked in the GUI thread.


closeWindow

public void closeWindow()
Closes the window this frame belongs to.

Specified by:
closeWindow in interface NavigatorFrame

confirm

public boolean confirm(java.lang.String message)
Opens a confirmation dialog.

Specified by:
confirm in interface NavigatorFrame
Parameters:
message - The question text.
Returns:
True only if Yes is selected.

invokeLater

public void invokeLater(java.lang.Runnable runnable)
Implements NavigatorFrame.invokeLater(Runnable).

Specified by:
invokeLater in interface NavigatorFrame

navigate

public final void navigate(java.lang.String urlOrPath)
                    throws java.net.MalformedURLException
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Navigates to a URL in the current frame.

Specified by:
navigate in interface NavigatorFrame
Parameters:
urlOrPath - An absolute URL or file path.
Throws:
java.net.MalformedURLException

navigate

public final void navigate(java.lang.String urlOrPath,
                           RequestType requestType)
                    throws java.net.MalformedURLException
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Navigates to a URL in the current frame.

Specified by:
navigate in interface NavigatorFrame
Parameters:
urlOrPath - An absolute URL or file path.
requestType - The request type.
Throws:
java.net.MalformedURLException

navigate

public void navigate(java.net.URL url,
                     java.lang.String method,
                     ParameterInfo paramInfo,
                     TargetType type,
                     RequestType requestType)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Navigates to a URL in the current frame.

Specified by:
navigate in interface NavigatorFrame
Parameters:
url - An absolute or relative URL.
method - The request method.
paramInfo - The request parameters.
type - The frame target type.
requestType - The request type.

navigate

public void navigate(java.net.URL url,
                     java.lang.String method,
                     ParameterInfo paramInfo,
                     TargetType type,
                     RequestType requestType,
                     NavigatorFrame originatingFrame)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Navigates to a URL in the current frame. This method should be used when the originating frame of the request differs from the target frame.

Specified by:
navigate in interface NavigatorFrame
Parameters:
url - An absolute or relative URL.
method - The request method.
paramInfo - The request parameters.
type - The frame target type.
requestType - The request type.
originatingFrame - The frame where the request originated.

isOKToAddReferrer

protected boolean isOKToAddReferrer(RequestType requestType)

open

public final NavigatorFrame open(java.lang.String urlOrPath)
                          throws java.net.MalformedURLException
Opens a window and renders the URL or path provided.

Specified by:
open in interface NavigatorFrame
Parameters:
urlOrPath - The absolute URL or file path to open.
Returns:
The top frame of the new window.
Throws:
java.net.MalformedURLException

open

public final NavigatorFrame open(java.net.URL url,
                                 java.util.Properties windowProperties)
Opens a window and renders the URL provided.

Specified by:
open in interface NavigatorFrame
Parameters:
url - The URL of the document.
windowProperties - A Properties object that follows JavaScript Window.open() conventions.
Returns:
The top frame of the new window.

open

public final NavigatorFrame open(java.net.URL url,
                                 java.lang.String windowId,
                                 java.util.Properties windowProperties)
Opens a window and renders the URL provided.

Parameters:
url - The URL of the document.
windowId - A unique ID for the window.
windowProperties - A Properties object that follows JavaScript Window.open() conventions.
Returns:
The top frame of the new window.

open

public final NavigatorFrame open(java.net.URL url)
Opens a window and renders the URL provided.

Specified by:
open in interface NavigatorFrame
Parameters:
url - The URL of the document.
Returns:
The top frame of the new window.

open

public NavigatorFrame open(java.net.URL url,
                           java.lang.String method,
                           ParameterInfo pinfo,
                           java.lang.String windowId,
                           java.util.Properties windowProperties)
Opens a window and renders the URL provided. This method is called to request that a new window is opened. For example, this method will be invoked on JavaScript Window.open() calls. Override to be informed of such calls.

Specified by:
open in interface NavigatorFrame
Parameters:
url - The URL to open.
method - The request method, e.g. GET.
pinfo - The URL parameter information.
windowProperties - Window properties, following Javascript Window.open() conventions.
Returns:
The top frame of the new window. The method may return null if navigation was vetoed by a listener.

open

public final NavigatorFrame open(java.net.URL url,
                                 java.lang.String method,
                                 ParameterInfo pinfo)
Opens a window and renders the URL provided.

Specified by:
open in interface NavigatorFrame
Parameters:
url - The URL of the document.
method - The request method.
pinfo - Any additional parameter data.
Returns:
The top frame of the new window.

openWindow

public static NavigatorFrame openWindow(FramePanel opener,
                                        java.net.URL url,
                                        java.lang.String windowId,
                                        java.util.Properties windowProperties,
                                        java.lang.String method,
                                        ParameterInfo pinfo)
Static method for opening a window.

Returns:
The top frame in the window that was opened.

prompt

public java.lang.String prompt(java.lang.String message,
                               java.lang.String inputDefault)
Opens a message prompt dialog.

Specified by:
prompt in interface NavigatorFrame
Parameters:
message - The question text.
inputDefault - The default prompt value.
Returns:
The text entered by the user.

windowToBack

public void windowToBack()
Sends the window to the back (blur).

Specified by:
windowToBack in interface NavigatorFrame

windowToFront

public void windowToFront()
Sends the window to the front and grabs focus for the frame.

Specified by:
windowToFront in interface NavigatorFrame

alert

public void alert(java.lang.String message)
Opens an alert dialog.

Specified by:
alert in interface NavigatorFrame
Parameters:
message - The message shown in the alert dialog.

goTo

public boolean goTo(NavigationEntry entry)
Navigates to the given entry without adding the entry to frame history. This is the mechanism that should be used to "go back" to an entry already visited.


back

public boolean back()
Navigates back.

Specified by:
back in interface NavigatorFrame

forward

public boolean forward()
Navigates forward.

Specified by:
forward in interface NavigatorFrame

canForward

public boolean canForward()
Determines whether the frame can navigate forward.

Specified by:
canForward in interface NavigatorFrame

canBack

public boolean canBack()
Determines whether the frame can navigate back.

Specified by:
canBack in interface NavigatorFrame

reload

public void reload()
Reloads the current document.

Specified by:
reload in interface NavigatorFrame

canReload

public boolean canReload()
Determines whether the current document can be reloaded.


createFrame

public NavigatorFrame createFrame()
Creates a frame that is expected to be used as a child of the current one.

Specified by:
createFrame in interface NavigatorFrame

getDefaultStatus

public java.lang.String getDefaultStatus()
Gets the default window status.

Specified by:
getDefaultStatus in interface NavigatorFrame

getItem

public java.lang.Object getItem(java.lang.String name)

getOpenerFrame

public NavigatorFrame getOpenerFrame()
Gets the frame that opened the current frame, if any.

Specified by:
getOpenerFrame in interface NavigatorFrame

getStatus

public java.lang.String getStatus()
Gets the current window status.

Specified by:
getStatus in interface NavigatorFrame

getWindowId

public java.lang.String getWindowId()
Gets the window ID if this is the top frame in a window.

Specified by:
getWindowId in interface NavigatorFrame

isWindowClosed

public boolean isWindowClosed()
Determines if the window is closed.

Specified by:
isWindowClosed in interface NavigatorFrame

setDefaultStatus

public void setDefaultStatus(java.lang.String value)
Sets the default window status.

Specified by:
setDefaultStatus in interface NavigatorFrame

setItem

public void setItem(java.lang.String name,
                    java.lang.Object value)

setStatus

public void setStatus(java.lang.String status)
Sets the window status.

Specified by:
setStatus in interface NavigatorFrame

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

getMaximumSize

public java.awt.Dimension getMaximumSize()
Overrides:
getMaximumSize in class javax.swing.JComponent

getComponentContent

public ComponentContent getComponentContent()
Gets the component content currently set in the frame.

Specified by:
getComponentContent in interface NavigatorFrame

getSourceCode

public java.lang.String getSourceCode()
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Gets source code for content currently showing, if any.

Specified by:
getSourceCode in interface NavigatorFrame

navigate

public final void navigate(java.net.URL url)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Navigates to a URL in the current frame.

Specified by:
navigate in interface NavigatorFrame
Parameters:
url - An absolute URL.

navigate

public final void navigate(java.net.URL url,
                           RequestType requestType)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Navigates to a URL in the current frame.

Specified by:
navigate in interface NavigatorFrame
Parameters:
url - An absolute URL.
requestType - The request type.

getCurrentNavigationEntry

public NavigationEntry getCurrentNavigationEntry()
Gets the current navigation entry.

Specified by:
getCurrentNavigationEntry in interface NavigatorFrame

getProgressEvent

public NavigatorProgressEvent getProgressEvent()
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Gets the most recent progress event.

Specified by:
getProgressEvent in interface NavigatorFrame
See Also:
NavigatorFrame.setProgressEvent(NavigatorProgressEvent)t

setProgressEvent

public void setProgressEvent(NavigatorProgressEvent event)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Requests the frame to update its progress state.

Specified by:
setProgressEvent in interface NavigatorFrame
Parameters:
event - The progress event object.
See Also:
NavigatorFrame.getProgressEvent()

createNetworkRequest

public NetworkRequest createNetworkRequest()
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Creates a NetworkRequest object that can be used to load data over HTTP and other network protocols.

Specified by:
createNetworkRequest in interface NavigatorFrame

toString

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

resizeWindowBy

public void resizeWindowBy(int byWidth,
                           int byHeight)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Resizes the browser window.

Specified by:
resizeWindowBy in interface NavigatorFrame
Parameters:
byWidth - The number of pixels to expand the width by.
byHeight - The number of pixels to expand the height by.

resizeWindowTo

public void resizeWindowTo(int width,
                           int height)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Resizes the browser window.

Specified by:
resizeWindowTo in interface NavigatorFrame
Parameters:
width - The new window width.
height - The new window height.

getTopFrameWindow

public java.awt.Window getTopFrameWindow()

setTopFrameWindow

public void setTopFrameWindow(java.awt.Window topFrameWindow)

getContentObject

public java.lang.Object getContentObject()
Gets an object that is used to represent the current frame content. For example, if the frame is currently showing HTML, this method will probably return an instance of org.w3c.dom.html2.HTMLDocument.


getCurrentMimeType

public java.lang.String getCurrentMimeType()
Gets a mime type that goes with the object returned by getContentObject(). This is not necessarily the same as the mime type declared in the headers of the response that produced the current content.


linkClicked

public void linkClicked(java.net.URL url,
                        TargetType targetType,
                        java.lang.Object linkObject)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Similar to NavigatorFrame.navigate(java.net.URL, String, ParameterInfo, TargetType, RequestType), except this method should be called when navigation is triggered by a user click.

Specified by:
linkClicked in interface NavigatorFrame
Parameters:
url - An absolute or relative URL.
targetType - The frame target type.
linkObject - An implementation-dependent object representing what was clicked. For example, in HTML documents the linkObject might be of type org.w3c.dom.html2.HTMLElement.

getHistoryLength

public int getHistoryLength()
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Gets the length for the frame's history.

Specified by:
getHistoryLength in interface NavigatorFrame

getNextNavigationEntry

public NavigationEntry getNextNavigationEntry()
Specified by:
getNextNavigationEntry in interface NavigatorFrame

getPreviousNavigationEntry

public NavigationEntry getPreviousNavigationEntry()
Specified by:
getPreviousNavigationEntry in interface NavigatorFrame

moveInHistory

public void moveInHistory(int offset)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Switches to a new navigation entry in the frame's history, according to the given offset.

Specified by:
moveInHistory in interface NavigatorFrame
Parameters:
offset - A positive or negative number, where -1 is equivalent to NavigatorFrame.back() and +1 is equivalent to NavigatorFrame.forward().

navigateInHistory

public void navigateInHistory(java.lang.String absoluteURL)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Navigates to a URL that exists in the frame's history.

Specified by:
navigateInHistory in interface NavigatorFrame
Parameters:
absoluteURL - The target URL.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Description copied from interface: org.lobobrowser.ua.NavigatorFrame
Sets an implementation-dependent property of the underlying component currently rendered. For example, a Cobra-based HTML component accepts properties such as defaultMarginInsets (java.awt.Inset), defaultOverflowX and defaultOverflowY.

Specified by:
setProperty in interface NavigatorFrame
Parameters:
name - The name of the property.
value - The value of the property. The type of the value depends on the property and the underlying implementation.


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