private static String trimLineTextWithWidth(String text, int width) {
		String tText = text.trim();
		if ("".equals(tText)) return "";
		if (text.length() <= width) return text;
		StringBuilder sb = new StringBuilder();
		int currLoc = 0, nextLoc = 0;

		do {
			currLoc = 0;
			nextLoc = tText.lastIndexOf(" ", width);
			if (nextLoc < currLoc) {
				nextLoc = tText.indexOf(" ", currLoc);
				if (nextLoc < 0) nextLoc = tText.length();
			}

			sb.append(tText.substring(currLoc, nextLoc));
			tText = (tText.length() > nextLoc + 1) ? tText.substring(nextLoc + 1).trim() : "";
			if (tText.length() > 0) {
				sb.append(LINE_SEPARATOR);
				if (tText.length() < width + 1) {
					sb.append(tText);
					tText = "";
				}
			}
		} while (tText.length() > 0);
		return sb.toString();
	}