1 21 package org.jacorb.ir.gui.typesystem.remote; 22 23 24 import org.omg.CORBA.*; 25 import java.util.*; 26 import javax.swing.tree.*; 27 28 public abstract class IRNode 29 extends org.jacorb.ir.gui.typesystem.TypeSystemNode 30 { 31 protected org.omg.CORBA.IRObject irObject; 32 private TypeCode typeCode; 33 private String versionString = ""; 34 protected String repositoryID = ""; 35 36 39 40 protected IRNode ( ) { 41 super(); 42 } 43 44 47 48 protected IRNode ( IRObject irObject) 49 { 50 super(); 51 setIRObject(irObject); 52 } 54 55 58 59 public String [] allowedToAdd() 60 { 61 return null; 62 } 63 64 67 68 public String description() 69 { 70 String result = super.description(); 71 result = result + "\nVersion:\t" + versionString + "\nRepository ID:\t" + repositoryID; 72 return result; 73 74 } 75 76 79 80 public String getAbsoluteName() 81 { 82 if (absoluteName!=null && !absoluteName.equals("")) 83 { 84 return absoluteName; 85 } 86 else 87 { 88 return name; 89 } 90 } 91 92 95 public TypeCode getTypeCode() 96 { 97 return typeCode; 98 } 99 100 105 106 protected void setIRObject(org.omg.CORBA.IRObject irobj) 107 { 108 this.irObject = irobj; 109 Contained contained; 110 try 111 { 112 contained = ContainedHelper.narrow((org.omg.CORBA.Object )irobj); 113 setName(contained.name()); 114 setAbsoluteName(contained.absolute_name()); 115 versionString = contained.version(); 116 repositoryID = contained.id(); 117 } 118 catch( org.omg.CORBA.BAD_PARAM bp ) 119 { 120 } 122 123 try 124 { 125 IDLType idlType = IDLTypeHelper.narrow((org.omg.CORBA.Object )irobj); 126 typeCode = idlType.type(); 127 128 } 135 catch( org.omg.CORBA.BAD_PARAM bp ) 136 { 137 } 139 } 140 } 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | Popular Tags |