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 / InfoPaneFieldSubItem.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-15  |  3.4 KB  |  103 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 InfoPaneFieldSubItem implements InfoPaneItem {
  8.    private InfoPaneVector vector;
  9.    private String name;
  10.  
  11.    InfoPaneFieldSubItem(String var1) {
  12.       this.name = JavaString.resource.getString(var1);
  13.       this.vector = new InfoPaneVector();
  14.    }
  15.  
  16.    InfoPaneFieldSubItem(int var1) throws InfoPaneException {
  17.       this("InfoPane_Field_Modifiers");
  18.       if (Modifier.isFinal(var1) && !Modifier.isStatic(var1)) {
  19.          this.AddMember("final");
  20.       } else if (Modifier.isStatic(var1) && !Modifier.isFinal(var1)) {
  21.          this.AddMember("static");
  22.       }
  23.  
  24.       if (Modifier.isTransient(var1)) {
  25.          this.AddMember("transient");
  26.       }
  27.  
  28.       if (Modifier.isVolatile(var1)) {
  29.          this.AddMember("volatile");
  30.       }
  31.  
  32.    }
  33.  
  34.    InfoPaneFieldSubItem(Class var1) throws InfoPaneException {
  35.       this("InfoPane_Type");
  36.  
  37.       String var2;
  38.       for(var2 = ""; var1.isArray(); var2 = var2 + "[]") {
  39.          var1 = var1.getComponentType();
  40.       }
  41.  
  42.       this.AddMember(var1.getName() + var2, var1.toString() + var2);
  43.    }
  44.  
  45.    InfoPaneFieldSubItem(Object var1) throws InfoPaneException {
  46.       this("InfoPane_Value");
  47.       this.AddMember(var1.toString());
  48.    }
  49.  
  50.    InfoPaneMemberItem AddMember(String var1) throws InfoPaneException {
  51.       return (InfoPaneMemberItem)this.vector.Insert(new InfoPaneMemberItem(var1));
  52.    }
  53.  
  54.    InfoPaneMemberItem AddMember(String var1, String var2) throws InfoPaneException {
  55.       return (InfoPaneMemberItem)this.vector.Insert(new InfoPaneMemberItem(var1, var2));
  56.    }
  57.  
  58.    InfoPaneMemberItem FindMember(String var1) {
  59.       return (InfoPaneMemberItem)this.vector.Find(var1);
  60.    }
  61.  
  62.    public boolean HasSubCategory() {
  63.       return this.vector != null && this.vector.size() > 0;
  64.    }
  65.  
  66.    public Enumeration GetEnumeration() {
  67.       return this.vector == null ? null : this.vector.elements();
  68.    }
  69.  
  70.    public String GetName() {
  71.       return this.name;
  72.    }
  73.  
  74.    public String GetLongName() {
  75.       return this.name;
  76.    }
  77.  
  78.    public boolean HasLongName() {
  79.       return false;
  80.    }
  81.  
  82.    public boolean CanPaste() {
  83.       return false;
  84.    }
  85.  
  86.    public void Print(String var1, boolean var2) {
  87.       if (var2 && this.HasLongName() && this.CanPaste()) {
  88.          System.out.println(var1 + this.GetLongName());
  89.       } else {
  90.          System.out.println(var1 + this.GetName());
  91.       }
  92.  
  93.       if (this.HasSubCategory()) {
  94.          Enumeration var3 = this.GetEnumeration();
  95.  
  96.          while(var3.hasMoreElements()) {
  97.             ((InfoPaneItem)var3.nextElement()).Print(var1 + "  ", var2);
  98.          }
  99.       }
  100.  
  101.    }
  102. }
  103.