| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1279,12 +1279,8 @@ public void showReferenceFile(File file) { | |||
| 1279 | 1279 | e.printStackTrace(); | |
| 1280 | 1280 | } | |
| 1281 | 1281 | ||
| 1282 | - if (file.toString().endsWith(".txt")) | ||
| 1283 | - // To enable readme.txt files to open as well | ||
| 1284 | - Base.openFolder(file); | ||
| 1285 | - else | ||
| 1286 | - // Prepend with file:// and also encode spaces & other characters | ||
| 1287 | - Base.openURL(file.toURI().toString()); | ||
| 1282 | + // Prepend with file:// and also encode spaces & other characters | ||
| 1283 | + Base.openURL(file.toURI().toString()); | ||
| 1288 | 1284 | } | |
| 1289 | 1285 | ||
| 1290 | 1286 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ public class Library extends LocalContribution { | |||
| 13 | 13 | //protected File folder; // /path/to/shortname | |
| 14 | 14 | protected File libraryFolder; // shortname/library | |
| 15 | 15 | protected File examplesFolder; // shortname/examples | |
| 16 | - protected File referenceFile; // shortname/reference/index.html is one possible path | ||
| 16 | + protected File referenceFile; // shortname/reference/index.html | ||
| 17 | 17 | ||
| 18 | 18 | /** | |
| 19 | 19 | * Subfolder for grouping libraries in a menu. Basic subfolder support | |
@@ -212,8 +212,6 @@ private Library(File folder, String groupName) { | |||
| 212 | 212 | ||
| 213 | 213 | // get the path for all .jar files in this code folder | |
| 214 | 214 | packageList = Base.packageListFromClassPath(getClassPath()); | |
| 215 | - | ||
| 216 | - referenceFile = loadReferenceIndexFile(folder); | ||
| 217 | 215 | } | |
| 218 | 216 | ||
| 219 | 217 | ||
@@ -518,27 +516,6 @@ public ContributionType getType() { | |||
| 518 | 516 | } | |
| 519 | 517 | ||
| 520 | 518 | ||
| 521 | - /** | ||
| 522 | - * @param folder | ||
| 523 | - * The file object representing the base folder of the contribution | ||
| 524 | - * @return Returns a file object representing the index file of the reference | ||
| 525 | - */ | ||
| 526 | - protected File loadReferenceIndexFile(File folder) { | ||
| 527 | - final String potentialFileList[] = { | ||
| 528 | - "reference/index.html", "reference/index.htm", | ||
| 529 | - "documentation/index.html", "documentation/index.htm", "docs/index.html", | ||
| 530 | - "docs/index.htm", "documentation.html", "documentation.htm", | ||
| 531 | - "reference.html", "reference.htm", "docs.html", "docs.htm", "readme.txt" }; | ||
| 532 | - | ||
| 533 | - int i = 0; | ||
| 534 | - File potentialRef = new File(folder, potentialFileList[i]); | ||
| 535 | - while (!potentialRef.exists() && ++i < potentialFileList.length) { | ||
| 536 | - potentialRef = new File(folder, potentialFileList[i]); | ||
| 537 | - } | ||
| 538 | - return potentialRef; | ||
| 539 | - } | ||
| 540 | - | ||
| 541 | - | ||
| 542 | 519 | /** | |
| 543 | 520 | * Returns the object stored in the referenceFile field, which contains an | |
| 544 | 521 | * instance of the file object representing the index file of the reference | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,7 @@ | |||
| 35 | 35 | public class ToolContribution extends LocalContribution implements Tool { | |
| 36 | 36 | private Tool tool; | |
| 37 | 37 | ||
| 38 | - private File referenceFile; // shortname/reference/index.html is one possible path | ||
| 38 | + private File referenceFile; // shortname/reference/index.html | ||
| 39 | 39 | ||
| 40 | 40 | static public ToolContribution load(File folder) { | |
| 41 | 41 | try { | |
@@ -61,7 +61,7 @@ private ToolContribution(File folder) throws Exception { | |||
| 61 | 61 | tool = (Tool) toolClass.newInstance(); | |
| 62 | 62 | } | |
| 63 | 63 | ||
| 64 | - referenceFile = loadReferenceIndexFile(folder); | ||
| 64 | + referenceFile = new File(folder, "reference/index.html"); | ||
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | 67 | ||
@@ -158,27 +158,6 @@ public ContributionType getType() { | |||
| 158 | 158 | } | |
| 159 | 159 | ||
| 160 | 160 | ||
| 161 | - /** | ||
| 162 | - * @param folder | ||
| 163 | - * The file object representing the base folder of the contribution | ||
| 164 | - * @return Returns a file object representing the index file of the reference | ||
| 165 | - */ | ||
| 166 | - protected File loadReferenceIndexFile(File folder) { | ||
| 167 | - final String potentialFileList[] = { | ||
| 168 | - "reference/index.html", "reference/index.htm", | ||
| 169 | - "documentation/index.html", "documentation/index.htm", "docs/index.html", | ||
| 170 | - "docs/index.htm", "documentation.html", "documentation.htm", | ||
| 171 | - "reference.html", "reference.htm", "docs.html", "docs.htm", "readme.txt" }; | ||
| 172 | - | ||
| 173 | - int i = 0; | ||
| 174 | - File potentialRef = new File(folder, potentialFileList[i]); | ||
| 175 | - while (!potentialRef.exists() && ++i < potentialFileList.length) { | ||
| 176 | - potentialRef = new File(folder, potentialFileList[i]); | ||
| 177 | - } | ||
| 178 | - return potentialRef; | ||
| 179 | - } | ||
| 180 | - | ||
| 181 | - | ||
| 182 | 161 | /** | |
| 183 | 162 | * Returns the object stored in the referenceFile field, which contains an | |
| 184 | 163 | * instance of the file object representing the index file of the reference | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -340,8 +340,8 @@ private boolean addToolReferencesToSubMenu(ArrayList<ToolContribution> toolsList | |||
| 340 | 340 | Iterator<ToolContribution> iter = toolsList.iterator(); | |
| 341 | 341 | while (iter.hasNext()) { | |
| 342 | 342 | final ToolContribution toolContrib = iter.next(); | |
| 343 | - if (toolContrib.hasReference()) { | ||
| 344 | - final File toolRef = toolContrib.getReferenceIndexFile(); | ||
| 343 | + final File toolRef = new File(toolContrib.getFolder(), "reference/index.html"); | ||
| 344 | + if (toolRef.exists()) { | ||
| 345 | 345 | JMenuItem libRefItem = new JMenuItem(toolContrib.getName()); | |
| 346 | 346 | libRefItem.addActionListener(new ActionListener() { | |
| 347 | 347 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments