public void setTextMode(TextMode mode) {
		if (this.mode[depth] == mode) {
			return;
		}
		this.mode[depth] = mode;
		switch (mode) {
			case PRESERVE:
				levelEOL[depth] = null;
				levelIndent[depth] = null;
				levelEOLIndent[depth] = null;
				termEOLIndent[depth] = null;
				break;
			default:
				levelEOL[depth] = lineSeparator;
				if (indent == null || lineSeparator == null) {
					levelEOLIndent[depth] = null;
					termEOLIndent[depth] = null;
				} else {
					if (depth > 0) {
						final StringBuilder sb = new StringBuilder(indent.length() * depth);
						for (int i = 1; i < depth; i++) {
							sb.append(indent);
						}
						// the start point was '1', so we are one indent
						// short, which is just right for the term....
						termEOLIndent[depth] = lineSeparator + sb.toString();
						// but we increase it once for the actual indent.
						sb.append(indent);
						levelIndent[depth] = sb.toString();
					} else {
						termEOLIndent[depth] = lineSeparator; 
						levelIndent[depth] = "";
					}
					levelEOLIndent[depth] = lineSeparator + levelIndent[depth];
				}
		}
		resetReusableIndents();
	}