|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.text.JTextComponent | +--com.sun.java.swing.JEditorPane
The content type that editor is bound to at any given time is determined by the EditorKit currently installed. If the content is set to a new URL, its type is used to determine the EditorKit that should be used to load the content.
For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JEditorPane key assignments.
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
protected | JEditorPane.AccessibleJEditorPane
The class used to obtain the accessible role for this object. |
protected | JEditorPane.AccessibleJEditorPaneHTML
This class provides support for AccessibleHypertext, and is used in instances where the EditorKit installed in this JEditorPane is an instance of HTMLEditorKit. |
protected | JEditorPane.JEditorPaneAccesssibleHypertextSupport
What's returned by AccessibleJEditorPaneHTML.getAccessibleText() Provides support for AccessibleHypertext in case there is an HTML document being displayed in this JEditorPane. |
Inner classes inherited from class com.sun.java.swing.text.JTextComponent | |
JTextComponent.AccessibleJTextComponent , JTextComponent.KeyBinding |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Fields inherited from class com.sun.java.swing.text.JTextComponent | |
DEFAULT_KEYMAP , FOCUS_ACCELERATOR_KEY |
Fields inherited from class com.sun.java.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 |
Constructor Summary | |
JEditorPane()
Constructs a new JEditorPane. |
|
JEditorPane(String url)
Creates a JEditorPane based on a string containing a URL specification. |
|
JEditorPane(URL initialPage)
Creates a JEditorPane based on a specified URL for input. |
Method Summary | |
void | addHyperlinkListener(HyperlinkListener listener)
Adds a hyperlink listener for notification of any changes, for example when a link is selected and entered. |
protected EditorKit | createDefaultEditorKit()
Creates the default editor kit (PlainEditorKit) for when the component is first created. |
static EditorKit | createEditorKitForContentType(String type)
Create a handler for the given type from the default registry of editor kits. |
void | fireHyperlinkUpdate(HyperlinkEvent e)
Notifies all listeners that have registered interest for notification on this event type. |
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JEditorPane. |
String | getContentType()
Gets the type of content that this editor handles. |
EditorKit | getEditorKit()
Fetches the currently installed kit for handling content. createDefaultEditorKit() is called to set up a default if necessary. |
EditorKit | getEditorKitForContentType(String type)
Fetches the editor kit to use for the given type of content. |
URL | getPage()
Gets the current url being displayed. |
boolean | getScrollableTracksViewportWidth()
Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport. |
String | getUIClassID()
Gets the class ID for the UI. |
boolean | isManagingFocus()
Turns off tab traversal once focus gained. |
static void | registerEditorKitForContentType(String type,
String classname,
ClassLoader loader)
Establishes the default bindings of type to name. |
static void | registerEditorKitForContentType(String type,
String classname)
Establishes the default bindings of type to name. |
void | removeHyperlinkListener(HyperlinkListener listener)
Removes a hyperlink listener. |
protected void | scrollToReference(String reference)
Scroll the view to the given reference location (i.e. the value returned by the URL.getRef
method for the url being displayed). |
void | setContentType(String type)
Sets the type of content that this editor handles. |
void | setEditorKit(EditorKit kit)
Sets the currently installed kit for handling content. |
void | setEditorKitForContentType(String type,
EditorKit k)
Directly set the editor kit to use for the given type. |
void | setPage(String url)
Sets the current url being displayed. |
void | setPage(URL page)
Sets the current url being displayed. |
Methods inherited from class java.awt.Container | |
add , add , add , add , add , addContainerListener , addImpl , countComponents , deliverEvent , doLayout , findComponentAt , findComponentAt , getComponent , getComponentAt , getComponentAt , getComponentCount , getComponents , getLayout , insets , invalidate , isAncestorOf , layout , list , list , locate , minimumSize , paintComponents , paramString , preferredSize , print , printComponents , processContainerEvent , processEvent , remove , remove , removeAll , removeContainerListener , setLayout , validate , validateTree |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
Constructor Detail |
public JEditorPane()
public JEditorPane(URL initialPage) throws IOException
initialPage
- the URLpublic JEditorPane(String url) throws IOException
url
- the URLMethod Detail |
public void addHyperlinkListener(HyperlinkListener listener)
listener
- the listenerpublic void removeHyperlinkListener(HyperlinkListener listener)
listener
- the listenerpublic void fireHyperlinkUpdate(HyperlinkEvent e)
e
- the eventEventListenerList
public void setPage(URL page) throws IOException
scrollToReference
method.
page
- the URL of the pageprotected void scrollToReference(String reference)
URL.getRef
method for the url being displayed). By default, this
method only knows how to locate a reference in an
HTMLDocument. The implementation calls the
scrollRectToVisible
method to
accomplish the actual scrolling. If scrolling to a
reference location is needed for document types other
than html, this method should be reimplemented.
This method will have no effect if the component
is not visible.
reference
- the named location to scroll to.public URL getPage()
public void setPage(String url) throws IOException
url
- the URL for displaypublic String getUIClassID()
JComponent.getUIClassID()
,
UIDefaults.getUI(com.sun.java.swing.JComponent)
protected EditorKit createDefaultEditorKit()
public final EditorKit getEditorKit()
public final String getContentType()
public final void setContentType(String type)
getEditorKitForContentType
,
and then setEditorKit
if an editor kit can
be successfully located. This is a convenience method
that can be used as an alternative to calling
setEditorKit
directly.
type
- the non-null mime type for the content editing
support.getContentType()
public void setEditorKit(EditorKit kit)
kit
- the desired editor behavior.getEditorKit()
public EditorKit getEditorKitForContentType(String type)
This method can be reimplemented to use some other kind of type registry. This can be reimplemented to use the Java Activation Framework for example.
type
- the non-null content typepublic void setEditorKitForContentType(String type, EditorKit k)
type
- the non-null content type
k
- the editor kit to be setpublic static EditorKit createEditorKitForContentType(String type)
Once a prototype EditorKit instance is successfully located, it is cloned and the clone is returned.
type
- the content typepublic static void registerEditorKitForContentType(String type, String classname)
type
- the non-null content type
classname
- the class to load laterpublic static void registerEditorKitForContentType(String type, String classname, ClassLoader loader)
type
- the non-null content type
classname
- the class to load later
loader
- the ClassLoader to use to load the namepublic boolean isManagingFocus()
public boolean getScrollableTracksViewportWidth()
public AccessibleContext getAccessibleContext()
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |