@Override
	public void onUpdatePath(@Nonnull PathNode<?> path) {
		this.path = path;

		WorkspaceComments workspaceComments = commentManager.getCurrentWorkspaceComments();
		if (workspaceComments == null)
			return;

		String comment = null;
		if (path instanceof ClassMemberPathNode memberPath) {
			ClassPathNode classPath = memberPath.getParent();
			ClassComments classComments = workspaceComments.getClassComments(classPath);
			if (classComments != null) {
				ClassMember member = memberPath.getValue();
				if (member.isMethod()) {
					comment = classComments.getMethodComment(member.getName(), member.getDescriptor());
				} else {
					comment = classComments.getFieldComment(member.getName(), member.getDescriptor());
				}
			}
		} else if (path instanceof ClassPathNode classPath) {
			ClassComments classComments = workspaceComments.getClassComments(classPath);
			if (classComments != null)
				comment = classComments.getClassComment();
		}

		if (comment != null)
			editor.setText(comment);
	}
Pane for editing the comments on a class, field, or method.

@author Matt Coley
recaf-ui/src/main/java/software/coley/recaf/ui/pane/CommentEditPane.java