private String convertLineFeedToPlatformEOL(String result) { String platformEolStr = StringUtilities.getEolStr(); if (result != null && !"".equals(result)) { // We eagerly take care that no redundant CRs exist // because they hide in files and cause any kind of trouble. result = result.replaceAll("\\r", ""); if (!platformEolStr.equals("\n")) { result = result.replaceAll("\\n", platformEolStr); } } return result; }
private String convertLineFeedToPlatformEOL(String result) { String platformEolStr = StringUtilities.getEolStr(); if (result != null && !"".equals(result)) { // We eagerly take care that no redundant CRs exist // because they hide in files and cause any kind of trouble. result = result.replaceAll("\\r", ""); if (!platformEolStr.equals("\n")) { result = result.replaceAll("\\n", platformEolStr); } } return result; }
private void doThreadDump() { StringBuilder sb = new StringBuilder(1000); ThreadInfo[] threadInfos = ManagementFactory.getThreadMXBean().dumpAllThreads(true, true); for (ThreadInfo threadInfo : threadInfos) { sb.append(threadInfo.toString()); sb.append(StringUtilities.getEolStr()); } content.setText(sb.toString()); } }
private void doThreadDump() { StringBuilder sb = new StringBuilder(1000); ThreadInfo[] threadInfos = ManagementFactory.getThreadMXBean().dumpAllThreads(true, true); for (ThreadInfo threadInfo : threadInfos) { sb.append(threadInfo.toString()); sb.append(StringUtilities.getEolStr()); } content.setText(sb.toString()); } }
/** * Without calling this method when loading a file on Windows * method convertLineFeedToPlatformEOL() which is called when saving a file * would create duplicate \r each time a file is opened and saved. */ private String convertPlatformEOLToLineFeed(String s) { String platformEolStr = StringUtilities.getEolStr(); if (null == s || "".equals(s)) { return s; } if (false == platformEolStr.equals("\n")) { s = s.replaceAll(platformEolStr, "\n"); } // We eagerly take care that no redundant CRs exist // because they hide in files and cause any kind of trouble. return s.replaceAll("\\r", ""); }
/** * Without calling this method when loading a file on Windows * method convertLineFeedToPlatformEOL() which is called when saving a file * would create duplicate \r each time a file is opened and saved. */ private String convertPlatformEOLToLineFeed(String s) { String platformEolStr = StringUtilities.getEolStr(); if (null == s || "".equals(s)) { return s; } if (false == platformEolStr.equals("\n")) { s = s.replaceAll(platformEolStr, "\n"); } // We eagerly take care that no redundant CRs exist // because they hide in files and cause any kind of trouble. return s.replaceAll("\\r", ""); }
/** * @param string */ private void appendToHistory(String string) { if (this.historyArea != null) { final StringBuilder sb = new StringBuilder(); sb.append(dateFormat.format(new Date())); sb.append(": "); sb.append(string); sb.append(StringUtilities.getEolStr()); Runnable runnable = new Runnable() { public void run() { historyArea.append(sb.toString()); historyArea.setCaretPosition(historyArea.getDocument().getLength()); } }; GUIUtils.processOnSwingEventThread(runnable); } }
/** * @param string */ private void appendToHistory(String string) { if (this.historyArea != null) { final StringBuilder sb = new StringBuilder(); sb.append(dateFormat.format(new Date())); sb.append(": "); sb.append(string); sb.append(StringUtilities.getEolStr()); Runnable runnable = new Runnable() { public void run() { historyArea.append(sb.toString()); historyArea.setCaretPosition(historyArea.getDocument().getLength()); } }; GUIUtils.processOnSwingEventThread(runnable); } }
new CommentSpec("--", StringUtilities.getEolStr()) };
new CommentSpec("--", StringUtilities.getEolStr()) };