Changeset 111 for trunk/org.modelica.mdt/src/org
- Timestamp:
- 11/01/05 17:35:40 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/org.modelica.mdt/src/org/modelica/mdt/internal/core/ModelicaClass.java
r92 r111 2 2 3 3 import org.modelica.mdt.core.IModelicaClass; 4 import org.modelica.mdt.internal.corba.InitializationException; 5 import org.modelica.mdt.internal.corba.OMCProxy; 4 6 5 7 /** … … 10 12 public class ModelicaClass extends ModelicaElement implements IModelicaClass 11 13 { 12 private String hostPackage;14 private String parentPackage; 13 15 private String className; 14 16 private Type type; 17 18 private boolean typeKnown = false; 15 19 16 20 protected ModelicaClass(String name, String pkg) 17 21 { 18 22 className = name; 19 hostPackage = pkg;23 parentPackage = pkg; 20 24 type = Type.CLASS; 21 25 } … … 28 32 public String getPackage() 29 33 { 30 return hostPackage;34 return parentPackage; 31 35 } 32 36 33 public Type getType() 37 public Type getType() throws InitializationException 34 38 { 39 System.out.println("Trying to fetch type"); 40 if(typeKnown == false) 41 { 42 String fullName = null; 43 if(parentPackage == null) 44 fullName = className; 45 else 46 fullName = parentPackage + "." + className; 47 48 if(OMCProxy.sendExpression("isType(" + fullName + ")").contains("true")) 49 type = Type.TYPE; 50 else if(OMCProxy.sendExpression("isConnector(" + fullName + ")").contains("true")) 51 type = Type.CONNECTOR; 52 else if(OMCProxy.sendExpression("isModel(" + fullName + ")").contains("true")) 53 type = Type.MODEL; 54 else if(OMCProxy.sendExpression("isRecord(" + fullName + ")").contains("true")) 55 type = Type.RECORD; 56 else if(OMCProxy.sendExpression("isBlock(" + fullName + ")").contains("true")) 57 type = Type.BLOCK; 58 else if(OMCProxy.sendExpression("isFunction(" + fullName + ")").contains("true")) 59 type = Type.FUNCTION; 60 61 typeKnown = true; 62 } 63 64 System.out.println("Type is" + type); 35 65 return type; 36 66 }
Note: See TracChangeset
for help on using the changeset viewer.