org.browsecode.helpers.menus.html
Class HTMLTextAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by javax.swing.text.TextAction
          extended by javax.swing.text.StyledEditorKit.StyledTextAction
              extended by javax.swing.text.html.HTMLEditorKit.HTMLTextAction
                  extended by javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction
                      extended by org.browsecode.helpers.menus.html.HTMLTextAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
EditInEkitAction, EkitRedirectAction, EkitViewSourceAction, HTMLAddBreakAction, HTMLAddLinkAction

public abstract class HTMLTextAction
extends javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction

Subclasses HTMLEditorKit.InsertHTMLTextAction and makes some private methods protected instead. Implemented because the superclass is not accessible enough to subclass it, which is the best way to do a bunch of HTML editing actions. Many of the methods in HTMLEditorKit.InsertHTMLTextAction were not accessible from there and are copied to here.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction
addTag, alternateAddTag, alternateParentTag, html, parentTag
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
HTMLTextAction(Dialogs dialogs, java.lang.String title)
           
 
Method Summary
abstract  void actionPerformed(java.awt.event.ActionEvent e)
           
protected  void adjustSelection2(javax.swing.JEditorPane pane, javax.swing.text.html.HTMLDocument doc, int startOffset, int oldLength)
          Called after an insertion to adjust the selection.
 Dialogs getDialogs(java.awt.event.ActionEvent e)
           
protected  EkitCore getEkitEditor(java.awt.event.ActionEvent e)
           
protected  boolean insertIntoTag2(javax.swing.JEditorPane editor, javax.swing.text.html.HTMLDocument doc, int offset, javax.swing.text.html.HTML.Tag tag, javax.swing.text.html.HTML.Tag addTag)
          If there is an Element with name tag at offset, this will invoke either insertAtBoundary or insertHTML.
 
Methods inherited from class javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction
insertAtBoundary, insertAtBoundry, insertHTML
 
Methods inherited from class javax.swing.text.html.HTMLEditorKit.HTMLTextAction
elementCountToTag, findElementMatchingTag, getElementsAt, getHTMLDocument, getHTMLEditorKit
 
Methods inherited from class javax.swing.text.StyledEditorKit.StyledTextAction
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes
 
Methods inherited from class javax.swing.text.TextAction
augmentList, getFocusedComponent, getTextComponent
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLTextAction

public HTMLTextAction(Dialogs dialogs,
                      java.lang.String title)
Method Detail

getDialogs

public Dialogs getDialogs(java.awt.event.ActionEvent e)

insertIntoTag2

protected boolean insertIntoTag2(javax.swing.JEditorPane editor,
                                 javax.swing.text.html.HTMLDocument doc,
                                 int offset,
                                 javax.swing.text.html.HTML.Tag tag,
                                 javax.swing.text.html.HTML.Tag addTag)
If there is an Element with name tag at offset, this will invoke either insertAtBoundary or insertHTML. This returns true if there is a match, and one of the inserts is invoked.


adjustSelection2

protected void adjustSelection2(javax.swing.JEditorPane pane,
                                javax.swing.text.html.HTMLDocument doc,
                                int startOffset,
                                int oldLength)
Called after an insertion to adjust the selection.


getEkitEditor

protected final EkitCore getEkitEditor(java.awt.event.ActionEvent e)

actionPerformed

public abstract void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction