TreeEditor

Status
Nicht offen für weitere Antworten.

Summer

Mitglied
Ich habe einen TreeEditor (unter vielen anderen) mit der Klasse:

ProjectRepository (Containment)
-Project

eine andere Klasse:

SWCRepository (Containment)
-Software Componenten


und beide klassen sind in der Main Klasse

MainSystem (Containment)
-ProjectRepository
-SWCReposetory

enthalten.

ich kann die Software Componenten auch ins Project Repository unter Project ziehen, das problem ist aber, das wenn ich die Software Componente im Project lösche sie auch in SWCRepository gelöscht wird, obwohl die Software Componente von Project nur referiert wird.

Kann mir da jemand weiter helfen.

Lg
 

Wildcard

Top Contributor
Wenn du nichts dran geändert hast, dann poste doch mal dein ecore, dann lässt sich das leichter nachvollziehen.
 

Summer

Mitglied
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="msc"
nsURI="http://msc/1.0" nsPrefix="msc">
<eClassifiers xsi:type="ecore:EClass" name="OSTask">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="deadline" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isCooperative" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isPreemptive" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="TaskHasSec" lowerBound="1"
upperBound="-1" eType="#//TaskSection" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="TaskToRunRef" lowerBound="1"
upperBound="-1" eType="#//Runnable"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="category" eType="#//Category"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="TaskToPhaRef" lowerBound="1"
upperBound="-1" eType="#//Phase"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TaskSection">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="limit" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="SecToRunRef" lowerBound="1"
upperBound="-1" eType="#//Runnable"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TaskPhase"/>
<eClassifiers xsi:type="ecore:EClass" name="Runnable">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="executionTime" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SoftwareComponent">
<eStructuralFeatures xsi:type="ecore:EReference" name="SCoHasRun" lowerBound="1"
upperBound="-1" eType="#//Runnable" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Project">
<eStructuralFeatures xsi:type="ecore:EReference" name="ProHasTask" lowerBound="1"
upperBound="-1" eType="#//OSTask" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ProToSecRef" upperBound="-1"
eType="#//TaskSection"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ProToPhaRef" upperBound="-1"
eType="#//Phase"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ProToSCoRef" lowerBound="1"
upperBound="-1" eType="#//SoftwareComponent"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MainContainer">
<eStructuralFeatures xsi:type="ecore:EReference" name="MCoHasSWRep" lowerBound="1"
eType="#//SWCRepository" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="MCoHasPhRe" lowerBound="1"
eType="#//PhaseRepository" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="MCoHasProRe" lowerBound="1"
eType="#//ProjectRepository" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SWCRepository">
<eStructuralFeatures xsi:type="ecore:EReference" name="SWRepHasSCo" lowerBound="1"
upperBound="-1" eType="#//SoftwareComponent" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PhaseRepository">
<eStructuralFeatures xsi:type="ecore:EReference" name="PReHasPCh" eType="#//PhaseChain"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="PReHasPh" lowerBound="1"
upperBound="-1" eType="#//Phase" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PhaseChain">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="PChToPhRef" lowerBound="1"
upperBound="-1" eType="#//Phase"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Phase">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="PhaToRunRef" lowerBound="1"
upperBound="-1" eType="#//Runnable"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ProjectRepository">
<eStructuralFeatures xsi:type="ecore:EReference" name="PReHasPro" lowerBound="1"
upperBound="-1" eType="#//Project" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="Category"/>
</ecore:EPackage>
 

Summer

Mitglied
Ich weiss mittlerweile das ich ein Wrapper kreieren muss (override isWrappingNeeded) der so aussieht:

protected Object createWrapper(EObject object, EStructuralFeature feature, Object value, int index)
{
if (!isWrappingNeeded(object)) return value;

if (FeatureMapUtil.isFeatureMap(feature))
{
value = new FeatureMapEntryWrapperItemProvider((FeatureMap.Entry)value, object, (EAttribute)feature, index, adapterFactory, getResourceLocator());
}
else if (feature instanceof EAttribute)
{
value = new AttributeValueWrapperItemProvider(value, object, (EAttribute)feature, index, adapterFactory, getResourceLocator());
}
else if (!((EReference)feature).isContainment())
{
value = new DelegatingWrapperItemProvider(value, object, feature, index, adapterFactory);
}

return value;
}

aber ich weis noch nicht wo ich diesen Wrapper kreieren muss im edit oder im model und dann wo genau?????
 

Summer

Mitglied
Der Wrapper ist anscheinend schon vorhanden, ich habe ihn soeben gefunden.

Also ich weiss wirklich nicht woran es liegt das bei Veränderung der Child Reference die Reference selber auch gelöscht wird. :cry:
 
Status
Nicht offen für weitere Antworten.

Neue Themen


Oben