Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.awt 6.7.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openide.awt
Class HtmlBrowser

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JPanel
                      org.openide.awt.HtmlBrowser

All Implemented Interfaces:
  ImageObserver, MenuContainer, Serializable, Accessible

    public class HtmlBrowser

extends JPanel

Object that provides viewer for HTML pages.

If all you want to do is to show some URL in the IDE's normal way, this is overkill. Just use `HtmlBrowser.URLDisplayer.showURL(java.net.URL)` instead. Using `HtmlBrowser` is appropriate mainly if you want to embed a web browser in some other GUI component (if the user has selected an external browser, this will fall back to a simple Swing renderer). Similarly `Impl` (coming from a `Factory`) is the lower-level renderer itself (sans toolbar).

Summary: for client use, try `URLDisplayer.showURL`, or for more control or where embedding is needed, create an `HtmlBrowser`. For provider use, create a `Factory` and register an instance of it to lookup.

See Also:
  Serialized Form

Nested Class Summary
`static interface` | `HtmlBrowser.Factory` Implementation of BrowerFactory creates new instances of some Browser implementation.
`static class` | `HtmlBrowser.Impl` This interface represents an implementation of html browser used in HtmlBrowser.
`static class` | `HtmlBrowser.URLDisplayer` A manager class which can display URLs in the proper way.

Nested classes/interfaces inherited from class javax.swing.JPanel
`JPanel.AccessibleJPanel`

Nested classes/interfaces inherited from class javax.swing.JComponent
`JComponent.AccessibleJComponent`

Nested classes/interfaces inherited from class java.awt.Container
`Container.AccessibleAWTContainer`

Nested classes/interfaces inherited from class java.awt.Component
`Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy`

Field Summary
`static int` | `DEFAULT_HEIGHT` Preferred height of the browser
`static int` | `DEFAULT_WIDTH` Preferred width of the browser

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
`HtmlBrowser()` Creates new html browser with toolbar and status line.
`HtmlBrowser(boolean toolbar, boolean statusLine)` Creates new html browser.
`HtmlBrowser(HtmlBrowser.Factory fact, boolean toolbar, boolean statusLine)` Creates new html browser.

Method Summary
`AccessibleContext` | `getAccessibleContext()`
`Component` | `getBrowserComponent()` Get the browser component.
`HtmlBrowser.Impl` | `getBrowserImpl()` Get the browser implementation.
`URL` | `getDocumentURL()` Gets current document url.
`static String` | `getHomePage()` Getter for the home page
`Dimension` | `getPreferredSize()` Returns preferred size.
`boolean` | `isStatusLineVisible()` Gets status line state.
`boolean` | `isToolbarVisible()` Gets status toolbar.
`void` | `requestFocus()`
`boolean` | `requestFocusInWindow()`
`void` | `setEnableHome(boolean b)` Enables/disables Home button.
`void` | `setEnableLocation(boolean b)` Enables/disables location.
`static void` | `setFactory(HtmlBrowser.Factory brFactory)` Deprecated. Use Lookup instead to register factories
`static void` | `setHomePage(String u)` Sets the home page.
`void` | `setStatusLineVisible(boolean v)` Shows/hides status line.
`void` | `setToolbarVisible(boolean v)` Shows/hides toolbar.
`void` | `setURL(String str)` Sets new URL.
`void` | `setURL(URL url)` Sets new URL.

Methods inherited from class javax.swing.JPanel
`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, getMaximumSize, getMinimumSize, 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, paint, 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, 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, addImpl, 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, remove, remove, removeAll, 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, toString, transferFocus, transferFocusUpCycle`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### DEFAULT_WIDTH

    public static final int DEFAULT_WIDTH

  Preferred width of the browser

  See Also:
    Constant Field Values

### DEFAULT_HEIGHT

    public static final int DEFAULT_HEIGHT

  Preferred height of the browser

  See Also:
    Constant Field Values

Constructor Detail

### HtmlBrowser

    public HtmlBrowser()

  Creates new html browser with toolbar and status line.

### HtmlBrowser

    public HtmlBrowser(boolean toolbar,
                       boolean statusLine)

  Creates new html browser.

### HtmlBrowser

    public HtmlBrowser(HtmlBrowser.Factory fact,
                       boolean toolbar,
                       boolean statusLine)

  Creates new html browser.

  Parameters:
    `fact` - Factory that is used for creation. Default factory is used if null is passed
    `toolbar` - visibility of toolbar
    `statusLine` - visibility of statusLine

Method Detail

### setHomePage

    public static void setHomePage(String u)

  Sets the home page.

  Parameters:
    `u` - the home page

### getHomePage

    public static String getHomePage()

  Getter for the home page

  Returns:
    the home page

### setFactory

    public static void setFactory(HtmlBrowser.Factory brFactory)

  Deprecated. Use Lookup instead to register factories

  Sets a new implementation of browser visual component for all HtmlBrowers.

### setURL

    public void setURL(String str)

  Sets new URL.

  Parameters:
    `str` - URL to show in this browser.

### setURL

    public void setURL(URL url)

  Sets new URL.

  Parameters:
    `url` - URL to show in this browser.

### getDocumentURL

    public final URL getDocumentURL()

  Gets current document url.

### setEnableHome

    public final void setEnableHome(boolean b)

  Enables/disables Home button.

### setEnableLocation

    public final void setEnableLocation(boolean b)

  Enables/disables location.

### isStatusLineVisible

    public boolean isStatusLineVisible()

  Gets status line state.

### setStatusLineVisible

    public void setStatusLineVisible(boolean v)

  Shows/hides status line.

### isToolbarVisible

    public boolean isToolbarVisible()

  Gets status toolbar.

### setToolbarVisible

    public void setToolbarVisible(boolean v)

  Shows/hides toolbar.

### getBrowserImpl

    public final HtmlBrowser.Impl getBrowserImpl()

  Get the browser implementation.

  Returns:
    the implementation
  Since:
    org.openide/1 4.27

### getBrowserComponent

    public final Component getBrowserComponent()

  Get the browser component.

  Returns:
    a component or null
  Since:
    org.openide/1 4.27

### getPreferredSize

    public Dimension getPreferredSize()

  Returns preferred size.

  Overrides:
    `getPreferredSize` in class `JComponent`

### requestFocus

    public void requestFocus()

  Overrides:
    `requestFocus` in class `JComponent`

### requestFocusInWindow

    public boolean requestFocusInWindow()

  Overrides:
    `requestFocusInWindow` in class `JComponent`

### getAccessibleContext

    public AccessibleContext getAccessibleContext()

  Specified by:
    `getAccessibleContext` in interface `Accessible`
  Overrides:
    `getAccessibleContext` in class `JPanel`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.awt 6.7.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.