home *** CD-ROM | disk | FTP | other *** search
- package lotus.notes.internal;
-
- import java.lang.reflect.Field;
- import java.lang.reflect.Modifier;
- import java.util.Enumeration;
-
- class InfoPaneFieldItem implements InfoPaneItem {
- private String name;
- private String longName;
- private InfoPaneVector vector;
-
- InfoPaneFieldItem(Field var1) {
- this.name = var1.getName();
- Class var2 = var1.getDeclaringClass();
- boolean var3 = Modifier.isPublic(var2.getModifiers());
- this.longName = var3 ? var1.toString() : this.name;
- this.vector = new InfoPaneVector();
-
- try {
- this.AddModifiers(var1);
- this.AddType(var1);
- if (var3) {
- this.AddValue(var1);
- return;
- }
- } catch (InfoPaneException var5) {
- System.out.println("InfoPaneFieldItem constructor: " + var5);
- }
-
- }
-
- public Enumeration GetEnumeration() {
- return this.vector == null ? null : this.vector.elements();
- }
-
- void AddModifiers(Field var1) throws InfoPaneException {
- InfoPaneFieldSubItem var2 = new InfoPaneFieldSubItem(var1.getModifiers());
- if (var2.HasSubCategory()) {
- this.vector.Insert(var2);
- }
-
- }
-
- void AddType(Field var1) throws InfoPaneException {
- InfoPaneFieldSubItem var2 = new InfoPaneFieldSubItem(var1.getType());
- this.vector.Insert(var2);
- }
-
- void AddValue(Field var1) throws InfoPaneException {
- if (Modifier.isFinal(var1.getModifiers())) {
- try {
- InfoPaneFieldSubItem var2 = new InfoPaneFieldSubItem(var1.get((Object)null));
- this.vector.Insert(var2);
- } catch (IllegalAccessException var3) {
- }
- }
- }
-
- public boolean HasSubCategory() {
- return this.vector != null && this.vector.size() > 0;
- }
-
- public String GetName() {
- return this.name;
- }
-
- public String GetLongName() {
- return this.longName;
- }
-
- public boolean HasLongName() {
- return this.longName != null && this.name != null && this.longName.length() > this.name.length();
- }
-
- public boolean CanPaste() {
- return true;
- }
-
- public void Print(String var1, boolean var2) {
- if (var2 && this.HasLongName() && this.CanPaste()) {
- System.out.println(var1 + this.GetLongName());
- } else {
- System.out.println(var1 + this.GetName());
- }
-
- if (this.HasSubCategory()) {
- Enumeration var3 = this.GetEnumeration();
-
- while(var3.hasMoreElements()) {
- ((InfoPaneItem)var3.nextElement()).Print(var1 + " ", var2);
- }
- }
-
- }
- }
-