private String getElementName(int location) {
		StyledDocument doc = getStyledDocument();
		if (doc != null) {
			Element elem = doc.getCharacterElement(location);
			if (elem != null)
				return elem.getName();
		}
		return null;
	}