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 / InfoPaneMethodSubItem.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-15  |  3.6 KB  |  115 lines

  1. package lotus.notes.internal;
  2.  
  3. import java.lang.reflect.Modifier;
  4. import java.util.Enumeration;
  5. import lotus.notes.JavaString;
  6.  
  7. class InfoPaneMethodSubItem implements InfoPaneItem {
  8.    private InfoPaneVector vector;
  9.    private String name;
  10.  
  11.    InfoPaneMethodSubItem(String var1) {
  12.       this.name = JavaString.resource.getString(var1);
  13.       this.vector = new InfoPaneVector();
  14.    }
  15.  
  16.    InfoPaneMethodSubItem(int var1, boolean var2) throws InfoPaneException {
  17.       this("InfoPane_Method_Modifiers");
  18.       if (!var2 && Modifier.isAbstract(var1)) {
  19.          this.AddMember("abstract");
  20.       }
  21.  
  22.       if (Modifier.isFinal(var1)) {
  23.          this.AddMember("final");
  24.       }
  25.  
  26.       if (Modifier.isNative(var1)) {
  27.          this.AddMember("native");
  28.       }
  29.  
  30.       if (Modifier.isSynchronized(var1)) {
  31.          this.AddMember("synchronized");
  32.       }
  33.  
  34.    }
  35.  
  36.    InfoPaneMethodSubItem(Class[] var1) throws InfoPaneException {
  37.       this("InfoPane_Throws");
  38.  
  39.       try {
  40.          for(int var2 = 0; var1[var2] != null; ++var2) {
  41.             Class var3 = var1[var2];
  42.             if (Modifier.isPublic(var3.getModifiers())) {
  43.                this.AddMember(var3.getName(), var3.toString());
  44.             }
  45.          }
  46.  
  47.       } catch (ArrayIndexOutOfBoundsException var4) {
  48.       }
  49.    }
  50.  
  51.    InfoPaneMethodSubItem(Class var1) throws InfoPaneException {
  52.       this("InfoPane_Return_Type");
  53.  
  54.       String var2;
  55.       for(var2 = ""; var1.isArray(); var2 = var2 + "[]") {
  56.          var1 = var1.getComponentType();
  57.       }
  58.  
  59.       this.AddMember(var1.getName() + var2, var1.toString() + var2);
  60.    }
  61.  
  62.    InfoPaneMemberItem AddMember(String var1) throws InfoPaneException {
  63.       return (InfoPaneMemberItem)this.vector.Insert(new InfoPaneMemberItem(var1));
  64.    }
  65.  
  66.    InfoPaneMemberItem AddMember(String var1, String var2) throws InfoPaneException {
  67.       return (InfoPaneMemberItem)this.vector.Insert(new InfoPaneMemberItem(var1, var2));
  68.    }
  69.  
  70.    InfoPaneMemberItem FindMember(String var1) {
  71.       return (InfoPaneMemberItem)this.vector.Find(var1);
  72.    }
  73.  
  74.    public boolean HasSubCategory() {
  75.       return this.vector != null && this.vector.size() > 0;
  76.    }
  77.  
  78.    public Enumeration GetEnumeration() {
  79.       return this.vector == null ? null : this.vector.elements();
  80.    }
  81.  
  82.    public String GetName() {
  83.       return this.name;
  84.    }
  85.  
  86.    public String GetLongName() {
  87.       return this.name;
  88.    }
  89.  
  90.    public boolean HasLongName() {
  91.       return false;
  92.    }
  93.  
  94.    public boolean CanPaste() {
  95.       return false;
  96.    }
  97.  
  98.    public void Print(String var1, boolean var2) {
  99.       if (var2 && this.HasLongName() && this.CanPaste()) {
  100.          System.out.println(var1 + this.GetLongName());
  101.       } else {
  102.          System.out.println(var1 + this.GetName());
  103.       }
  104.  
  105.       if (this.HasSubCategory()) {
  106.          Enumeration var3 = this.GetEnumeration();
  107.  
  108.          while(var3.hasMoreElements()) {
  109.             ((InfoPaneItem)var3.nextElement()).Print(var1 + "  ", var2);
  110.          }
  111.       }
  112.  
  113.    }
  114. }
  115.