org.springframework.richclient.text
Class TextComponentPopup

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by org.springframework.richclient.text.TextComponentPopup
All Implemented Interfaces:
FocusListener, MouseListener, MouseMotionListener, MouseWheelListener, EventListener, CaretListener, UndoableEditListener

public class TextComponentPopup
extends MouseAdapter
implements FocusListener, CaretListener, UndoableEditListener

Helper class that decorates a JTextComponent with a standard popup menu. Support for undo/redo is also provided.

Author:
Oliver Hutchison

Nested Class Summary
static class TextComponentPopup.DefaultKeymap
          We need this class since keymaps are shared in jvm This class is a 100% copy of the jdk class {@link JTextComponent#DefaultKeymap
 
Constructor Summary
protected TextComponentPopup(JTextComponent textComponent, CommitTrigger resetUndoHistoryTrigger)
           
 
Method Summary
static void attachPopup(JTextComponent textComponent)
           
static void attachPopup(JTextComponent textComponent, CommitTrigger resetUndoHistoryTrigger)
           
 void caretUpdate(CaretEvent e)
           
 void focusGained(FocusEvent e)
           
 void focusLost(FocusEvent e)
           
protected  CommandManager getCommandManager()
           
protected  CommandGroup getEditableCommandGroup()
           
protected  CommandGroup getPasswordCommandGroup()
           
protected  CommandGroup getReadOnlyCommandGroup()
           
 void mousePressed(MouseEvent evt)
           
 void mouseReleased(MouseEvent evt)
           
 void registerAccelerators()
           
 void undoableEditHappened(UndoableEditEvent e)
           
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextComponentPopup

protected TextComponentPopup(JTextComponent textComponent,
                             CommitTrigger resetUndoHistoryTrigger)
Method Detail

attachPopup

public static void attachPopup(JTextComponent textComponent,
                               CommitTrigger resetUndoHistoryTrigger)

attachPopup

public static void attachPopup(JTextComponent textComponent)

getCommandManager

protected CommandManager getCommandManager()

registerAccelerators

public void registerAccelerators()

mousePressed

public void mousePressed(MouseEvent evt)
Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class MouseAdapter
See Also:
MouseListener.mousePressed(java.awt.event.MouseEvent)

mouseReleased

public void mouseReleased(MouseEvent evt)
Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class MouseAdapter
See Also:
MouseAdapter.mouseReleased(java.awt.event.MouseEvent)

caretUpdate

public void caretUpdate(CaretEvent e)
Specified by:
caretUpdate in interface CaretListener

focusGained

public void focusGained(FocusEvent e)
Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent e)
Specified by:
focusLost in interface FocusListener

undoableEditHappened

public void undoableEditHappened(UndoableEditEvent e)
Specified by:
undoableEditHappened in interface UndoableEditListener

getEditableCommandGroup

protected CommandGroup getEditableCommandGroup()

getPasswordCommandGroup

protected CommandGroup getPasswordCommandGroup()

getReadOnlyCommandGroup

protected CommandGroup getReadOnlyCommandGroup()


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.