Code example for HTMLDocument

Methods: removeDocumentListeneraddDocumentListenersetBase

0
		final SHTMLPanel noteViewerComponent = noteController.getNoteViewerComponent();
		if (noteViewerComponent == null) {
			return; 
		} 
		final HTMLDocument document = noteViewerComponent.getDocument();
		document.removeDocumentListener(mNoteDocumentListener);
		try { 
			final URL url = node.getMap().getURL();
			if (url != null) {
				document.setBase(url);
			} 
			else { 
				document.setBase(new URL("file: "));
			} 
		} 
		catch (final Exception e) {
		} 
		noteController.setDefaultFont();
		final String note = node != null ? NoteModel.getNoteText(node) : null;
		if (note != null) {
			noteViewerComponent.setCurrentDocumentContent(note);
			noteController.setLastContentEmpty(false);
		} 
		else if (!noteController.isLastContentEmpty()) {
			noteViewerComponent.setCurrentDocumentContent("");
			noteController.setLastContentEmpty(true);
		} 
		document.addDocumentListener(mNoteDocumentListener);
	} 
} 
Experience pair programming with AI  Get Codota for Java