javax.swing.text.html
Class HTMLEditorKit.InsertHTMLTextAction
- HTMLEditorKit
- Action, ActionListener, Cloneable, EventListener, Serializable
This class is used to insert a string of HTML into an existing
document. At least 2 HTML.Tags need to be supplied. The first Tag (parentTag)
identifies the parent in the document to add the elements to. The second, (addTag),
identifies that the first tag should be added to the document as seen in the string.
The parser will generate all appropriate (opening/closing tags_ even if they are not
in the HTML string passed in.
void | actionPerformed(ActionEvent ae) - Inserts the HTML.
|
protected void | insertAtBoundary(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag) - Invoked when inserting at a boundary.
|
protected void | insertAtBoundry(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag) - as of v1.3, use insertAtBoundary
|
protected void | insertHTML(JEditorPane editor, HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag addTag) - HTMLEditorKit.insertHTML is called.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
addTag
protected HTML.Tag addTag
Tag in HTML to start adding tags from.
alternateAddTag
protected HTML.Tag alternateAddTag
Alternate tag in HTML to start adding tags from if parentTag is
not found and alternateParentTag is not found.
InsertHTMLTextAction
public InsertHTMLTextAction(String name,
String html,
HTML.Tag parentTag,
HTML.Tag addTag)
Initializes all fields.
name
- - the name of the document.html
- - the html to insertparentTag
- - the parent tag to check foraddTag
- - the tag to start adding from
InsertHTMLTextAction
public InsertHTMLTextAction(String name,
String html,
HTML.Tag parentTag,
HTML.Tag addTag,
HTML.Tag alternateParentTag,
HTML.Tag alternateAddTag)
Initializes all fields and calls super
name
- - the name of the document.html
- - the html to insertparentTag
- - the parent tag to check foraddTag
- - the tag to start adding fromalternateParentTag
- - the alternate parent tagalternateAddTag
- - the alternate add tag
insertAtBoundary
protected void insertAtBoundary(JEditorPane editor,
HTMLDocument doc,
int offset,
Element insertElement,
String html,
HTML.Tag parentTag,
HTML.Tag addTag)
Invoked when inserting at a boundary. Determines the number of pops,
and then the number of pushes that need to be performed. The it calls
insertHTML.
editor
- -
the editor to use to get the editorkitdoc
- -
the Document to insert the HTML into.offset
- -
where to begin inserting the HTML.insertElement
- -
the element to inserthtml
- -
the html to insertparentTag
- -
the parent tagaddTag
- -
the first tag
insertAtBoundry
protected void insertAtBoundry(JEditorPane editor,
HTMLDocument doc,
int offset,
Element insertElement,
String html,
HTML.Tag parentTag,
HTML.Tag addTag)
as of v1.3, use insertAtBoundary
Invoked when inserting at a boundary. Determines the number of pops,
and then the number of pushes that need to be performed. The it calls
insertHTML.
editor
- - the editor to use to get the editorkitdoc
- -
the Document to insert the HTML into.offset
- -
where to begin inserting the HTML.insertElement
- - the element to inserthtml
- - the html to insertparentTag
- - the parent tagaddTag
- - the first tag
insertHTML
protected void insertHTML(JEditorPane editor,
HTMLDocument doc,
int offset,
String html,
int popDepth,
int pushDepth,
HTML.Tag addTag)
HTMLEditorKit.insertHTML is called. If an exception is
thrown, it is wrapped in a RuntimeException and thrown.
editor
- - the editor to use to get the editorkitdoc
- -
the Document to insert the HTML into.offset
- -
where to begin inserting the HTML.html
- -
the String to insertpopDepth
- -
the number of ElementSpec.EndTagTypes to generate before
insertingpushDepth
- -
the number of ElementSpec.StartTagTypes with a direction of
ElementSpec.JoinNextDirection that should be generated beforeaddTag
- -
the first tag to start inserting into document
HTMLEditorKit.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.