jdk/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java
changeset 12814 8e4ff85cdd16
parent 12813 c10ab96dcf41
parent 12531 42a9335fd8b3
child 13143 31c70a66a053
equal deleted inserted replaced
12813:c10ab96dcf41 12814:8e4ff85cdd16
    97     }
    97     }
    98 
    98 
    99     @Override
    99     @Override
   100     public void actionPerformed(final ActionEvent e) {
   100     public void actionPerformed(final ActionEvent e) {
   101         postEvent(new ActionEvent(getTarget(), ActionEvent.ACTION_PERFORMED,
   101         postEvent(new ActionEvent(getTarget(), ActionEvent.ACTION_PERFORMED,
   102                                   getText(), e.getWhen(), e.getModifiers()));
   102                 getText(), e.getWhen(), e.getModifiers()));
   103     }
   103     }
   104 
   104 
   105     /**
   105     /**
   106      * Restoring native behavior. We should sets the selection range to zero,
   106      * Restoring native behavior. We should sets the selection range to zero,
   107      * when component lost its focus.
   107      * when component lost its focus.
   124         JTextAreaDelegate() {
   124         JTextAreaDelegate() {
   125             super();
   125             super();
   126         }
   126         }
   127 
   127 
   128         @Override
   128         @Override
       
   129         public void replaceSelection(String content) {
       
   130             getDocument().removeDocumentListener(LWTextFieldPeer.this);
       
   131             super.replaceSelection(content);
       
   132             // post only one text event in this case
       
   133             postTextEvent();
       
   134             getDocument().addDocumentListener(LWTextFieldPeer.this);
       
   135         }
       
   136 
       
   137         @Override
   129         public boolean hasFocus() {
   138         public boolean hasFocus() {
   130             return getTarget().hasFocus();
   139             return getTarget().hasFocus();
   131         }
   140         }
   132 
   141 
   133         @Override
   142         @Override