|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.lobobrowser.gui.FramePanel
public class FramePanel
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.
| 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.BaselineResizeBehavior, 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 | |
|---|---|
protected void |
addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
|
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(). |
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. |
java.lang.Object |
getItem(java.lang.String name)
|
java.awt.Dimension |
getMaximumSize()
|
java.awt.Dimension |
getMinimumSize()
|
NavigatorFrame |
getOpenerFrame()
Gets the frame that opened the current frame, if any. |
NavigatorFrame |
getParentFrame()
Gets the parent frame. |
java.awt.Dimension |
getPreferredSize()
|
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. |
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 |
invokeLater(java.lang.Runnable runnable)
Implements NavigatorFrame.invokeLater(Runnable). |
protected boolean |
isOKToAddReferrer(RequestType requestType)
|
boolean |
isWindowClosed()
Determines if the window is closed. |
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. |
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 |
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 |
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 |
setStatus(java.lang.String status)
Sets the window status. |
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, 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 |
|---|
public FramePanel(java.lang.String windowId)
public FramePanel(FramePanel parentFrame)
public FramePanel()
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 |
|---|
public void setOpenerFrame(NavigatorFrame opener)
protected WindowCallback getWindowCallback()
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.
public NavigatorFrame getParentFrame()
null for the top-most frame
in a window or when the FramePanel is detached.
- Specified by:
getParentFrame in interface NavigatorFrame
public NavigatorFrame getTopFrame()
null.
getTopFrame in interface NavigatorFramepublic java.awt.Component getComponent()
NavigatorFrame.getComponent().
getComponent in interface NavigatorFramepublic void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentpublic NavigationEntry[] getBackNavigationEntries()
public NavigationEntry[] getForwardNavigationEntries()
forward calls.
public boolean hasSource()
public boolean canCopy()
public boolean copy()
public final void replaceContent(java.awt.Component component)
org.lobobrowser.ua.NavigatorFrameNavigatorFrame.replaceContent(org.lobobrowser.clientlet.ClientletResponse, org.lobobrowser.clientlet.ComponentContent)
provided for convenience.
replaceContent in interface NavigatorFramecomponent - A AWT or Swing component.
public void replaceContent(ClientletResponse response,
ComponentContent content)
replaceContent in interface NavigatorFrameClientletContext.setResultingContent(Component)
protected void addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
addImpl in class java.awt.Containerpublic void remove(java.awt.Component comp)
remove in class java.awt.Containerpublic void remove(int index)
remove in class java.awt.Containerpublic void removeAll()
removeAll in class java.awt.Container
protected void replaceContentImpl(ClientletResponse response,
ComponentContent content)
public void clear()
public void closeWindow()
closeWindow in interface NavigatorFramepublic boolean confirm(java.lang.String message)
confirm in interface NavigatorFramemessage - The question text.
public void invokeLater(java.lang.Runnable runnable)
NavigatorFrame.invokeLater(Runnable).
invokeLater in interface NavigatorFrame
public final void navigate(java.lang.String urlOrPath)
throws java.net.MalformedURLException
org.lobobrowser.ua.NavigatorFrame
navigate in interface NavigatorFrameurlOrPath - An absolute URL or file path.
java.net.MalformedURLException
public final void navigate(java.lang.String urlOrPath,
RequestType requestType)
throws java.net.MalformedURLException
org.lobobrowser.ua.NavigatorFrame
navigate in interface NavigatorFrameurlOrPath - An absolute URL or file path.requestType - The request type.
java.net.MalformedURLException
public void navigate(java.net.URL url,
java.lang.String method,
ParameterInfo paramInfo,
TargetType type,
RequestType requestType)
org.lobobrowser.ua.NavigatorFrame
navigate in interface NavigatorFrameurl - An absolute or relative URL.method - The request method.paramInfo - The request parameters.type - The frame target type.requestType - The request type.protected boolean isOKToAddReferrer(RequestType requestType)
public final NavigatorFrame open(java.lang.String urlOrPath)
throws java.net.MalformedURLException
open in interface NavigatorFrameurlOrPath - The absolute URL or file path to open.
java.net.MalformedURLException
public final NavigatorFrame open(java.net.URL url,
java.util.Properties windowProperties)
open in interface NavigatorFrameurl - The URL of the document.windowProperties - A Properties object that follows JavaScript Window.open() conventions.
public final NavigatorFrame open(java.net.URL url,
java.lang.String windowId,
java.util.Properties windowProperties)
url - The URL of the document.windowId - A unique ID for the window.windowProperties - A Properties object that follows JavaScript Window.open() conventions.
public final NavigatorFrame open(java.net.URL url)
open in interface NavigatorFrameurl - The URL of the document.
public NavigatorFrame open(java.net.URL url,
java.lang.String method,
ParameterInfo pinfo,
java.lang.String windowId,
java.util.Properties windowProperties)
open in interface NavigatorFrameurl - The URL to open.method - The request method, e.g. GET.pinfo - The URL parameter information.windowProperties - Window properties, following Javascript Window.open() conventions.
public final NavigatorFrame open(java.net.URL url,
java.lang.String method,
ParameterInfo pinfo)
open in interface NavigatorFrameurl - The URL of the document.method - The request method.pinfo - Any additional parameter data.
public static NavigatorFrame openWindow(FramePanel opener,
java.net.URL url,
java.lang.String windowId,
java.util.Properties windowProperties,
java.lang.String method,
ParameterInfo pinfo)
public java.lang.String prompt(java.lang.String message,
java.lang.String inputDefault)
prompt in interface NavigatorFramemessage - The question text.inputDefault - The default prompt value.
public void windowToBack()
windowToBack in interface NavigatorFramepublic void windowToFront()
windowToFront in interface NavigatorFramepublic void alert(java.lang.String message)
alert in interface NavigatorFramemessage - The message shown in the alert dialog.public boolean goTo(NavigationEntry entry)
public boolean back()
back in interface NavigatorFramepublic boolean forward()
forward in interface NavigatorFramepublic boolean canForward()
canForward in interface NavigatorFramepublic boolean canBack()
canBack in interface NavigatorFramepublic void reload()
reload in interface NavigatorFramepublic boolean canReload()
public NavigatorFrame createFrame()
createFrame in interface NavigatorFramepublic java.lang.String getDefaultStatus()
getDefaultStatus in interface NavigatorFramepublic java.lang.Object getItem(java.lang.String name)
public NavigatorFrame getOpenerFrame()
getOpenerFrame in interface NavigatorFramepublic java.lang.String getStatus()
getStatus in interface NavigatorFramepublic java.lang.String getWindowId()
getWindowId in interface NavigatorFramepublic boolean isWindowClosed()
isWindowClosed in interface NavigatorFramepublic void setDefaultStatus(java.lang.String value)
setDefaultStatus in interface NavigatorFrame
public void setItem(java.lang.String name,
java.lang.Object value)
public void setStatus(java.lang.String status)
setStatus in interface NavigatorFramepublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class javax.swing.JComponentpublic java.awt.Dimension getMaximumSize()
getMaximumSize in class javax.swing.JComponentpublic java.lang.String getSourceCode()
org.lobobrowser.ua.NavigatorFrame
getSourceCode in interface NavigatorFramepublic final void navigate(java.net.URL url)
org.lobobrowser.ua.NavigatorFrame
navigate in interface NavigatorFrameurl - An absolute URL.
public final void navigate(java.net.URL url,
RequestType requestType)
org.lobobrowser.ua.NavigatorFrame
navigate in interface NavigatorFrameurl - An absolute URL.requestType - The request type.public NavigationEntry getCurrentNavigationEntry()
public NavigatorProgressEvent getProgressEvent()
org.lobobrowser.ua.NavigatorFrame
getProgressEvent in interface NavigatorFrameNavigatorFrame.setProgressEvent(NavigatorProgressEvent)tpublic void setProgressEvent(NavigatorProgressEvent event)
org.lobobrowser.ua.NavigatorFrame
setProgressEvent in interface NavigatorFrameevent - The progress event object.NavigatorFrame.getProgressEvent()public NetworkRequest createNetworkRequest()
org.lobobrowser.ua.NavigatorFrameNetworkRequest object that can be used
to load data over HTTP and other network protocols.
createNetworkRequest in interface NavigatorFramepublic java.lang.String toString()
toString in class java.awt.Component
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||