home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / WIN95 / IAVAZIP.EXE / DATA.Z / TreeViewEventObject.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-08-18  |  1.5 KB  |  56 lines

  1. package com.sfs.awt.treeview;
  2.  
  3. import java.util.EventObject;
  4.  
  5. public class TreeViewEventObject extends EventObject {
  6.    public static final int TREEVIEW_FIRST = 0;
  7.    public static final int FOLDER_CLOSED = 0;
  8.    public static final int FOLDER_OPENED = 1;
  9.    public static final int DOCUMENT_CLOSED = 2;
  10.    public static final int DOCUMENT_OPENED = 3;
  11.    public static final int SELECTION_ADD = 4;
  12.    public static final int SELECTION_REMOVE = 5;
  13.    public static final int TREEVIEW_LAST = 5;
  14.    Item item;
  15.    int Action = -1;
  16.    int clickCount;
  17.  
  18.    public TreeViewEventObject(int var1, Item var2, int var3, Object var4) {
  19.       super(var4);
  20.       this.item = var2;
  21.       this.Action = var1;
  22.       this.clickCount = var3;
  23.    }
  24.  
  25.    public Item getItem() {
  26.       return this.item;
  27.    }
  28.  
  29.    public String toString() {
  30.       switch (this.Action) {
  31.          case 0:
  32.             return "Folder " + this.item.getName() + " was closed.";
  33.          case 1:
  34.             return "Folder " + this.item.getName() + " was opened.";
  35.          case 2:
  36.             return "Document " + this.item.getName() + " was closed.";
  37.          case 3:
  38.             return "Document " + this.item.getName() + " was opened.";
  39.          case 4:
  40.             return "Item " + this.item.getName() + " was added to Selection";
  41.          case 5:
  42.             return "Item " + this.item.getName() + " was removed from Selection";
  43.          default:
  44.             return "Unknown Action on TreeView occured.";
  45.       }
  46.    }
  47.  
  48.    public int getClickCount() {
  49.       return this.clickCount;
  50.    }
  51.  
  52.    public int getAction() {
  53.       return this.Action;
  54.    }
  55. }
  56.