Package hipp.com.wappedidpadpro2
Class MyActionListener
java.lang.Object
hipp.com.wappedidpadpro2.MyActionListener
- All Implemented Interfaces:
java.awt.event.ActionListener,java.util.EventListener
public class MyActionListener
extends java.lang.Object
implements java.awt.event.ActionListener
MyActionListener
listen for all actions happen in WAppEditpadPro2
listen for all actions happen in WAppEditpadPro2
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Hashtable<java.lang.Object,javax.swing.Action>actionsprivate DocumentParserdocParserprivate booleandoSaveprivate WAppEditFindDialogfindDialogprotected WAppRedoActionredoActionprivate javax.swing.JComponent[]redoComponentprivate WAppEditFindDialogreplaceDialogprivate WAppEditpadPro2theAppprotected javax.swing.undo.UndoManagerundoprotected WAppUndoActionundoActionprivate javax.swing.JComponent[]undoComponent -
Constructor Summary
Constructors Constructor Description MyActionListener(WAppEditpadPro2 _theApp) -
Method Summary
Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent _ae)listens for all possible actionsvoidcreateActionTable(WappProTextPane textComponent)The following two methods allow us to find an action provided by the editor kit by its name.protected voiddoColorAction(WappProTextPane jTxtP)private voiddoExitAction()private voiddoFindAction()private voiddoLuFAction(java.lang.String whatAction)private voiddoOpenFileAction(javax.swing.JTextPane jTxtP)private voiddoReplaceAction()private voiddoSaveFileAction(javax.swing.JTextPane jTxtP)private javax.swing.ActiongetActionByName(java.lang.String name)protected WAppEditFindDialoggetFindDialog()protected WAppEditFindDialoggetReplaceDialog()private java.lang.StringopenFileDialog(boolean save)protected voidremoveHighlights(WappProTextPane jTxtP)remove the highlightsprotected voidresetUndoManager()Resets the undo manager.private voidsetDocInfos(WappProTextPane jTxtP)protected voidsetHighlights(WappProTextPane jTxtP)set Highlights in the text documentprotected voidsetLookAndFeel(java.lang.String laf, java.awt.Color c)protected voidsetTextActions(WappProTextPane jTxtPane)voidsetUndoComponents()
-
Field Details
-
theApp
-
findDialog
-
replaceDialog
-
actions
protected java.util.Hashtable<java.lang.Object,javax.swing.Action> actions -
undoAction
-
redoAction
-
undo
protected javax.swing.undo.UndoManager undo -
undoComponent
private javax.swing.JComponent[] undoComponent -
redoComponent
private javax.swing.JComponent[] redoComponent -
doSave
private boolean doSave -
docParser
-
-
Constructor Details
-
MyActionListener
- Parameters:
_theApp-WAppEditpadPro2reference to the Main ApplicationWAppEditpadPro2
-
-
Method Details
-
doExitAction
private void doExitAction() -
setUndoComponents
public void setUndoComponents() -
getReplaceDialog
-
getFindDialog
-
doFindAction
private void doFindAction() -
doReplaceAction
private void doReplaceAction() -
setTextActions
- Parameters:
jTxtPane-WappProTextPane
-
createActionTable
The following two methods allow us to find an action provided by the editor kit by its name.- Parameters:
textComponent-WappProTextPane
-
getActionByName
private javax.swing.Action getActionByName(java.lang.String name) -
doColorAction
- Parameters:
jTxtP-WappProTextPanechoice a color for the marked text inWappProTextPane
-
setHighlights
set Highlights in the text document- Parameters:
jTxtP-WappProTextPaneWappProTextPane
-
removeHighlights
remove the highlights- Parameters:
jTxtP-WappProTextPaneWappProTextPane
-
setLookAndFeel
protected void setLookAndFeel(java.lang.String laf, java.awt.Color c) -
doLuFAction
private void doLuFAction(java.lang.String whatAction) -
resetUndoManager
protected void resetUndoManager()Resets the undo manager. -
openFileDialog
private java.lang.String openFileDialog(boolean save) -
doOpenFileAction
private void doOpenFileAction(javax.swing.JTextPane jTxtP) -
doSaveFileAction
private void doSaveFileAction(javax.swing.JTextPane jTxtP) -
setDocInfos
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent _ae)listens for all possible actions- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Parameters:
_ae-(ActionEvent
-