home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / plaf / basic / BasicTreeUI$TreeToggleAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  1.3 KB  |  34 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. public class BasicTreeUI$TreeToggleAction extends AbstractAction {
  8.    // $FF: synthetic field
  9.    private final BasicTreeUI this$0;
  10.  
  11.    public BasicTreeUI$TreeToggleAction(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) {
  18.          int var2 = BasicTreeUI.access$5(this.this$0);
  19.          if (var2 != -1 && !this.this$0.isLeaf(var2)) {
  20.             TreePath var3 = BasicTreeUI.access$9(this.this$0);
  21.             TreePath var4 = BasicTreeUI.access$4(this.this$0);
  22.             this.this$0.toggleExpandState(this.this$0.getPathForRow(this.this$0.tree, var2));
  23.             BasicTreeUI.access$2(this.this$0, var3);
  24.             BasicTreeUI.access$3(this.this$0, var4);
  25.          }
  26.       }
  27.  
  28.    }
  29.  
  30.    public boolean isEnabled() {
  31.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  32.    }
  33. }
  34.