[Dev] Re: Solution to bug 116

Frank Cohen fcohen at pushtotest.com
Wed Aug 8 08:47:45 PDT 2007


Thanks Luis Carlos. This is very helpful. -Frank



On Aug 8, 2007, at 7:59 AM, Luis Carlos Lara López wrote:

> HI Frank ,
> To use the meta characteres the is a function called  
> setKeyIndetifier in TMFrame.java.
>  This function will make the TextArea works with the MacOS command  
> key.
>
>
>      private void MacOSModifyListeners(){
>         setKeyIdentifier(Output);
>         setKeyIdentifier(NodeOutputText);
>         setKeyIdentifier(NodeErrorText);
>     }
>
>     private void setKeyIdentifier(final javax.swing.JTextArea panel){
>          panel.addKeyListener(new java.awt.event.KeyListener() {
>             public void keyPressed(KeyEvent e) {
>                 if ((e.META_DOWN_MASK&e.getModifiersEx()) > 0 ){
>                     switch (e.getKeyChar()){
>                         case 'c':
>                             panel.copy();
>                             break;
>                         case 'v':
>                             panel.paste();
>                             break;
>                         case 'x':
>                             panel.cut();
>                             break;
>                         case 'a':
>                             panel.selectAll();
>                             break;
>                     }
>
>                 }
>             }
>             public void keyReleased(KeyEvent e) {
>             }
>             public void keyTyped(KeyEvent e) {
>             }
>         });
>     }
>
>
>
> The problem was that in CVS TMFrame.java was like this
>
>     private void setKeyIdentifier(final javax.swing.JTextArea panel){
>          Output.addKeyListener(new java.awt.event.KeyListener() {
>             public void keyPressed(KeyEvent e) {
>                 if ((e.META_DOWN_MASK&e.getModifiersEx()) > 0 ){
>                     switch (e.getKeyChar()){
>                         case 'c':
>                             panel.copy();
>                             break;
>                         case 'v':
>                             panel.paste();
>                             break;
>                         case 'x':
>                             panel.cut();
>                             break;
>                         case 'a':
>                             panel.selectAll();
>                             break;
>                     }
>
>                 }
>             }
>             public void keyReleased(KeyEvent e) {
>             }
>             public void keyTyped(KeyEvent e) {
>             }
>         });
>     }
>
> Then it only worked on Output panel.
> I had fixed it. It must work now.
> Hope this was helpful
>
> LC
>



--
Frank Cohen, PushToTest, http://www.PushToTest.com, phone 408 374 7426
TestMaker: The open-source SOA test automation tool





More information about the Dev mailing list