Adding an option to deactivate the table of content of each package

This commit is contained in:
Cedric Priscal
2015-03-18 14:08:22 -07:00
parent cac3b0ee1d
commit a4864eb012
2 changed files with 23 additions and 14 deletions

View File

@@ -61,6 +61,8 @@ public class HelpOutput {
System.err.println("-version Includes version-tags."); System.err.println("-version Includes version-tags.");
System.err System.err
.println("-hr Prints horizontal rows in the output (to get a better? view)."); .println("-hr Prints horizontal rows in the output (to get a better? view).");
System.err
.println("-nopackagetoc Do not include a table of content for each package");
System.err System.err
.println("-include Creates output in two separated latex documents: one for the preamble part and another for the actual java documentation content."); .println("-include Creates output in two separated latex documents: one for the preamble part and another for the actual java documentation content.");
System.err System.err

View File

@@ -239,6 +239,7 @@ public class TeXDoclet extends Doclet {
static boolean useFieldSummary = true; static boolean useFieldSummary = true;
static boolean useConstructorSummary = true; static boolean useConstructorSummary = true;
static boolean useHr = false; static boolean useHr = false;
static boolean usePackageToc = true;
static boolean shortInheritance = false; static boolean shortInheritance = false;
/** /**
* print writer for extra LaTeX preamble file * print writer for extra LaTeX preamble file
@@ -366,6 +367,8 @@ public class TeXDoclet extends Doclet {
return 2; return 2;
} else if (option.equals("-hr")) { } else if (option.equals("-hr")) {
return 1; return 1;
} else if (option.equals("-nopackagetoc")) {
return 1;
} else if (option.equals("-shortinherited")) { } else if (option.equals("-shortinherited")) {
return 1; return 1;
} else if (option.equals("-help")) { } else if (option.equals("-help")) {
@@ -472,6 +475,8 @@ public class TeXDoclet extends Doclet {
sectionLevelMax = args[i][1]; sectionLevelMax = args[i][1];
} else if (args[i][0].equals("-hr")) { } else if (args[i][0].equals("-hr")) {
useHr = true; useHr = true;
} else if (args[i][0].equals("-nopackagetoc")) {
usePackageToc = false;
} else if (args[i][0].equals("-shortinherited")) { } else if (args[i][0].equals("-shortinherited")) {
shortInheritance = true; shortInheritance = true;
} else if (args[i][0].equals("-help")) { } else if (args[i][0].equals("-help")) {
@@ -645,21 +650,23 @@ public class TeXDoclet extends Doclet {
// "\\markboth{\\protect\\packagename \\hspace{.02in} -- \\protect\\classname}{\\protect\\packagename \\hspace{.02in} -- \\protect\\classname}" // "\\markboth{\\protect\\packagename \\hspace{.02in} -- \\protect\\classname}{\\protect\\packagename \\hspace{.02in} -- \\protect\\classname}"
// ); // );
if (ITALIC.indexOf("textit") != -1) { if (usePackageToc) {
os.println("\\hskip -.05in"); if (ITALIC.indexOf("textit") != -1) {
os.println("\\hskip -.05in");
}
os.println("\\hbox to \\hsize{" + ITALIC
+ " Package Contents\\hfil Page}}");
if (useHr) {
os.println("\\rule{\\hsize}{.7mm}");
}
tocForClasses("Interfaces", pkg.interfaces);
tocForClasses("Classes", pkg.classes);
os.println("\\vskip .1in");
if (useHr) {
os.println("\\rule{\\hsize}{.7mm}");
}
os.println("\\vskip .1in");
} }
os.println("\\hbox to \\hsize{" + ITALIC
+ " Package Contents\\hfil Page}}");
if (useHr) {
os.println("\\rule{\\hsize}{.7mm}");
}
tocForClasses("Interfaces", pkg.interfaces);
tocForClasses("Classes", pkg.classes);
os.println("\\vskip .1in");
if (useHr) {
os.println("\\rule{\\hsize}{.7mm}");
}
os.println("\\vskip .1in");
// The path relative to which <IMG> will be resolved. // The path relative to which <IMG> will be resolved.
packageDir = findPackageDir(pkg.pkg, root); packageDir = findPackageDir(pkg.pkg, root);