home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / text / JTextComponent.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  17.4 KB  |  648 lines

  1. package com.sun.java.swing.text;
  2.  
  3. import com.sun.java.accessibility.Accessible;
  4. import com.sun.java.accessibility.AccessibleContext;
  5. import com.sun.java.swing.Action;
  6. import com.sun.java.swing.JComponent;
  7. import com.sun.java.swing.KeyStroke;
  8. import com.sun.java.swing.Scrollable;
  9. import com.sun.java.swing.UIManager;
  10. import com.sun.java.swing.event.CaretEvent;
  11. import com.sun.java.swing.event.CaretListener;
  12. import com.sun.java.swing.plaf.TextUI;
  13. import java.awt.AWTEvent;
  14. import java.awt.Color;
  15. import java.awt.Component;
  16. import java.awt.Container;
  17. import java.awt.Dimension;
  18. import java.awt.Insets;
  19. import java.awt.LayoutManager;
  20. import java.awt.Point;
  21. import java.awt.Rectangle;
  22. import java.awt.Toolkit;
  23. import java.awt.datatransfer.Clipboard;
  24. import java.awt.datatransfer.ClipboardOwner;
  25. import java.awt.datatransfer.DataFlavor;
  26. import java.awt.datatransfer.StringSelection;
  27. import java.awt.datatransfer.Transferable;
  28. import java.awt.event.ActionEvent;
  29. import java.awt.event.InputEvent;
  30. import java.awt.event.KeyEvent;
  31. import java.io.IOException;
  32. import java.io.ObjectInputStream;
  33. import java.io.Reader;
  34. import java.io.Writer;
  35. import java.util.Hashtable;
  36.  
  37. public abstract class JTextComponent extends JComponent implements Scrollable, Accessible {
  38.    public static final String FOCUS_ACCELERATOR_KEY = "focusAcceleratorKey";
  39.    private Document model;
  40.    private transient Caret caret;
  41.    private transient Highlighter highlighter;
  42.    private transient Keymap keymap;
  43.    private boolean opaque;
  44.    private transient MutableCaretEvent caretEvent;
  45.    private Color caretColor;
  46.    private Color selectionColor;
  47.    private Color selectedTextColor;
  48.    private Color disabledTextColor;
  49.    private boolean editable;
  50.    private Insets margin;
  51.    private char focusAccelerator;
  52.    private Action focusAction = new FocusAction(this);
  53.    private static ClipboardOwner defaultClipboardOwner = new ClipboardObserver();
  54.    static final IllegalArgumentException illegalDocumentPosition = new IllegalArgumentException("Illegal document position");
  55.    private static Hashtable keymapTable = null;
  56.    private JTextComponent editor;
  57.    private static JTextComponent focusedComponent;
  58.    public static final String DEFAULT_KEYMAP = "default";
  59.    static final KeyBinding[] defaultBindings = new KeyBinding[]{new KeyBinding(KeyStroke.getKeyStroke(8, 0), "delete-previous"), new KeyBinding(KeyStroke.getKeyStroke(127, 0), "delete-next"), new KeyBinding(KeyStroke.getKeyStroke(36, 0), "caret-begin"), new KeyBinding(KeyStroke.getKeyStroke(35, 0), "caret-end"), new KeyBinding(KeyStroke.getKeyStroke(39, 0), "caret-forward"), new KeyBinding(KeyStroke.getKeyStroke(37, 0), "caret-backward"), new KeyBinding(KeyStroke.getKeyStroke(38, 0), "caret-up"), new KeyBinding(KeyStroke.getKeyStroke(40, 0), "caret-down")};
  60.    // $FF: synthetic field
  61.    static Class class$com$sun$java$swing$event$CaretListener;
  62.  
  63.    public JTextComponent() {
  64.       ((Component)this).enableEvents(8L);
  65.       this.caretEvent = new MutableCaretEvent(this);
  66.       ((Component)this).addMouseListener(this.caretEvent);
  67.       ((Component)this).addFocusListener(this.caretEvent);
  68.       this.setEditable(true);
  69.       ((Container)this).setLayout((LayoutManager)null);
  70.       this.updateUI();
  71.    }
  72.  
  73.    public TextUI getUI() {
  74.       return (TextUI)super.ui;
  75.    }
  76.  
  77.    public void setUI(TextUI var1) {
  78.       super.setUI(var1);
  79.    }
  80.  
  81.    public void updateUI() {
  82.       this.setUI((TextUI)UIManager.getUI(this));
  83.       ((Container)this).invalidate();
  84.    }
  85.  
  86.    public boolean isOpaque() {
  87.       return this.opaque;
  88.    }
  89.  
  90.    public void setOpaque(boolean var1) {
  91.       this.opaque = var1;
  92.    }
  93.  
  94.    public void addCaretListener(CaretListener var1) {
  95.       super.listenerList.add(class$com$sun$java$swing$event$CaretListener != null ? class$com$sun$java$swing$event$CaretListener : (class$com$sun$java$swing$event$CaretListener = class$("com.sun.java.swing.event.CaretListener")), var1);
  96.    }
  97.  
  98.    public void removeCaretListener(CaretListener var1) {
  99.       super.listenerList.remove(class$com$sun$java$swing$event$CaretListener != null ? class$com$sun$java$swing$event$CaretListener : (class$com$sun$java$swing$event$CaretListener = class$("com.sun.java.swing.event.CaretListener")), var1);
  100.    }
  101.  
  102.    protected void fireCaretUpdate(CaretEvent var1) {
  103.       Object[] var2 = super.listenerList.getListenerList();
  104.  
  105.       for(int var3 = var2.length - 2; var3 >= 0; var3 -= 2) {
  106.          if (var2[var3] == (class$com$sun$java$swing$event$CaretListener != null ? class$com$sun$java$swing$event$CaretListener : (class$com$sun$java$swing$event$CaretListener = class$("com.sun.java.swing.event.CaretListener")))) {
  107.             ((CaretListener)var2[var3 + 1]).caretUpdate(var1);
  108.          }
  109.       }
  110.  
  111.    }
  112.  
  113.    public void setDocument(Document var1) {
  114.       if (super.accessibleContext != null) {
  115.          this.model.removeDocumentListener((AccessibleJTextComponent)super.accessibleContext);
  116.       }
  117.  
  118.       Document var2 = this.model;
  119.       this.model = var1;
  120.       ((JComponent)this).firePropertyChange("document", var2, var1);
  121.       ((JComponent)this).revalidate();
  122.       ((Component)this).repaint();
  123.       if (super.accessibleContext != null) {
  124.          this.model.addDocumentListener((AccessibleJTextComponent)super.accessibleContext);
  125.       }
  126.  
  127.    }
  128.  
  129.    public Document getDocument() {
  130.       return this.model;
  131.    }
  132.  
  133.    public Action[] getActions() {
  134.       return this.getUI().getEditorKit().getActions();
  135.    }
  136.  
  137.    public void setMargin(Insets var1) {
  138.       Insets var2 = this.margin;
  139.       this.margin = var1;
  140.       ((JComponent)this).firePropertyChange("margin", var2, var1);
  141.       ((Container)this).invalidate();
  142.    }
  143.  
  144.    public Insets getMargin() {
  145.       return this.margin == null ? ((TextUI)super.ui).getDefaultMargin() : this.margin;
  146.    }
  147.  
  148.    public Caret getCaret() {
  149.       return this.caret;
  150.    }
  151.  
  152.    public void setCaret(Caret var1) {
  153.       if (this.caret != null) {
  154.          this.caret.removeChangeListener(this.caretEvent);
  155.          this.caret.deinstall(this);
  156.       }
  157.  
  158.       Caret var2 = this.caret;
  159.       this.caret = var1;
  160.       if (this.caret != null) {
  161.          this.caret.install(this);
  162.          this.caret.addChangeListener(this.caretEvent);
  163.       }
  164.  
  165.       ((JComponent)this).firePropertyChange("caret", var2, this.caret);
  166.    }
  167.  
  168.    public Highlighter getHighlighter() {
  169.       return this.highlighter;
  170.    }
  171.  
  172.    public void setHighlighter(Highlighter var1) {
  173.       if (this.highlighter != null) {
  174.          this.highlighter.deinstall(this);
  175.       }
  176.  
  177.       Highlighter var2 = this.highlighter;
  178.       this.highlighter = var1;
  179.       if (this.highlighter != null) {
  180.          this.highlighter.install(this);
  181.       }
  182.  
  183.       ((JComponent)this).firePropertyChange("highlighter", var2, var1);
  184.    }
  185.  
  186.    public void setKeymap(Keymap var1) {
  187.       Keymap var2 = this.keymap;
  188.       this.keymap = var1;
  189.       ((JComponent)this).firePropertyChange("keymap", var2, this.keymap);
  190.    }
  191.  
  192.    public Keymap getKeymap() {
  193.       return this.keymap;
  194.    }
  195.  
  196.    public static Keymap addKeymap(String var0, Keymap var1) {
  197.       DefaultKeymap var2 = new DefaultKeymap(var0, var1);
  198.       if (var0 != null) {
  199.          keymapTable.put(var0, var2);
  200.       }
  201.  
  202.       return var2;
  203.    }
  204.  
  205.    public static Keymap removeKeymap(String var0) {
  206.       return (Keymap)keymapTable.remove(var0);
  207.    }
  208.  
  209.    public static Keymap getKeymap(String var0) {
  210.       return (Keymap)keymapTable.get(var0);
  211.    }
  212.  
  213.    public static void loadKeymap(Keymap var0, KeyBinding[] var1, Action[] var2) {
  214.       Hashtable var3 = new Hashtable();
  215.  
  216.       for(int var4 = 0; var4 < var2.length; ++var4) {
  217.          Action var5 = var2[var4];
  218.          String var6 = (String)var5.getValue("Name");
  219.          var3.put(var6 != null ? var6 : "", var5);
  220.       }
  221.  
  222.       for(int var7 = 0; var7 < var1.length; ++var7) {
  223.          Action var8 = (Action)var3.get(var1[var7].actionName);
  224.          if (var8 != null) {
  225.             var0.addActionForKeyStroke(var1[var7].key, var8);
  226.          }
  227.       }
  228.  
  229.    }
  230.  
  231.    private final boolean mapEventToAction(KeyEvent var1) {
  232.       Keymap var2 = this.getKeymap();
  233.       if (var2 != null) {
  234.          KeyStroke var3 = KeyStroke.getKeyStrokeForEvent(var1);
  235.          Action var4 = var2.getAction(var3);
  236.          if (var4 != null) {
  237.             String var5 = null;
  238.             if (var1.getKeyChar() != 0) {
  239.                var5 = String.valueOf(var1.getKeyChar());
  240.             }
  241.  
  242.             ActionEvent var6 = new ActionEvent(this, 1001, var5, ((InputEvent)var1).getModifiers());
  243.             var4.actionPerformed(var6);
  244.             ((InputEvent)var1).consume();
  245.             return true;
  246.          }
  247.       }
  248.  
  249.       return false;
  250.    }
  251.  
  252.    public Color getCaretColor() {
  253.       return this.caretColor;
  254.    }
  255.  
  256.    public void setCaretColor(Color var1) {
  257.       Color var2 = this.caretColor;
  258.       this.caretColor = var1;
  259.       ((JComponent)this).firePropertyChange("caretColor", var2, this.caretColor);
  260.    }
  261.  
  262.    public Color getSelectionColor() {
  263.       return this.selectionColor;
  264.    }
  265.  
  266.    public void setSelectionColor(Color var1) {
  267.       Color var2 = this.selectionColor;
  268.       this.selectionColor = var1;
  269.       ((JComponent)this).firePropertyChange("selectionColor", var2, this.selectionColor);
  270.    }
  271.  
  272.    public Color getSelectedTextColor() {
  273.       return this.selectedTextColor;
  274.    }
  275.  
  276.    public void setSelectedTextColor(Color var1) {
  277.       Color var2 = this.selectedTextColor;
  278.       this.selectedTextColor = var1;
  279.       ((JComponent)this).firePropertyChange("selectedTextColor", var2, this.selectedTextColor);
  280.    }
  281.  
  282.    public Color getDisabledTextColor() {
  283.       return this.disabledTextColor;
  284.    }
  285.  
  286.    public void setDisabledTextColor(Color var1) {
  287.       Color var2 = this.disabledTextColor;
  288.       this.disabledTextColor = var1;
  289.       ((JComponent)this).firePropertyChange("disabledTextColor", var2, this.disabledTextColor);
  290.    }
  291.  
  292.    public void replaceSelection(String var1) {
  293.       if (!this.isEditable()) {
  294.          ((Component)this).getToolkit().beep();
  295.       } else {
  296.          Document var2 = this.getDocument();
  297.          if (var2 != null) {
  298.             try {
  299.                int var3 = Math.min(this.caret.getDot(), this.caret.getMark());
  300.                int var4 = Math.max(this.caret.getDot(), this.caret.getMark());
  301.                if (var3 != var4) {
  302.                   var2.remove(var3, var4 - var3);
  303.                }
  304.  
  305.                if (var1 != null && var1.length() > 0) {
  306.                   var2.insertString(var3, var1, (AttributeSet)null);
  307.                   return;
  308.                }
  309.             } catch (BadLocationException var5) {
  310.                ((Component)this).getToolkit().beep();
  311.                return;
  312.             }
  313.          }
  314.  
  315.       }
  316.    }
  317.  
  318.    public String getText(int var1, int var2) throws BadLocationException {
  319.       return this.getDocument().getText(var1, var2);
  320.    }
  321.  
  322.    public Rectangle modelToView(int var1) throws BadLocationException {
  323.       return this.getUI().modelToView(var1);
  324.    }
  325.  
  326.    public int viewToModel(Point var1) {
  327.       return this.getUI().viewToModel(var1);
  328.    }
  329.  
  330.    public void cut() {
  331.       try {
  332.          Clipboard var1 = Toolkit.getDefaultToolkit().getSystemClipboard();
  333.          int var2 = Math.min(this.caret.getDot(), this.caret.getMark());
  334.          int var3 = Math.max(this.caret.getDot(), this.caret.getMark());
  335.          if (var2 != var3) {
  336.             Document var4 = this.getDocument();
  337.             String var5 = var4.getText(var2, var3 - var2);
  338.             StringSelection var6 = new StringSelection(var5);
  339.             var1.setContents(var6, defaultClipboardOwner);
  340.             var4.remove(var2, var3 - var2);
  341.             return;
  342.          }
  343.       } catch (BadLocationException var7) {
  344.       }
  345.  
  346.    }
  347.  
  348.    public void copy() {
  349.       try {
  350.          Clipboard var1 = Toolkit.getDefaultToolkit().getSystemClipboard();
  351.          int var2 = Math.min(this.caret.getDot(), this.caret.getMark());
  352.          int var3 = Math.max(this.caret.getDot(), this.caret.getMark());
  353.          if (var2 != var3) {
  354.             Document var4 = this.getDocument();
  355.             String var5 = var4.getText(var2, var3 - var2);
  356.             StringSelection var6 = new StringSelection(var5);
  357.             var1.setContents(var6, defaultClipboardOwner);
  358.             return;
  359.          }
  360.       } catch (BadLocationException var7) {
  361.       }
  362.  
  363.    }
  364.  
  365.    public void paste() {
  366.       Clipboard var1 = Toolkit.getDefaultToolkit().getSystemClipboard();
  367.       Transferable var2 = var1.getContents(this);
  368.       if (var2 != null) {
  369.          try {
  370.             String var3 = (String)var2.getTransferData(DataFlavor.stringFlavor);
  371.             this.replaceSelection(var3);
  372.          } catch (Exception var4) {
  373.             System.err.println("Couldn't get clipboard contents in format: " + DataFlavor.stringFlavor.getHumanPresentableName());
  374.          }
  375.       }
  376.    }
  377.  
  378.    public void moveCaretPosition(int var1) {
  379.       this.caret.moveDot(var1);
  380.    }
  381.  
  382.    public void setFocusAccelerator(char var1) {
  383.       var1 = Character.toUpperCase(var1);
  384.       KeyStroke[] var2 = ((JComponent)this).getRegisteredKeyStrokes();
  385.       int var3 = 0;
  386.  
  387.       for(int var4 = var2.length; var3 < var4; ++var3) {
  388.          if (((JComponent)this).getActionForKeyStroke(var2[var3]) == this.focusAction) {
  389.             if (var2[var3].getKeyChar() == var1) {
  390.                return;
  391.             }
  392.  
  393.             ((JComponent)this).unregisterKeyboardAction(var2[var3]);
  394.             break;
  395.          }
  396.       }
  397.  
  398.       if (var1 != 0) {
  399.          ((JComponent)this).registerKeyboardAction(this.focusAction, KeyStroke.getKeyStroke(var1, 8), 2);
  400.       }
  401.  
  402.       char var5 = this.focusAccelerator;
  403.       this.focusAccelerator = var1;
  404.       ((JComponent)this).firePropertyChange("focusAcceleratorKey", var5, this.focusAccelerator);
  405.    }
  406.  
  407.    public char getFocusAccelerator() {
  408.       return this.focusAccelerator;
  409.    }
  410.  
  411.    public void read(Reader var1, Object var2) throws IOException {
  412.       EditorKit var3 = this.getUI().getEditorKit();
  413.       Document var4 = var3.createDefaultDocument();
  414.       if (var2 != null) {
  415.          var4.putProperty("stream", var2);
  416.       }
  417.  
  418.       try {
  419.          var3.read(var1, var4, 0);
  420.          this.setDocument(var4);
  421.       } catch (BadLocationException var6) {
  422.          throw new IOException(((Throwable)var6).getMessage());
  423.       }
  424.    }
  425.  
  426.    public void write(Writer var1) throws IOException {
  427.       Document var2 = this.getDocument();
  428.  
  429.       try {
  430.          this.getUI().getEditorKit().write(var1, var2, 0, var2.getLength());
  431.       } catch (BadLocationException var4) {
  432.          throw new IOException(((Throwable)var4).getMessage());
  433.       }
  434.    }
  435.  
  436.    public boolean isFocusTraversable() {
  437.       return ((Component)this).isEnabled();
  438.    }
  439.  
  440.    protected void processComponentKeyEvent(KeyEvent var1) {
  441.       int var2 = ((AWTEvent)var1).getID();
  442.       switch (var2) {
  443.          case 400:
  444.             if (!this.mapEventToAction(var1)) {
  445.                Keymap var3 = this.getKeymap();
  446.                if (var3 != null) {
  447.                   Action var4 = var3.getDefaultAction();
  448.                   if (var4 != null) {
  449.                      ActionEvent var5 = new ActionEvent(this, 1001, String.valueOf(var1.getKeyChar()), ((InputEvent)var1).getModifiers());
  450.                      var4.actionPerformed(var5);
  451.                      ((InputEvent)var1).consume();
  452.                      return;
  453.                   }
  454.                }
  455.             }
  456.          default:
  457.             return;
  458.          case 401:
  459.             this.mapEventToAction(var1);
  460.             return;
  461.          case 402:
  462.             this.mapEventToAction(var1);
  463.       }
  464.    }
  465.  
  466.    public void setCaretPosition(int var1) {
  467.       Document var2 = this.getDocument();
  468.       if (var2 != null) {
  469.          this.caret.setDot(var1);
  470.       }
  471.  
  472.    }
  473.  
  474.    public int getCaretPosition() {
  475.       return this.caret.getDot();
  476.    }
  477.  
  478.    public void setText(String var1) {
  479.       try {
  480.          Document var2 = this.getDocument();
  481.          var2.remove(0, var2.getLength());
  482.          var2.insertString(0, var1, (AttributeSet)null);
  483.       } catch (BadLocationException var3) {
  484.          ((Component)this).getToolkit().beep();
  485.       }
  486.    }
  487.  
  488.    public String getText() {
  489.       Document var1 = this.getDocument();
  490.  
  491.       String var2;
  492.       try {
  493.          var2 = var1.getText(0, var1.getLength());
  494.       } catch (BadLocationException var3) {
  495.          var2 = null;
  496.       }
  497.  
  498.       return var2;
  499.    }
  500.  
  501.    public String getSelectedText() {
  502.       String var1 = null;
  503.       int var2 = Math.min(this.caret.getDot(), this.caret.getMark());
  504.       int var3 = Math.max(this.caret.getDot(), this.caret.getMark());
  505.       if (var2 != var3) {
  506.          try {
  507.             Document var4 = this.getDocument();
  508.             var1 = var4.getText(var2, var3 - var2);
  509.          } catch (BadLocationException var5) {
  510.             throw illegalDocumentPosition;
  511.          }
  512.       }
  513.  
  514.       return var1;
  515.    }
  516.  
  517.    public boolean isEditable() {
  518.       return this.editable;
  519.    }
  520.  
  521.    public void setEditable(boolean var1) {
  522.       this.editable = var1;
  523.    }
  524.  
  525.    public int getSelectionStart() {
  526.       int var1 = Math.min(this.caret.getDot(), this.caret.getMark());
  527.       return var1;
  528.    }
  529.  
  530.    public void setSelectionStart(int var1) {
  531.       this.select(var1, this.getSelectionEnd());
  532.    }
  533.  
  534.    public int getSelectionEnd() {
  535.       int var1 = Math.max(this.caret.getDot(), this.caret.getMark());
  536.       return var1;
  537.    }
  538.  
  539.    public void setSelectionEnd(int var1) {
  540.       this.select(this.getSelectionStart(), var1);
  541.    }
  542.  
  543.    public void select(int var1, int var2) {
  544.       this.setCaretPosition(var1);
  545.       this.moveCaretPosition(var2);
  546.    }
  547.  
  548.    public void selectAll() {
  549.       Document var1 = this.getDocument();
  550.       if (var1 != null) {
  551.          this.setCaretPosition(0);
  552.          this.moveCaretPosition(var1.getLength());
  553.       }
  554.  
  555.    }
  556.  
  557.    public Dimension getPreferredScrollableViewportSize() {
  558.       return ((JComponent)this).getPreferredSize();
  559.    }
  560.  
  561.    public int getScrollableUnitIncrement(Rectangle var1, int var2, int var3) {
  562.       switch (var2) {
  563.          case 0:
  564.             return var1.width / 10;
  565.          case 1:
  566.             return var1.height / 10;
  567.          default:
  568.             throw new IllegalArgumentException("Invalid orientation: " + var2);
  569.       }
  570.    }
  571.  
  572.    public int getScrollableBlockIncrement(Rectangle var1, int var2, int var3) {
  573.       switch (var2) {
  574.          case 0:
  575.             return var1.width;
  576.          case 1:
  577.             return var1.height;
  578.          default:
  579.             throw new IllegalArgumentException("Invalid orientation: " + var2);
  580.       }
  581.    }
  582.  
  583.    public boolean getScrollableTracksViewportWidth() {
  584.       return false;
  585.    }
  586.  
  587.    public boolean getScrollableTracksViewportHeight() {
  588.       return false;
  589.    }
  590.  
  591.    public AccessibleContext getAccessibleContext() {
  592.       if (super.accessibleContext == null) {
  593.          super.accessibleContext = new AccessibleJTextComponent(this);
  594.       }
  595.  
  596.       return super.accessibleContext;
  597.    }
  598.  
  599.    private void readObject(ObjectInputStream var1) throws ClassNotFoundException, IOException {
  600.       var1.defaultReadObject();
  601.       this.caretEvent = new MutableCaretEvent(this);
  602.       ((Component)this).addMouseListener(this.caretEvent);
  603.       ((Component)this).addFocusListener(this.caretEvent);
  604.       this.getUI().installUI(this);
  605.    }
  606.  
  607.    static final JTextComponent getFocusedComponent() {
  608.       return focusedComponent;
  609.    }
  610.  
  611.    // $FF: synthetic method
  612.    static Class class$(String var0) {
  613.       try {
  614.          return Class.forName(var0);
  615.       } catch (ClassNotFoundException var2) {
  616.          throw new NoClassDefFoundError(((Throwable)var2).getMessage());
  617.       }
  618.    }
  619.  
  620.    // $FF: synthetic method
  621.    static Document access$0(JTextComponent var0) {
  622.       return var0.model;
  623.    }
  624.  
  625.    // $FF: synthetic method
  626.    static JTextComponent access$1() {
  627.       return focusedComponent;
  628.    }
  629.  
  630.    // $FF: synthetic method
  631.    static void access$2(JTextComponent var0) {
  632.       focusedComponent = var0;
  633.    }
  634.  
  635.    static {
  636.       try {
  637.          keymapTable = new Hashtable(17);
  638.          Keymap var0 = addKeymap("default", (Keymap)null);
  639.          var0.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction());
  640.          DefaultEditorKit var1 = new DefaultEditorKit();
  641.          loadKeymap(var0, defaultBindings, ((EditorKit)var1).getActions());
  642.       } catch (Throwable var2) {
  643.          var2.printStackTrace();
  644.          keymapTable = new Hashtable(17);
  645.       }
  646.    }
  647. }
  648.