com.inet.html.actions
Class BeginEndLineAction
java.lang.Object
javax.swing.AbstractAction
javax.swing.text.TextAction
javax.swing.text.StyledEditorKit.StyledTextAction
com.inet.html.actions.InetHtmlAction
com.inet.html.actions.BeginEndLineAction
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public class BeginEndLineAction
- extends InetHtmlAction
Replace the wrong working class DefaultEditorKit.EndLineAction and DefaultEditorKit.BeginLineAction
- See Also:
- Serialized Form
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary |
BeginEndLineAction(java.lang.String name,
boolean begin,
boolean select)
The constructor. |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent ev)
|
static int |
getRowBeginEnd(javax.swing.text.JTextComponent textComp,
int offs,
boolean begin)
Replace the wrong method Utilities.getRowEnd(). |
static java.awt.Rectangle |
modelToView(javax.swing.text.JTextComponent textComp,
int offs)
A call of HtmlRootView.nativeModelToView. |
Methods inherited from class javax.swing.text.TextAction |
augmentList |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeginEndLineAction
public BeginEndLineAction(java.lang.String name,
boolean begin,
boolean select)
- The constructor.
- Parameters:
name
- the action nameselect
- whether to extend the selection when changing the caret position.begin
- whether move the cursor to begin or end of the line
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ev)
-
getRowBeginEnd
public static int getRowBeginEnd(javax.swing.text.JTextComponent textComp,
int offs,
boolean begin)
throws javax.swing.text.BadLocationException
- Replace the wrong method Utilities.getRowEnd(). Find the cursor position at end of the row.
- Parameters:
textComp
- the JTextComponentoffs
- the current positionbegin
- true to find the start of the row, false to find the end
- Returns:
- the position at end of row.
- Throws:
javax.swing.text.BadLocationException
- if a position does not represent a valid location in the associated document
modelToView
public static java.awt.Rectangle modelToView(javax.swing.text.JTextComponent textComp,
int offs)
throws javax.swing.text.BadLocationException
- A call of HtmlRootView.nativeModelToView. This call can not be overridden and is independent from Zoom or
Rotation of the editor.
- Parameters:
textComp
- current text editoroffs
- chachter offset
- Returns:
- the bounding box, in view coordinate space, of the character at the specified position
- Throws:
javax.swing.text.BadLocationException
- if the specified position does not represent a valid location in the associated document