guk.editIM
Class ClipWindow

java.lang.Object
  |
  +--guk.editIM.ClipWindow

public class ClipWindow
extends java.lang.Object

Helper for the EditIM Input Method Editor: Provides an utility window to use the system clipboard more easily.


Field Summary
(package private)  javax.swing.JFrame clipDialog
          A frame for the clipboard user interface that is built around clipField.
(package private)  javax.swing.JTextArea clipField
          A very kludgy textfield that is supposed to be connected to the system clipboard.
(package private)  MenuHelpers menu
          The MenuHelpers class provides functions like creating menu items and buttons.
 
Constructor Summary
ClipWindow(MenuHelpers menuHelper)
          The constructor needs a MenuHelpers instance for generic settings like font, action listener and centering base.
 
Method Summary
 void clipCommand(java.lang.String type)
          Postprocess clipboard dialog results and create commands in proper syntax for our listener.
(package private)  void clipPopup()
           Popup a menu that allows to communicate with the system clipboard.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

menu

MenuHelpers menu
The MenuHelpers class provides functions like creating menu items and buttons. Initially, no action listener is set.

clipField

javax.swing.JTextArea clipField
A very kludgy textfield that is supposed to be connected to the system clipboard. Using it normally crashes Java 1.3.1 Unix. May be also useful because you need no clipboard hotkeys to use it.

clipDialog

javax.swing.JFrame clipDialog
A frame for the clipboard user interface that is built around clipField.
Constructor Detail

ClipWindow

public ClipWindow(MenuHelpers menuHelper)
The constructor needs a MenuHelpers instance for generic settings like font, action listener and centering base. Instantiates the other helper classes.
Parameters:
menuHelper - Provides functions like creating menu items. Should have the listener and font set.
Method Detail

clipPopup

void clipPopup()

Popup a menu that allows to communicate with the system clipboard. Actually, the clipboard support would be much more flexible in Java 1.4 !? (get/set TransferHandler in JComponent).

Warning: Using the clipboard that way often crashes Java 1.3.1 Unix. Good question why this happens...


clipCommand

public void clipCommand(java.lang.String type)
Postprocess clipboard dialog results and create commands in proper syntax for our listener.
 Accepted commands:
   open  - open the window (closing possible other instances)
   close - close the window
   send  - send selection in this window to clipboard
   recv  - add clipboard text to this window
   send2 and recv2 are alternative implementations
Parameters:
type - A clipboard related command: send, recv, send2 or recv2 or close. Close closes the popup menu.