| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,16 +53,20 @@ public class Platform { | |||
| 53 | 53 | Base base; | |
| 54 | 54 | ||
| 55 | 55 | ||
| 56 | + public void init(Base base) { | ||
| 57 | + this.base = base; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + | ||
| 56 | 61 | /** | |
| 57 | 62 | * Set the default L & F. While I enjoy the bounty of the sixteen possible | |
| 58 | 63 | * exception types that this UIManager method might throw, I feel that in | |
| 59 | 64 | * just this one particular case, I'm being spoiled by those engineers | |
| 60 | - * at Sun, those Masters of the Abstractionverse. It leaves me feeling sad | ||
| 61 | - * and overweight. So instead, I'll pretend that I'm not offered eleven dozen | ||
| 62 | - * ways to report to the user exactly what went wrong, and I'll bundle them | ||
| 63 | - * all into a single catch-all "Exception". Because in the end, all I really | ||
| 64 | - * care about is whether things worked or not. And even then, I don't care. | ||
| 65 | - * | ||
| 65 | + * at Sun, those Masters of the Abstractionverse. So instead, I'll pretend | ||
| 66 | + * that I'm not offered eleven dozen ways to report to the user exactly what | ||
| 67 | + * went wrong, and I'll bundle them all into a single catch-all "Exception". | ||
| 68 | + * Because in the end, all I really care about is whether things worked or | ||
| 69 | + * not. And even then, I don't care. | ||
| 66 | 70 | * @throws Exception Just like I said. | |
| 67 | 71 | */ | |
| 68 | 72 | public void setLookAndFeel() throws Exception { | |
@@ -74,17 +78,20 @@ public void setLookAndFeel() throws Exception { | |||
| 74 | 78 | } | |
| 75 | 79 | } | |
| 76 | 80 | ||
| 77 | - public void saveLanguage(String languageCode) {} | ||
| 78 | 81 | ||
| 79 | - public void init(Base base) { | ||
| 80 | - this.base = base; | ||
| 81 | - } | ||
| 82 | + /** | ||
| 83 | + * Handle any platform-specific languages saving. This is necessary on OS X | ||
| 84 | + * because of how bundles are handled, but perhaps your platform would like | ||
| 85 | + * to Think Different too? | ||
| 86 | + * @param languageCode 2-digit lowercase ISO language code | ||
| 87 | + */ | ||
| 88 | + public void saveLanguage(String languageCode) { } | ||
| 82 | 89 | ||
| 83 | 90 | ||
| 84 | - /** | ||
| 85 | - * This function should throw an exception or return a value. | ||
| 86 | - * Do not return null. | ||
| 87 | - */ | ||
| 91 | + /** | ||
| 92 | + * This function should throw an exception or return a value. | ||
| 93 | + * Do not return null. | ||
| 94 | + */ | ||
| 88 | 95 | public File getSettingsFolder() throws Exception { | |
| 89 | 96 | // otherwise make a .processing directory int the user's home dir | |
| 90 | 97 | File home = new File(System.getProperty("user.home")); | |
@@ -149,26 +156,26 @@ public void openFolder(File file) throws Exception { | |||
| 149 | 156 | } | |
| 150 | 157 | */ | |
| 151 | 158 | } | |
| 152 | - | ||
| 159 | + | ||
| 153 | 160 | ||
| 154 | 161 | /** | |
| 155 | - * Attempts to move to the Trash on OS X, or the Recycle Bin on Windows. | ||
| 156 | - * Also tries to find a suitable Trash location on Linux. | ||
| 157 | - * If not possible, just deletes the file or folder instead. | ||
| 162 | + * Attempts to move to the Trash on OS X, or the Recycle Bin on Windows. | ||
| 163 | + * Also tries to find a suitable Trash location on Linux. | ||
| 164 | + * If not possible, just deletes the file or folder instead. | ||
| 158 | 165 | * @param file the folder or file to be removed/deleted | |
| 159 | 166 | * @return true if the folder was successfully removed | |
| 160 | - * @throws IOException | ||
| 167 | + * @throws IOException | ||
| 161 | 168 | */ | |
| 162 | 169 | final public boolean deleteFile(File file) throws IOException { | |
| 163 | 170 | FileUtils fu = FileUtils.getInstance(); | |
| 164 | 171 | if (fu.hasTrash()) { | |
| 165 | 172 | fu.moveToTrash(new File[] { file }); | |
| 166 | 173 | return true; | |
| 167 | - | ||
| 174 | + | ||
| 168 | 175 | } else if (file.isDirectory()) { | |
| 169 | 176 | Base.removeDir(file); | |
| 170 | 177 | return true; | |
| 171 | - | ||
| 178 | + | ||
| 172 | 179 | } else { | |
| 173 | 180 | return file.delete(); | |
| 174 | 181 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -145,8 +145,8 @@ static public void init() { | |||
| 145 | 145 | // http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html | |
| 146 | 146 | String proxyHost = get("proxy.host"); | |
| 147 | 147 | String proxyPort = get("proxy.port"); | |
| 148 | - if (proxyHost != null && proxyHost.trim().length() != 0 && | ||
| 149 | - proxyPort != null && proxyPort.trim().length() != 0) { | ||
| 148 | + if (proxyHost != null && proxyHost.length() != 0 && | ||
| 149 | + proxyPort != null && proxyPort.length() != 0) { | ||
| 150 | 150 | System.setProperty("http.proxyHost", proxyHost); | |
| 151 | 151 | System.setProperty("http.proxyPort", proxyPort); | |
| 152 | 152 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments