Source:
<code>public Command buildDeleteTreeElement(final DTreeElement element) { Command cmd = UnexecutableCommand.INSTANCE; if (element instanceof DTreeItem) { if (!getPermissionAuthority().canEditInstance(element)) { cmd = new InvalidPermissionCommand(domain, element); } else { if (!getPermissionAuthority().canEditInstance(element.eContainer())) { cmd = new InvalidPermissionCommand(domain, element.eContainer()); } else { final SiriusCommand result = new SiriusCommand(domain); TreeItemDeletionTool deleteTool = getDeleteTool(element); if (deleteTool != null) { addDeleteTreeElementFromTool(result, element, deleteTool); addRefreshTask(TreeHelper.getTree(element), result, deleteTool); cmd = new NoNullResourceCommand(result, element); } else { final Set<EObject> allSemanticElements = new HashSet<EObject>(); addSemanticElementsToDestroy(element, allSemanticElements); EObjectQuery eObjectQuery = new EObjectQuery(element); <START> DRepresentation dRepresentation = eObjectQuery.getRepresentation().get(); <END> final Set<DSemanticDecorator> tableElements = commandTaskHelper.getDElementToClearFromSemanticElements(dRepresentation, allSemanticElements); for (final DSemanticDecorator decorator : tableElements) { result.getTasks().add(new DeleteTreeElementTask(decorator, modelAccessor)); } final Iterator<EObject> it = allSemanticElements.iterator(); while (it.hasNext()) { final EObject eObj = it.next(); result.getTasks().add(new DeleteTreeElementTask(eObj, modelAccessor)); } addRefreshTask(TreeHelper.getTree(element), result, deleteTool); cmd = new NoNullResourceCommand(result, element); } } } } return cmd; }</code><technical_language>remarks for TableCommandFactory eObjectQuery.getRepresentation().get() TreeHelper.getTree(element)</technical_language>

Target:
public Command buildDeleteTreeElement(final DTreeElement element) { Command cmd = UnexecutableCommand.INSTANCE; if (element instanceof DTreeItem) { if (!getPermissionAuthority().canEditInstance(element)) { cmd = new InvalidPermissionCommand(domain, element); } else { if (!getPermissionAuthority().canEditInstance(element.eContainer())) { cmd = new InvalidPermissionCommand(domain, element.eContainer()); } else { final SiriusCommand result = new SiriusCommand(domain); TreeItemDeletionTool deleteTool = getDeleteTool(element); DTree parentTree = TreeHelper.getTree(element); if (deleteTool != null) { addDeleteTreeElementFromTool(result, element, deleteTool); addRefreshTask(parentTree, result, deleteTool); cmd = new NoNullResourceCommand(result, element); } else { final Set<EObject> allSemanticElements = new HashSet<EObject>(); addSemanticElementsToDestroy(element, allSemanticElements); if (parentTree != null) { final Set<DSemanticDecorator> tableElements = commandTaskHelper.getDElementToClearFromSemanticElements(parentTree, allSemanticElements); for (final DSemanticDecorator decorator : tableElements) { result.getTasks().add(new DeleteTreeElementTask(decorator, modelAccessor)); } } final Iterator<EObject> it = allSemanticElements.iterator(); while (it.hasNext()) { final EObject eObj = it.next(); result.getTasks().add(new DeleteTreeElementTask(eObj, modelAccessor)); } addRefreshTask(parentTree, result, deleteTool); cmd = new NoNullResourceCommand(result, element); } } } } return cmd; }