summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-12-13 11:28:54 (EST)
committerStephan Born2013-01-25 12:35:55 (EST)
commit9361c11af56152251046c55a900490883aa48320 (patch)
tree54f13b2d047a42e2659e32da57dc99635ba9ecfb
parentf3bfe0af847788b47a65f0cbc2c5a1776a13012a (diff)
downloadorg.eclipse.stardust.ui.web-9361c11af56152251046c55a900490883aa48320.zip
org.eclipse.stardust.ui.web-9361c11af56152251046c55a900490883aa48320.tar.gz
org.eclipse.stardust.ui.web-9361c11af56152251046c55a900490883aa48320.tar.bz2
CRNT-26209 Pepper: Structure/Document Data: Not able to select structure type from other models (Workaround)
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@61568 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java65
1 files changed, 33 insertions, 32 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java
index b0246f9..bd0940b 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/postprocessing/ExternalElementChangeTracker.java
@@ -52,7 +52,7 @@ public class ExternalElementChangeTracker implements ChangePostprocessor
{
return 10;
}
-
+
@Override
public void inspectChange(Modification change)
{
@@ -68,22 +68,22 @@ public class ExternalElementChangeTracker implements ChangePostprocessor
private void trackModification(EObject candidate, boolean removed, Modification change)
{
- ModelType model = ModelUtils.findContainingModel(candidate);
+ ModelType model = ModelUtils.findContainingModel(candidate);
if(removed)
{
if (candidate.eContainer() instanceof ChangeDescriptionImpl)
{
ChangeDescriptionImpl changeDescription = (ChangeDescriptionImpl) candidate.eContainer();
EObject container = changeDescription.getOldContainer(candidate);
- model = ModelUtils.findContainingModel(container);
- }
+ model = ModelUtils.findContainingModel(container);
+ }
}
-
+
if(model != null)
{
if(candidate instanceof DataType && !removed)
{
- String id = checkIsExternalReference(candidate);
+ String id = checkIsExternalReference(candidate);
if(!StringUtils.isEmpty(id))
{
UnusedModelElementsSearcher searcher = new UnusedModelElementsSearcher();
@@ -94,64 +94,65 @@ public class ExternalElementChangeTracker implements ChangePostprocessor
EList<INodeSymbol> symbols = ((DataType) candidate).getSymbols();
if(symbols.size() == 0)
{
- model.getData().remove(candidate);
- change.markAlsoModified(candidate);
- }
+ model.getData().remove(candidate);
+ change.markAlsoModified(candidate);
+ }
}
- }
+ }
}
-
- UnusedModelElementsSearcher searcher = new UnusedModelElementsSearcher();
+
+ UnusedModelElementsSearcher searcher = new UnusedModelElementsSearcher();
Map matchedElements = searcher.search(model);
List<EObject> children = (List) matchedElements.get(model);
if(children != null)
{
boolean modified = false;
-
+
for(EObject element : children)
{
- String id = checkIsExternalReference(element);
+ String id = checkIsExternalReference(element);
if(!StringUtils.isEmpty(id))
- {
+ {
if(element instanceof IIdentifiableModelElement)
{
if(((IIdentifiableModelElement) element).getSymbols().isEmpty())
{
if(element instanceof RoleType && !LaneParticipantUtil.isUsedInLane((IModelParticipant) element))
{
- model.getRole().remove(element);
+ model.getRole().remove(element);
modified = true;
}
else if(element instanceof ConditionalPerformerType && !LaneParticipantUtil.isUsedInLane((IModelParticipant) element))
{
- model.getConditionalPerformer().remove(element);
- modified = true;
+ model.getConditionalPerformer().remove(element);
+ modified = true;
}
else if(element instanceof OrganizationType && !LaneParticipantUtil.isUsedInLane((IModelParticipant) element))
{
- model.getOrganization().remove(element);
- modified = true;
- }
+ model.getOrganization().remove(element);
+ modified = true;
+ }
else if(element instanceof DataType)
{
- model.getData().remove(element);
- modified = true;
- }
+ //TODO:Investigate - related to delete problem for external Data
+ //model.getData().remove(element);
+ //modified = true;
+ }
if(modified)
{
- change.markAlsoModified(element);
+ change.markAlsoModified(element);
}
}
}
- }
+ }
}
}
- }
+ }
}
-
+
public String checkIsExternalReference(EObject modelElement)
{
- String uri = null;
+ String uri = null;
if (modelElement instanceof Extensible)
{
uri = ExtendedAttributeUtil.getAttributeValue((Extensible) modelElement, IConnectionManager.URI_ATTRIBUTE_NAME);
@@ -165,10 +166,10 @@ public class ExternalElementChangeTracker implements ChangePostprocessor
URI createURI = URI.createURI(uri);
if (IConnectionManager.SCHEME.equals(createURI.scheme()))
{
- return createURI.authority();
+ return createURI.authority();
}
}
- return null;
- }
+ return null;
+ }
} \ No newline at end of file