/** * Set the SQL. * * @param sql The SQL statement. * * @throws IllegalArgumentException * Thrown if a <TT>null</TT> SQL statement passed. */ public void setSQL(String sql) { if (sql == null) { throw new IllegalArgumentException("sql == null"); } _sql = sql.trim(); _shortSql = StringUtilities.cleanString(sql); }
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; }
public static String createGraphFileNamePrefixForUrl(String url) { return StringUtilities.javaNormalize(url) + "."; } }
String[] parts = StringUtilities.split(next, ' ', true); if (parts.length == 2) { procSep = parts[1];
String chopped = StringUtilities.chop(next); tmp.add(chopped); tmp.add(procSep);
StringUtilities.getTokenBeginIndex(sql, "from"); sTable = getNextToken(sql, iFromIndex + "from".length());
/** * @see net.sourceforge.squirrel_sql.client.session.DefaultSQLExecuterHandler#sqlToBeExecuted(java.lang.String) */ @Override public void sqlToBeExecuted(final String sql) { if (s_log.isDebugEnabled()) { s_log.debug("Statement to be executed: " + sql); } if (sql.startsWith("ALTER")) { cb.setLoadingPrefix(i18n.DROPPING_CONSTRAINT_PREFIX); // Hack!!! hopefully the FK name will always be the last token! final String[] parts = StringUtilities.split(sql, ' '); cb.currentlyLoading(parts[parts.length - 1]); } else { cb.setLoadingPrefix(i18n.DROPPING_TABLE_PREFIX); if (tableCount < DropTablesCommand.this.orderedTables.size()) { final ITableInfo ti = DropTablesCommand.this.orderedTables.get(tableCount); cb.currentlyLoading(ti.getSimpleName()); } tableCount++; } } }
/** * Set the SQL. * * @param sql The SQL statement. * * @throws IllegalArgumentException * Thrown if a <TT>null</TT> SQL statement passed. */ public void setSQL(String sql) { if (sql == null) { throw new IllegalArgumentException("sql == null"); } _sql = sql.trim(); _shortSql = StringUtilities.cleanString(sql); }
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; }
public static String createGraphFileName(String url, String title) { return createGraphFileNamePrefixForUrl(url) + StringUtilities.javaNormalize(title); }
/** * @see net.sourceforge.squirrel_sql.client.session.mainpanel.IResultTab#getViewableSqlString() */ public String getViewableSqlString() { return StringUtilities.cleanString(getSqlString()); }
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()); } }
public static String getLinkPrefix(ISession session) { return LINK_PREFIX + StringUtilities.javaNormalize(session.getAlias().getUrl()) + "."; }
/** * @see net.sourceforge.squirrel_sql.client.session.mainpanel.IResultTab#getViewableSqlString() */ public String getViewableSqlString() { return StringUtilities.cleanString(getSqlString()); }
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()); } }
public static GraphXmlSerializer[] getGraphXmSerializers(GraphPlugin plugin, ISession session) { try { final String urlPrefix = StringUtilities.javaNormalize(session.getAlias().getUrl()) + "."; FileWrapper[] graphXmlFiles = plugin.getPluginUserSettingsFolder().listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { if (name.startsWith(urlPrefix)) { return true; } return false; } }); return createSerializers(plugin, session, graphXmlFiles); } catch (Exception e) { throw new RuntimeException(e); } }
void load(int rowCount, SQLExecutionInfo exInfo) { _queryLbl.setText(StringUtilities.cleanString(exInfo.getSQL())); displayRowCount(rowCount); _executedLbl.setText(exInfo.getSQLExecutionStartTime().toString()); _elapsedLbl.setText(formatElapsedTime(exInfo)); }
/** * 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", ""); }
void load(int rowCount, SQLExecutionInfo exInfo) { _queryLbl.setText(StringUtilities.cleanString(exInfo.getSQL())); displayRowCount(rowCount); _executedLbl.setText(exInfo.getSQLExecutionStartTime().toString()); _elapsedLbl.setText(formatElapsedTime(exInfo)); }
/** * 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", ""); }