ModelHandlerImpl extends AbstractModelHandler<Pericope> implements HmxModelHandler { @Override public void removeOneIndentation(final Proposition target) throws HmxException { if (target.getParent() instanceof Pericope) { throw new HmxException(HmxMessage.ERROR_UNINDENT_PERICOPE); } final Proposition parent = ((Proposition) target.getParent()).getFirstPart(); final IPropositionParent parentsParent = parent.getParent(); final List<Proposition> priorChildren = parent.getPriorChildren(); if (CollectionUtil.containsInstance(priorChildren, target)) { for (final Proposition singleChild : new ArrayList<>(priorChildren).subList(0, CollectionUtil.indexOfInstance(priorChildren, target) + 1)) { parent.removeChildProposition(singleChild); parentsParent.insertChildPropositionBeforeFollower(singleChild, parent); } this.notifyListeners(this.getModel(), false); return; } final List<Proposition> laterChildren = parent.getLastPart().getLaterChildren(); if (!CollectionUtil.containsInstance(laterChildren, target)) { throw new HmxException(HmxMessage.ERROR_UNINDENT_ENCLOSED); } final int position = CollectionUtil.indexOfInstance(laterChildren, target); for (int i = laterChildren.size(); i > position; i--) { final Proposition singleChild = laterChildren.get(i - 1); parent.removeChildProposition(singleChild); parentsParent.insertChildPropositionAfterPrior(singleChild, parent); } this.notifyListeners(this.getModel(), false); } ModelHandlerImpl(final Pericope model); @Override void resetModel(final Pericope model); @Override void setMetaData(final String title, final String author, final String comment, final String originTextFontFamily,
            final int originTextFontSize); @Override void indentPropositionUnderParent(final Proposition target, final Proposition parent, final SyntacticalFunction function); @Override void removeOneIndentation(final Proposition target); @Override boolean removeOneIndentationAffectsOthers(final Proposition target); @Override void mergePropositions(final Proposition prop1, final Proposition prop2); @Override void splitProposition(final Proposition target, final ClauseItem lastItemInFirstPart); @Override void resetStandaloneStateOfPartAfterArrow(final Proposition partAfterArrow); @Override void mergeClauseItemWithPrior(final ClauseItem itemTwo); @Override void mergeClauseItemWithFollower(final ClauseItem itemOne); @Override void splitClauseItem(final ClauseItem target, final String firstPart); @Override void setLabelText(final Proposition target, final String labelText); @Override void setSynTranslation(final Proposition target, final String synTranslation); @Override void setSemTranslation(final Proposition target, final String semTranslation); @Override void setComment(final ICommentable target, final String comment); @Override void setSyntacticalFunction(final ICanHaveSyntacticalFunction target, final SyntacticalFunction function); @Override void setClauseItemFontStyle(final ClauseItem target, final Style style); @Override void createRelation(final List<? extends AbstractConnectable> associates, final RelationTemplate template); @Override void rotateAssociateRoles(final Relation target); @Override void alterRelationType(final Relation target, final RelationTemplate template); @Override void removeRelation(final Relation target); @Override void addNewPropositions(final String originText, final boolean inFront); @Override void mergeWithOtherPericope(final Pericope otherPericope, final boolean inFront); @Override void removePropositions(final List<Proposition> targets);  }
@Test(expected = HmxException.class) public void testRemoveOneIndentation_4() throws HmxException { this.modelHandler.removeOneIndentation(this.pericope.getPropositionAt(0)); }