home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / plaf / basic / BasicTreeUI$TreeEditAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  1.1 KB  |  31 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.AbstractAction;
  5. import javax.swing.tree.TreePath;
  6.  
  7. class BasicTreeUI$TreeEditAction extends AbstractAction {
  8.    // $FF: synthetic field
  9.    private final BasicTreeUI this$0;
  10.  
  11.    public BasicTreeUI$TreeEditAction(BasicTreeUI var1, String var2) {
  12.       super(var2);
  13.       this.this$0 = var1;
  14.    }
  15.  
  16.    public void actionPerformed(ActionEvent var1) {
  17.       if (this.this$0.tree != null && this.this$0.tree.isEnabled()) {
  18.          TreePath var2 = BasicTreeUI.access$4(this.this$0);
  19.          int var3 = var2 != null ? this.this$0.getRowForPath(this.this$0.tree, var2) : -1;
  20.          if (var3 != -1) {
  21.             this.this$0.tree.startEditingAtPath(var2);
  22.          }
  23.       }
  24.  
  25.    }
  26.  
  27.    public boolean isEnabled() {
  28.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  29.    }
  30. }
  31.