Changeset 618
- Timestamp:
- 12/13/13 10:28:17 (11 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 1 added
- 3 deleted
- 2 edited
- 3 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Browser.java
r570 r618 170 170 try 171 171 { 172 URL iconURL = ClassLoader.getSystemResource("org/expeditee/ resources/icons/expediteeicon128.png");172 URL iconURL = ClassLoader.getSystemResource("org/expeditee/assets/icons/expediteeicon128.png"); 173 173 if (iconURL != null) 174 174 { -
trunk/src/org/expeditee/gui/FrameUtils.java
r614 r618 1411 1411 1412 1412 // Load documentation and start pages 1413 extract Documentation();1413 extractResources(); 1414 1414 1415 1415 // Add documentation links … … 1433 1433 if (!FrameIO.isValidFramesetName(framesetName)) 1434 1434 continue; 1435 System.out.println(framesetName); 1435 1436 Frame indexFrame = FrameIO.LoadFrame(framesetName + '1'); 1436 1437 // Look through the folder for help index pages … … 1620 1621 1621 1622 /** 1622 * Loads documentation and template files from the jar or the src.1623 * Extracts files/folders from the assets/resources folder directly into ${PARENT_FOLDER} (~/.expeditee) 1623 1624 */ 1624 private static void extract Documentation() {1625 System.out.println(" docs");1625 private static void extractResources() { 1626 System.out.println("resources"); 1626 1627 try { 1627 1628 ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); 1628 URL docURL = classLoader.getResource("org/expeditee/resources"); 1629 1630 String path; 1631 String classPath; 1629 URL docURL = classLoader.getResource("org/expeditee/assets/resources"); 1632 1630 1633 1631 // copy files from the jar file to the profile folder … … 1636 1634 JarFile jf =ju_connection.getJarFile(); 1637 1635 Enumeration<JarEntry> jarEntries = jf.entries(); 1636 String res = "org/expeditee/assets/resources/"; 1637 int resLength = res.length(); 1638 1638 1639 1639 ZipEntry ze; … … 1641 1641 while(jarEntries.hasMoreElements()) { 1642 1642 ze = jarEntries.nextElement(); 1643 if(! (ze.getName().startsWith("org/expeditee/resources/documentation") || ze.getName().startsWith("org/expeditee/resources/dict") || ze.getName().startsWith("org/expeditee/resources/framesets"))) {1643 if(!ze.getName().startsWith(res)) { 1644 1644 continue; 1645 1645 } 1646 // NOTE: assumes HELP_PATH is "${PARENT_FOLDER}/documentation/", DICT_PATH is "${PARENT_FOLDER}/dict/" 1647 File out = new File(FrameIO.PARENT_FOLDER + ze.getName().substring("org/expeditee/resources/".length())); 1646 File out = new File(FrameIO.PARENT_FOLDER + ze.getName().substring(resLength)); 1648 1647 // System.out.println("Didn't crash here " + out.getPath()); 1649 1648 if(out.exists()) { … … 1685 1684 items.addAll(Arrays.asList(folder.listFiles())); 1686 1685 LinkedList<File> files = new LinkedList<File>(); 1686 String res = "org" + File.separator + "expeditee" + File.separator + "assets" + File.separator + "resources"; 1687 int resLength = res.length(); 1688 1687 1689 while (items.size() > 0) { 1688 1690 File file = items.remove(0); … … 1699 1701 for (File file : files) { 1700 1702 System.out.println(file.getPath()); 1701 if(file.getPath().contains("org" + File.separator + "expeditee" + File.separator + "resources" + File.separator + "documentation")) { 1702 path = FrameIO.HELP_PATH; 1703 classPath = "org" + File.separator + "expeditee" + File.separator + "resources" + File.separator + "documentation"; 1704 } else if (file.getPath().contains("org" + File.separator + "expeditee" + File.separator + "resources" + File.separator + "dict")) { 1705 path = FrameIO.DICT_PATH; 1706 classPath = "org" + File.separator + "expeditee" + File.separator + "resources" + File.separator + "dict"; 1707 } else if(file.getPath().contains("org" + File.separator + "expeditee" + File.separator + "resources" + File.separator + "framesets")) { 1708 path = FrameIO.FRAME_PATH; 1709 classPath = "org" + File.separator + "expeditee" + File.separator + "resources" + File.separator + "framesets"; 1710 } else { 1711 continue; 1712 } 1713 File out = new File(path + file.getPath().substring(file.getPath().indexOf(classPath) + classPath.length())); 1703 File out = new File(FrameIO.PARENT_FOLDER + file.getPath().substring(file.getPath().indexOf(res) + resLength)); 1714 1704 if(out.exists()) { 1715 1705 continue;
Note:
See TracChangeset
for help on using the changeset viewer.