org.PingOO.DLAI.lib.PWidget
Class EditPopupMouseListener

java.lang.Object
  |
  +--java.awt.event.MouseAdapter
        |
        +--org.PingOO.DLAI.lib.PWidget.EditPopupMouseListener

final class EditPopupMouseListener
extends java.awt.event.MouseAdapter

Common mouse listener for copy/paste/cut on PTextFields, PTextArea, PPasswordField.

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)
See Also:
JTextField, MouseListener

Inner Class Summary
protected  class EditPopupMouseListener.CopyAction
          Copy the content of the current selection to clipboard.
protected  class EditPopupMouseListener.CutAction
          Cut the content of current selection to clipboard.
protected  class EditPopupMouseListener.PasteAction
          Paste the content of clipboard over the current selection.
 
Field Summary
private  PAction copyAction
          Action : copy selected text.
private  PAction cutAction
          Action : cut selected text.
private  PAction pasteAction
          Action : paste text on selection.
(package private)  javax.swing.text.JTextComponent target
          The target of this listener.
 
Constructor Summary
private EditPopupMouseListener()
          Hides this constructor.
  EditPopupMouseListener(javax.swing.text.JTextComponent target)
          Creates a new constructor.
 
Method Summary
private  void createActions()
          Creates the editing actions.
private  void createPopUp(int x, int y)
          Displays a popup menu with the standard copy, cut and paste buttons.
private  void enableActions(boolean value)
          Enables the editing actions.
 void mouseClicked(java.awt.event.MouseEvent event)
          Action to execute when there is a right click on this field.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

target

javax.swing.text.JTextComponent target
The target of this listener.

copyAction

private PAction copyAction
Action : copy selected text.

cutAction

private PAction cutAction
Action : cut selected text.

pasteAction

private PAction pasteAction
Action : paste text on selection.
Constructor Detail

EditPopupMouseListener

private EditPopupMouseListener()
Hides this constructor.

EditPopupMouseListener

public EditPopupMouseListener(javax.swing.text.JTextComponent target)
Creates a new constructor.
Parameters:
target -  
Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Action to execute when there is a right click on this field.
Parameters:
event - The mouse event.
Overrides:
mouseClicked in class java.awt.event.MouseAdapter

createActions

private final void createActions()
Creates the editing actions.

enableActions

private final void enableActions(boolean value)
Enables the editing actions.

createPopUp

private final void createPopUp(int x,
                               int y)
Displays a popup menu with the standard copy, cut and paste buttons.
Parameters:
x - The x position where this popup sould be displayed.
y - The y position where this popup sould be displayed.