Skip to content

Commit

Permalink
Add HTML help for module descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
caprica committed Feb 3, 2024
1 parent 4abb761 commit 08a9468
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private List<ModuleDescription> getModuleDescriptions(libvlc_module_description_
List<ModuleDescription> result = new ArrayList<ModuleDescription>();
libvlc_module_description_t moduleDescription = moduleDescriptions;
while(moduleDescription != null) {
result.add(new ModuleDescription(moduleDescription.psz_name, moduleDescription.psz_shortname, moduleDescription.psz_longname, moduleDescription.psz_help));
result.add(new ModuleDescription(moduleDescription.psz_name, moduleDescription.psz_shortname, moduleDescription.psz_longname, moduleDescription.psz_help, moduleDescription.psz_help_html));
moduleDescription = moduleDescription.p_next;
}
return result;
Expand Down
21 changes: 19 additions & 2 deletions src/main/java/uk/co/caprica/vlcj/factory/ModuleDescription.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,26 @@ public final class ModuleDescription {
*/
private final String help;

/**
* HTML help text.
*/
private final String helpHtml;

/**
* Create a new module description
*
* @param name name
* @param shortName short name
* @param longName long name
* @param help help text
* @param helpHtml HTML help text
*/
public ModuleDescription(String name, String shortName, String longName, String help) {
public ModuleDescription(String name, String shortName, String longName, String help, String helpHtml) {
this.name = name;
this.shortName = shortName;
this.longName = longName;
this.help = help;
this.helpHtml = helpHtml;
}

/**
Expand Down Expand Up @@ -95,14 +102,24 @@ public String help() {
return help;
}

/**
* Get the module HTML help text.
*
* @return HTML help text
*/
public String helpHtml() {
return helpHtml;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder(200);
sb.append(getClass().getSimpleName()).append('[');
sb.append("name=").append(name).append(',');
sb.append("shortName=").append(shortName).append(',');
sb.append("longName=").append(longName).append(',');
sb.append("help=").append(help).append(']');
sb.append("help=").append(help).append(',');
sb.append("helpHtml=").append(help).append(']');
return sb.toString();
}
}

0 comments on commit 08a9468

Please sign in to comment.