Skip to content
Snippets Groups Projects
Commit 4960564f authored by Florian Hölzl's avatar Florian Hölzl
Browse files

fixed delete

refs 351
parent 94034458
No related branches found
No related tags found
No related merge requests found
......@@ -23,16 +23,13 @@ import org.fortiss.tooling.base.model.base.ConnectorBase;
import org.fortiss.tooling.base.model.base.EntryConnectorBase;
import org.fortiss.tooling.base.model.base.ExitConnectorBase;
import org.fortiss.tooling.base.model.base.HierarchicElementBase;
import org.fortiss.tooling.base.model.element.IConnection;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.base.model.element.IModelElementSpecification;
import org.fortiss.tooling.base.ui.dnd.gef.ConnectionDragContext;
import org.fortiss.tooling.base.ui.editpart.FreeConnectorEditPartBase;
import org.fortiss.tooling.kernel.extension.IConnectionCompositor;
import org.fortiss.tooling.kernel.extension.data.IConnectionCompositionContext;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
/**
......@@ -41,7 +38,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: C94499EC031FDED2F6E2486CBE372771
* @ConQAT.Rating YELLOW Hash: BF580E0E9288B911232B85705FA1BA19
*/
public abstract class ConnectorConnectionCompositorBase<HE extends IHierarchicElement, S extends IConnector, T extends IConnector>
implements IConnectionCompositor<HE, S, T> {
......@@ -255,15 +252,6 @@ public abstract class ConnectorConnectionCompositorBase<HE extends IHierarchicEl
if (!canDisconnectSpecific(connection)) {
return false;
}
if (connection instanceof IConnection) {
IConnection conn = (IConnection) connection;
for (IModelElementSpecification spec : conn.getSpecificationsList()) {
if (!IElementCompositorService.INSTANCE.canDecompose(spec)) {
return false;
}
}
}
return true;
}
......
......@@ -22,7 +22,6 @@ import org.eclipse.gef.RootEditPart;
import org.fortiss.tooling.base.model.element.IConnection;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.base.model.element.IModelElementSpecification;
import org.fortiss.tooling.base.ui.dnd.gef.ConnectionDragContext;
import org.fortiss.tooling.base.ui.dnd.gef.ElementDropContext;
import org.fortiss.tooling.base.ui.editpart.DiagramEditPartBase;
......@@ -56,7 +55,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 04720A8197A9EB98DDAC140197C8A2A9
* @ConQAT.Rating YELLOW Hash: 3285EEEA692650AD1130A074EE3F75F8
*/
public abstract class HierarchicElementConnectionCompositorBase<HE extends IHierarchicElement, S extends IHierarchicElement, T extends IHierarchicElement>
implements IConnectionCompositor<HE, S, T> {
......@@ -147,14 +146,6 @@ public abstract class HierarchicElementConnectionCompositorBase<HE extends IHier
/** {@inheritDoc} */
@Override
public boolean canDisconnect(EObject connection) {
if (connection instanceof IConnection) {
IConnection conn = (IConnection) connection;
for (IModelElementSpecification spec : conn.getSpecificationsList()) {
if (!IElementCompositorService.INSTANCE.canDecompose(spec)) {
return false;
}
}
}
return true;
}
......
......@@ -39,7 +39,7 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService;
* @author doebber
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 0C8A1BCCA3B14C572278D536050034C5
* @ConQAT.Rating YELLOW Hash: E5DA3C13BF3E5399E425B401D62C0579
*/
public abstract class HierarchicElementCompositorBase<HE extends IHierarchicElementContainer>
implements IElementCompositor<HE> {
......@@ -164,14 +164,14 @@ public abstract class HierarchicElementCompositorBase<HE extends IHierarchicElem
}
/**
* Base implementation returns compositors' decomposition by default and
* invokes EcoreUtil.delete() otherwise. Subclasses may override.
* Base implementation uses element compositor service's decomposition by
* default and returns <code>true</code>. Subclasses may override.
*/
protected boolean decomposeSpecification(IModelElementSpecification element) {
if (IElementCompositorService.INSTANCE.canDecompose(element)) {
return IElementCompositorService.INSTANCE.decompose(element);
}
EcoreUtil.delete(element);
// no delete here, since normally specs are destroyed with the element
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment