home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / text / DefaultEditorKit$InsertContentAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  861 b   |  29 lines

  1. package javax.swing.text;
  2.  
  3. import java.awt.Component;
  4. import java.awt.event.ActionEvent;
  5.  
  6. public class DefaultEditorKit$InsertContentAction extends TextAction {
  7.    public DefaultEditorKit$InsertContentAction() {
  8.       super("insert-content");
  9.    }
  10.  
  11.    public void actionPerformed(ActionEvent var1) {
  12.       JTextComponent var2 = ((TextAction)this).getTextComponent(var1);
  13.       if (var2 != null && var1 != null) {
  14.          if (!var2.isEditable() || !((Component)var2).isEnabled()) {
  15.             ((Component)var2).getToolkit().beep();
  16.             return;
  17.          }
  18.  
  19.          String var3 = var1.getActionCommand();
  20.          if (var3 != null) {
  21.             var2.replaceSelection(var3);
  22.          } else {
  23.             ((Component)var2).getToolkit().beep();
  24.          }
  25.       }
  26.  
  27.    }
  28. }
  29.