From: Benjamin B. <bg...@us...> - 2005-08-05 07:55:24
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1099/Plugin/com/ibm/ecute/rsa/core/internal/dialogs Modified Files: EditQualifiersDialog.java Log Message: flavors check Index: EditQualifiersDialog.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/dialogs/EditQualifiersDialog.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- EditQualifiersDialog.java 28 Jul 2005 17:59:51 -0000 1.11 +++ EditQualifiersDialog.java 5 Aug 2005 07:55:14 -0000 1.12 @@ -1156,110 +1156,7 @@ if(!valueObject.equals(oldValueObject)){ if(valueObject.name.equalsIgnoreCase("Override")){ - handleOverrideSet(valueObject); -// // set reference name to override value if the name is not defined -// if(element.getName().equalsIgnoreCase("")){ -// EditingDomain editingDomain = UMLModeler.getEditingDomain(); -// try { -// final String value = valueObject.value; -// -// editingDomain.run( new ResourceSetModifyOperation("SetOverrideRoleName") { -// -// protected void execute(IProgressMonitor monitor) -// throws InvocationTargetException, InterruptedException { -// -// element.setName(value); -// } -// }, new NullProgressMonitor()); -// -// } catch (InvocationTargetException e) { -// e.printStackTrace(); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } -// -// } -// // propagate native inherited values -// if (valueObject.value.equalsIgnoreCase("null")){ -// editValue(valueObject, true); -// fillValueTable(element, valueTable); -// } else { -// editValue(valueObject, false); -// if(valueObject.value.equalsIgnoreCase(element.getName())){ -// FlavorsHelper flavorsHelper = new FlavorsHelper(element.getModel()); -// flavorsHelper.applyNativeInheritedValues(element, false); -// if(element instanceof Property){ -// int minIndex = -1; -// int maxIndex = -1; -// int writeIndex = -1; -// for(int j = 0; j < valueTable.getItemCount(); j++){ -// QualifierValueObject object = (QualifierValueObject)valueTable.getItem(j).getData(); -// if(object.name.equalsIgnoreCase("Min") -// && (valueTable.getItem(j).getBackground() == YELLOW || valueTable.getItem(j).getBackground() == RED)){ -// minIndex = j; -// } else if(object.name.equalsIgnoreCase("Max") -// && (valueTable.getItem(j).getBackground() == YELLOW || valueTable.getItem(j).getBackground() == RED)){ -// maxIndex = j; -// } else if(object.name.equalsIgnoreCase("Write") -// && (valueTable.getItem(j).getBackground() == YELLOW || valueTable.getItem(j).getBackground() == RED)){ -// writeIndex = j; -// } -// } -// -// if(minIndex > -1){ -// if(valueTable.getItem(minIndex).getBackground() == YELLOW){ -// removeFromEditedValues((QualifierValueObject)valueTable.getItem(minIndex).getData()); -// } else if(valueTable.getItem(minIndex).getBackground() == RED){ -// removeFromRemovedValues((QualifierValueObject)valueTable.getItem(minIndex).getData()); -// } -// valueTable.getItem(minIndex).setBackground(WHITE); -// } -// if(maxIndex > -1){ -// if(valueTable.getItem(maxIndex).getBackground() == YELLOW){ -// removeFromEditedValues((QualifierValueObject)valueTable.getItem(maxIndex).getData()); -// } else if(valueTable.getItem(maxIndex).getBackground() == RED){ -// removeFromRemovedValues((QualifierValueObject)valueTable.getItem(maxIndex).getData()); -// } -// valueTable.getItem(maxIndex).setBackground(WHITE); -// } -// if(writeIndex > -1){ -// if(valueTable.getItem(writeIndex).getBackground() == YELLOW){ -// removeFromEditedValues((QualifierValueObject)valueTable.getItem(writeIndex).getData()); -// } else if(valueTable.getItem(writeIndex).getBackground() == RED){ -// removeFromRemovedValues((QualifierValueObject)valueTable.getItem(writeIndex).getData()); -// } -// valueTable.getItem(writeIndex).setBackground(WHITE); -// MessageBox messageBox = -// new MessageBox(Display.getCurrent().getActiveShell(), -// SWT.OK| -// SWT.ICON_INFORMATION); -// messageBox.setText("Override qualifier set"); -// messageBox.setMessage("The \"override\" qualifier is set and so the value of\n" + -// "the \"write\" qualifier is inherited from the corresponding\n" + -// "property of the parent class.\n\n" + -// "The pending change for the \"write\" qualifier was removed."); -// messageBox.open(); -// } -// -// if(minIndex > -1 || maxIndex > -1){ -// MessageBox messageBox = -// new MessageBox(Display.getCurrent().getActiveShell(), -// SWT.OK| -// SWT.ICON_INFORMATION); -// messageBox.setText("Override qualifier set"); -// messageBox.setMessage("The \"override\" qualifier is set and so the value of\n" + -// "the \"min\" and/or the \"max\" qualifier ise inherited\n" + -// "from the corresponding association end of the parent\n" + -// "association class.\n\n" + -// "The pending changes for the \"min\" and/or the \"max\"\n" + -// "qualifier were removed."); -// messageBox.open(); -// } -// } -// } -// fillValueTable(element, valueTable); -// } } else { @@ -1388,15 +1285,6 @@ allAvailableQualifers.add(vector.get(i)); } -// String definedIn = ""; -// if(element instanceof Class){ -// definedIn = element.getName(); -// }else{ -// Element owner = element.getOwner(); -// if(owner instanceof NamedElement) -// definedIn = ((NamedElement)element.getOwner()).getName(); -// } - String definedIn = ""; if(element instanceof Class){ definedIn = element.getName(); @@ -1413,14 +1301,13 @@ List qualifierNames = (List) element.getValue(cimStereotype, "QualifierName"); List qualifierValues = (List) element.getValue(cimStereotype, "QualifierValue"); - for(int i=0; i<qualifierNames.size(); i++){ + for(int i = 0; i < qualifierNames.size(); i++){ String qualifierName = (String)qualifierNames.get(i); String qualifierValue = (String)qualifierValues.get(i); Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); addQualiferToValueTable(qualifierName, qualifierValue, definedIn, qualifierObject, i, false); allAvailableQualifers.remove(qualifierObject); - } //display all qualifiers witch are mapped directly to the model @@ -1699,7 +1586,7 @@ Operation op = (Operation)element; Type type = null; if(op.getReturnResult("ReturnType") != null){ - op.getReturnResult("ReturnType").getType(); + type = op.getReturnResult("ReturnType").getType(); } if(type != null){ if(type.getName().equalsIgnoreCase(octetstring) || type.getName().equalsIgnoreCase(octetstring_array)){ @@ -2268,7 +2155,9 @@ } } rolesComboBox.add(roleName,i); - propertiesComboBox.remove(roleName); + if(propertiesComboBox.getData(roleName) != null){ + propertiesComboBox.remove(roleName); + } } rolesComboBox.setText("Roles"); } @@ -3813,7 +3702,7 @@ } valueTable.getItem(maxIndex).setBackground(WHITE); } - + if(writeIndex > -1){ if(valueTable.getItem(writeIndex).getBackground().equals(YELLOW)){ removeFromEditedValues((QualifierValueObject)valueTable.getItem(writeIndex).getData()); @@ -3827,9 +3716,9 @@ SWT.ICON_INFORMATION); messageBox.setText("Override qualifier set"); messageBox.setMessage("The \"override\" qualifier is set and so the value of\n" + - "the \"write\" qualifier is inherited from the corresponding\n" + - "property of the parent class.\n\n" + - "The pending change for the \"write\" qualifier was removed."); + "the \"write\" qualifier is inherited from the corresponding\n" + + "property of the parent class.\n\n" + + "The pending change for the \"write\" qualifier was removed."); messageBox.open(); } @@ -3840,43 +3729,45 @@ SWT.ICON_INFORMATION); messageBox.setText("Override qualifier set"); messageBox.setMessage("The \"override\" qualifier is set and so the value of\n" + - "the \"min\" and/or the \"max\" qualifier is inherited\n" + - "from the corresponding association end of the parent\n" + - "association class.\n\n" + - "The pending changes for the \"min\" and/or the \"max\"\n" + - "qualifier were removed."); + "the \"min\" and/or the \"max\" qualifier is inherited\n" + + "from the corresponding association end of the parent\n" + + "association class.\n\n" + + "The pending changes for the \"min\" and/or the \"max\"\n" + + "qualifier were removed."); messageBox.open(); } // set effective inherited Values CheckAndRepair checker = new CheckAndRepair(element.getModel()); - //checker.applyAllNativeInheritedValues((Property)element); + + // if element is a reference then set the aggregate qualifer using the parent class + if(checker.isReference(element)){ + flavorsHelper.applyNativeInheritedValues((AssociationClass)element.getOwner(), true); + } // if the element in which the override qualifier is set has child elements then // a question dialog is shown which asks if the min/max/write qualifiers value // should be propagated + boolean skipEnableOverride = true; ArrayList overrideSubProperties = checker.getOverrideSubProperties((Property)element); if(overrideSubProperties.size() > 0){ if(checker.isReference(element)){ + //flavorsHelper.applyNativeInheritedValues((AssociationClass)element.getOwner(), true); MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(), SWT.YES|SWT.NO| SWT.ICON_QUESTION); messageBox.setText("Propagate qualifier values"); messageBox.setMessage("Do you want to propagate the qualifier values of\n" + - "the \"min\" and \"max\" qualifiers to the association\n" + - "ends of the subclasses?"); + "the \"min\" and \"max\" qualifiers to the association\n" + + "ends of the subclasses?"); int returnResult = messageBox.open(); if(returnResult == SWT.YES){ - // set the min/max values in the subProperties - for(int i = 0; i < overrideSubProperties.size(); i++){ - Property subProperty = (Property)overrideSubProperties.get(i); - subProperty.setLowerValue(((Property)element).getLowerValue()); - subProperty.setUpperValue(((Property)element).getUpperValue()); - } + skipEnableOverride = false; } + } else { MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(), @@ -3884,22 +3775,18 @@ SWT.ICON_QUESTION); messageBox.setText("Propagate qualifier values"); messageBox.setMessage("Do you want to propagate the qualifier value of\n" + - "the \"write\" qualifier to the properites of\n" + - "the subclasses?"); + "the \"write\" qualifier to the properites of\n" + + "the subclasses?"); int returnResult = messageBox.open(); if(returnResult == SWT.YES){ - // set the write value in the subProperties - for(int i = 0; i < overrideSubProperties.size(); i++){ - Property subProperty = (Property)overrideSubProperties.get(i); - subProperty.setIsReadOnly(((Property)element).isReadOnly()); - } + skipEnableOverride = false; } } // propagate all native qualifiers except min,max and write for(int i = 0; i < overrideSubProperties.size(); i++){ - checker.applyAllNativeInheritedValues((Property)overrideSubProperties.get(i)); + flavorsHelper.applyNativeInheritedValues((Property)overrideSubProperties.get(i), skipEnableOverride); } } @@ -3911,7 +3798,6 @@ } fillValueTable(element, valueTable); } - } private void addToEditedValues(QualifierValueObject valueObject){ |