home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / Notes.jar / lotus / notes / internal / InfoPaneClassSubItem.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-15  |  5.1 KB  |  170 lines

  1. package lotus.notes.internal;
  2.  
  3. import java.lang.reflect.Constructor;
  4. import java.lang.reflect.Field;
  5. import java.lang.reflect.Method;
  6. import java.lang.reflect.Modifier;
  7. import java.util.Enumeration;
  8. import lotus.notes.JavaString;
  9.  
  10. class InfoPaneClassSubItem implements InfoPaneItem {
  11.    private InfoPaneVector vector;
  12.    private String name;
  13.  
  14.    InfoPaneClassSubItem(String var1) {
  15.       this.name = JavaString.resource.getString(var1);
  16.       this.vector = new InfoPaneVector();
  17.    }
  18.  
  19.    InfoPaneClassSubItem(int var1) throws InfoPaneException {
  20.       this("InfoPane_Class_Modifier");
  21.       if (Modifier.isAbstract(var1)) {
  22.          this.AddMember("abstract");
  23.       } else {
  24.          if (Modifier.isFinal(var1)) {
  25.             this.AddMember("final");
  26.          }
  27.  
  28.       }
  29.    }
  30.  
  31.    InfoPaneClassSubItem(Constructor[] var1) throws InfoPaneException {
  32.       this("InfoPane_Constructors");
  33.  
  34.       try {
  35.          for(int var2 = 0; var1[var2] != null; ++var2) {
  36.             Constructor var3 = var1[var2];
  37.             if (Modifier.isPublic(var3.getModifiers())) {
  38.                this.AddConstructor(var3);
  39.             }
  40.          }
  41.  
  42.       } catch (ArrayIndexOutOfBoundsException var4) {
  43.       }
  44.    }
  45.  
  46.    InfoPaneClassSubItem(Class[] var1, boolean var2) throws InfoPaneException {
  47.       this(var2 ? "InfoPane_Extends_Interfaces" : "InfoPane_Implements_Interfaces");
  48.  
  49.       try {
  50.          for(int var3 = 0; var1[var3] != null; ++var3) {
  51.             Class var4 = var1[var3];
  52.             if (Modifier.isPublic(var4.getModifiers())) {
  53.                this.AddMember(var4.getName(), var4.toString());
  54.             }
  55.          }
  56.  
  57.       } catch (ArrayIndexOutOfBoundsException var5) {
  58.       }
  59.    }
  60.  
  61.    InfoPaneClassSubItem(Class var1) throws InfoPaneException {
  62.       this("InfoPane_Superclass");
  63.       if (Modifier.isPublic(var1.getModifiers())) {
  64.          this.AddMember(var1.getName(), var1.toString());
  65.       }
  66.  
  67.    }
  68.  
  69.    static void AddFields(InfoPaneClassSubItem var0, InfoPaneClassSubItem var1, Field[] var2) throws InfoPaneException {
  70.       try {
  71.          for(int var3 = 0; var2[var3] != null; ++var3) {
  72.             Field var4 = var2[var3];
  73.             int var5 = var4.getModifiers();
  74.             if (Modifier.isPublic(var5)) {
  75.                if (Modifier.isStatic(var5) && Modifier.isFinal(var5)) {
  76.                   var0.AddField(var4);
  77.                } else {
  78.                   var1.AddField(var4);
  79.                }
  80.             }
  81.          }
  82.  
  83.       } catch (ArrayIndexOutOfBoundsException var6) {
  84.       }
  85.    }
  86.  
  87.    static void AddMethods(InfoPaneClassSubItem var0, InfoPaneClassSubItem var1, Method[] var2, boolean var3) throws InfoPaneException {
  88.       try {
  89.          for(int var4 = 0; var2[var4] != null; ++var4) {
  90.             Method var5 = var2[var4];
  91.             int var6 = var5.getModifiers();
  92.             if (Modifier.isPublic(var6)) {
  93.                if (Modifier.isStatic(var6)) {
  94.                   var1.AddMethod(var5, var3);
  95.                } else {
  96.                   var0.AddMethod(var5, var3);
  97.                }
  98.             }
  99.          }
  100.  
  101.       } catch (ArrayIndexOutOfBoundsException var7) {
  102.       }
  103.    }
  104.  
  105.    InfoPaneConstructorItem AddConstructor(Constructor var1) throws InfoPaneException {
  106.       return (InfoPaneConstructorItem)this.vector.Insert(new InfoPaneConstructorItem(var1));
  107.    }
  108.  
  109.    InfoPaneFieldItem AddField(Field var1) throws InfoPaneException {
  110.       return (InfoPaneFieldItem)this.vector.Insert(new InfoPaneFieldItem(var1), true);
  111.    }
  112.  
  113.    InfoPaneMethodItem AddMethod(Method var1, boolean var2) throws InfoPaneException {
  114.       return (InfoPaneMethodItem)this.vector.Insert(new InfoPaneMethodItem(var1, var2), true);
  115.    }
  116.  
  117.    InfoPaneMemberItem AddMember(String var1) throws InfoPaneException {
  118.       return (InfoPaneMemberItem)this.vector.Insert(new InfoPaneMemberItem(var1));
  119.    }
  120.  
  121.    InfoPaneMemberItem AddMember(String var1, String var2) throws InfoPaneException {
  122.       return (InfoPaneMemberItem)this.vector.Insert(new InfoPaneMemberItem(var1, var2));
  123.    }
  124.  
  125.    InfoPaneMemberItem FindMember(String var1) {
  126.       return (InfoPaneMemberItem)this.vector.Find(var1);
  127.    }
  128.  
  129.    public boolean HasSubCategory() {
  130.       return this.vector != null && this.vector.size() > 0;
  131.    }
  132.  
  133.    public Enumeration GetEnumeration() {
  134.       return this.vector == null ? null : this.vector.elements();
  135.    }
  136.  
  137.    public String GetName() {
  138.       return this.name;
  139.    }
  140.  
  141.    public String GetLongName() {
  142.       return this.name;
  143.    }
  144.  
  145.    public boolean HasLongName() {
  146.       return false;
  147.    }
  148.  
  149.    public boolean CanPaste() {
  150.       return false;
  151.    }
  152.  
  153.    public void Print(String var1, boolean var2) {
  154.       if (var2 && this.HasLongName() && this.CanPaste()) {
  155.          System.out.println(var1 + this.GetLongName());
  156.       } else {
  157.          System.out.println(var1 + this.GetName());
  158.       }
  159.  
  160.       if (this.HasSubCategory()) {
  161.          Enumeration var3 = this.GetEnumeration();
  162.  
  163.          while(var3.hasMoreElements()) {
  164.             ((InfoPaneItem)var3.nextElement()).Print(var1 + "  ", var2);
  165.          }
  166.       }
  167.  
  168.    }
  169. }
  170.