From: Benjamin B. <bg...@us...> - 2005-04-08 09:11:28
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32031/Plugin/com/ibm/ecute/rsa/core/internal/properties Modified Files: QualifiersPropertySection.java Log Message: [ 1179045 ] Various issues in eCute4RSA Index: QualifiersPropertySection.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/QualifiersPropertySection.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- QualifiersPropertySection.java 30 Mar 2005 10:57:09 -0000 1.10 +++ QualifiersPropertySection.java 8 Apr 2005 09:11:18 -0000 1.11 @@ -83,7 +83,7 @@ private Table qualifiersTable; private ArrayList defaultValueQualifiers; //private Font boldFont; - + public QualifiersPropertySection() { @@ -365,22 +365,32 @@ //Qualifiers with Parameter Scope if(element instanceof Parameter){ //Qualifiers: In, Out - ParameterDirectionKind kind = ((Parameter)element).getDirection(); + boolean exists = false; + ParameterDirectionKind kind = ((Parameter)element).getDirection(); if(kind.getValue() == ParameterDirectionKind.IN || kind.getValue() == ParameterDirectionKind.INOUT){ qualifierName = "In"; Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); - addQualiferToTable(qualifierName, "true", definedIn, qualifierObject, -1, false); + exists = existsQualifierInTable(qualifierName); + if(!exists){ + addQualiferToTable(qualifierName, "true", definedIn, qualifierObject, -1, false); + } allAvailableQualifers.remove(qualifierObject); }else{ qualifierName = "In"; Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); - addQualiferToTable(qualifierName, "false", definedIn, qualifierObject, -1, false); + exists = existsQualifierInTable(qualifierName); + if(!exists){ + addQualiferToTable(qualifierName, "false", definedIn, qualifierObject, -1, false); + } allAvailableQualifers.remove(qualifierObject); } if(kind.getValue() == ParameterDirectionKind.OUT || kind.getValue() == ParameterDirectionKind.INOUT){ qualifierName = "Out"; Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); - addQualiferToTable(qualifierName, "true", definedIn, qualifierObject, -1, false); + exists = existsQualifierInTable(qualifierName); + if(!exists){ + addQualiferToTable(qualifierName, "true", definedIn, qualifierObject, -1, false); + } allAvailableQualifers.remove(qualifierObject); } @@ -403,39 +413,41 @@ Property prop = (Property)element; Property oppositeProp = null; // get the property of the other association end - AssociationClass parentClass = (AssociationClass)prop.getOwner(); - List ends = parentClass.getOwnedEnds(); - if ((Property)ends.get(0) == prop){ - oppositeProp = (Property)ends.get(1); - } - if ((Property)ends.get(1) == prop){ - oppositeProp = (Property)ends.get(0); - } + if (prop.getOwner() instanceof AssociationClass){ + AssociationClass parentClass = (AssociationClass)prop.getOwner(); + List ends = parentClass.getOwnedEnds(); + if ((Property)ends.get(0) == prop){ + oppositeProp = (Property)ends.get(1); + } + if ((Property)ends.get(1) == prop){ + oppositeProp = (Property)ends.get(0); + } - //Qualifier: Aggregate - qualifierName = "Aggregate"; - // to get an aggregation or composition in RSA - // the association property with the diamond has to have the aggregation type NONE - // the opposite side (the side without the diamond) has to have aggregation type - // SHARED or COMPOSITE - // so the aggregation kind of the opposite side has to be checked to set the aggregation - // qualifier of the aggregation property correct - boolean exists = false; - if(oppositeProp.getAggregation().getValue()== AggregationKind.SHARED - || oppositeProp.getAggregation().getValue()== AggregationKind.COMPOSITE){ - Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); - exists = existsQualifierInTable(qualifierName); - if (!exists){ - addQualiferToTable(qualifierName, "true", definedIn, qualifierObject, -1, false); - } - allAvailableQualifers.remove(qualifierObject); - } else { - Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); - exists = existsQualifierInTable(qualifierName); - if (!exists){ - addQualiferToTable(qualifierName, "false", definedIn, qualifierObject, -1, false); + //Qualifier: Aggregate + qualifierName = "Aggregate"; + // to get an aggregation or composition in RSA + // the association property with the diamond has to have the aggregation type NONE + // the opposite side (the side without the diamond) has to have aggregation type + // SHARED or COMPOSITE + // so the aggregation kind of the opposite side has to be checked to set the aggregation + // qualifier of the aggregation property correct + boolean exists = false; + if(oppositeProp.getAggregation().getValue()== AggregationKind.SHARED + || oppositeProp.getAggregation().getValue()== AggregationKind.COMPOSITE){ + Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); + exists = existsQualifierInTable(qualifierName); + if (!exists){ + addQualiferToTable(qualifierName, "true", definedIn, qualifierObject, -1, false); + } + allAvailableQualifers.remove(qualifierObject); + } else { + Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); + exists = existsQualifierInTable(qualifierName); + if (!exists){ + addQualiferToTable(qualifierName, "false", definedIn, qualifierObject, -1, false); + } + allAvailableQualifers.remove(qualifierObject); } - allAvailableQualifers.remove(qualifierObject); } //Qualifier: Key qualifierName = "Key"; @@ -499,7 +511,10 @@ String octetstring = "octetstring"; String octetstring_array = "octetstring[]"; Operation op = (Operation)element; - Type type = op.getReturnResult("ReturnType").getType(); + Type type = null; + if(op.getReturnResult("ReturnType") != null){ + op.getReturnResult("ReturnType").getType(); + } if(type != null){ if(type.getName().equalsIgnoreCase(octetstring) || type.getName().equalsIgnoreCase(octetstring_array)){ Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); @@ -545,13 +560,13 @@ if(qualifier.referenceScope) addQualiferToTable(qualifier.name, qualifier.defaultValue, definedIn, qualifier, -1, true); //applicableQualifiers.add(qualifier); - }else{ - if(qualifier.propertyScope) + } else { + if(qualifier.propertyScope) addQualiferToTable(qualifier.name, qualifier.defaultValue, definedIn, qualifier, -1, true); //applicableQualifiers.add(qualifier); } }else if(element instanceof Parameter){ - if(qualifier.parameterScope || qualifier.referenceScope) + if(qualifier.parameterScope /*|| qualifier.referenceScope*/) addQualiferToTable(qualifier.name, qualifier.defaultValue, definedIn, qualifier, -1, true); //applicableQualifiers.add(qualifier); } @@ -634,7 +649,9 @@ protected void editValue(int ai, boolean setDefaultValue) { - final QualifierValueObject qualifier = (QualifierValueObject)qualifiersTable.getItem(ai).getData(); + //new EditQualifiers(); + + final QualifierValueObject qualifier = (QualifierValueObject)qualifiersTable.getItem(ai).getData(); if(qualifier == null) { return; |