From: Benjamin B. <bg...@us...> - 2005-05-19 09:17:58
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2326/Plugin/com/ibm/ecute/rsa/core/internal/properties Modified Files: QualifiersPropertySection.java Log Message: Qualifiers tab is refreshed after edit qualifiers dialog is left. Qualifiers of association properties which are not ownedEnds of the associationcan now be show and edited Index: QualifiersPropertySection.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/QualifiersPropertySection.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- QualifiersPropertySection.java 10 May 2005 09:11:54 -0000 1.12 +++ QualifiersPropertySection.java 19 May 2005 09:17:49 -0000 1.13 @@ -119,6 +119,7 @@ { int ai = qualifiersTable.getSelectionIndex(); editValue(ai, false); + refresh(); } }); @@ -446,16 +447,21 @@ //Qualifiers with Property Scope if(element instanceof Property){ - Property prop = (Property)element; + Property prop = (Property)element; Property oppositeProp = null; + + boolean isOwnedEnd = propertyIsOwnedEnd(prop); + // get the property of the other association end - if (prop.getOwner() instanceof AssociationClass){ + if (isOwnedEnd /*&& prop.getOwner() instanceof AssociationClass*/){ AssociationClass parentClass = (AssociationClass)prop.getOwner(); List ends = parentClass.getOwnedEnds(); if ((Property)ends.get(0) == prop){ + isOwnedEnd = true; oppositeProp = (Property)ends.get(1); } if ((Property)ends.get(1) == prop){ + isOwnedEnd = true; oppositeProp = (Property)ends.get(0); } @@ -494,7 +500,7 @@ allAvailableQualifers.remove(qualifierObject); } //Qualifier: Max, Min - if(prop.getOwner() instanceof AssociationClass){ + if(isOwnedEnd /*&& prop.getOwner() instanceof AssociationClass*/){ if(((AssociationClass)prop.getOwner()).getOwnedEnds().contains(prop)){ if(prop.getUpper() != MultiplicityElement.UNLIMITED_UPPER_BOUND){ qualifierName = "Max"; @@ -639,6 +645,23 @@ refresh(); } + private boolean propertyIsOwnedEnd(Property prop){ + + boolean isOwnedEnd = false; + if (prop.getOwner() instanceof AssociationClass){ + AssociationClass parentClass = (AssociationClass)prop.getOwner(); + List ends = parentClass.getOwnedEnds(); + if ((Property)ends.get(0) == prop){ + isOwnedEnd = true; + } + if ((Property)ends.get(1) == prop){ + isOwnedEnd = true; + } + return isOwnedEnd; + } else { + return false; + } + } protected void removeQualifier(int ai) { |