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

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.AbstractAction;
  4. import java.awt.event.ActionEvent;
  5. import java.io.Serializable;
  6.  
  7. class BasicTreeUI$TreeToggleAction extends AbstractAction implements Serializable {
  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.       this.this$0 = var1;
  15.    }
  16.  
  17.    public void actionPerformed(ActionEvent var1) {
  18.       if (this.this$0.tree != null) {
  19.          int var2 = this.this$0.tree.getMinSelectionRow();
  20.          if (var2 != -1 && !this.this$0.isLeaf(var2)) {
  21.             if (this.this$0.isExpanded(var2)) {
  22.                this.this$0.collapseRow(var2);
  23.                return;
  24.             }
  25.  
  26.             this.this$0.expandRow(var2);
  27.          }
  28.       }
  29.  
  30.    }
  31.  
  32.    public boolean isEnabled() {
  33.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  34.    }
  35. }
  36.