home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / plaf / basic / BasicTreeUI$TreeSelectAllAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  1.5 KB  |  53 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$TreeSelectAllAction extends AbstractAction {
  8.    // $FF: synthetic field
  9.    private final BasicTreeUI this$0;
  10.    private boolean selectAll;
  11.  
  12.    public BasicTreeUI$TreeSelectAllAction(BasicTreeUI var1, String var2, boolean var3) {
  13.       super(var2);
  14.       this.this$0 = var1;
  15.       this.selectAll = var3;
  16.    }
  17.  
  18.    public void actionPerformed(ActionEvent var1) {
  19.       int var2 = this.this$0.getRowCount(this.this$0.tree);
  20.       if (this.this$0.tree != null && var2 > 0) {
  21.          if (this.selectAll) {
  22.             TreePath var3 = BasicTreeUI.access$4(this.this$0);
  23.             TreePath var4 = BasicTreeUI.access$9(this.this$0);
  24.             if (var3 != null && !this.this$0.tree.isVisible(var3)) {
  25.                var3 = null;
  26.             }
  27.  
  28.             this.this$0.tree.setSelectionInterval(0, var2 - 1);
  29.             if (var3 != null) {
  30.                BasicTreeUI.access$3(this.this$0, var3);
  31.             }
  32.  
  33.             if (var4 != null && this.this$0.tree.isVisible(var4)) {
  34.                BasicTreeUI.access$2(this.this$0, var4);
  35.             } else if (var3 != null) {
  36.                BasicTreeUI.access$2(this.this$0, var3);
  37.             }
  38.          } else {
  39.             TreePath var5 = BasicTreeUI.access$4(this.this$0);
  40.             TreePath var6 = BasicTreeUI.access$9(this.this$0);
  41.             this.this$0.tree.clearSelection();
  42.             BasicTreeUI.access$2(this.this$0, var6);
  43.             BasicTreeUI.access$3(this.this$0, var5);
  44.          }
  45.       }
  46.  
  47.    }
  48.  
  49.    public boolean isEnabled() {
  50.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  51.    }
  52. }
  53.