net.sourceforge.squirrel_sql.fw.util.Utilities类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中net.sourceforge.squirrel_sql.fw.util.Utilities类的一些代码示例,展示了Utilities类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities类的具体详情如下:
包路径:net.sourceforge.squirrel_sql.fw.util.Utilities
类名称:Utilities

Utilities介绍

暂无

代码示例

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

/**
 * @param fileWrapperFactory
 *           the fileWrapperFactory to set
 */
public void setFileWrapperFactory(FileWrapperFactory fileWrapperFactory)
{
  Utilities.checkNull("setFileWrapperFactory", "fileWrapperFactory", fileWrapperFactory);
  PluginQueryTokenizerPreferencesManager.fileWrapperFactory = fileWrapperFactory;
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/codecompletion

public void sessionCreated(ISession session)
{
  CodeCompletionPreferences prefs = (CodeCompletionPreferences) Utilities.cloneObject(_newSessionPrefs, getClass().getClassLoader());
  session.putPluginObject(this, PLUGIN_OBJECT_PREFS_KEY, prefs);
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

private static void doOutOfMemory(AWTEvent event, Throwable e, OutOfMemoryErrorHandler oumErrorHandler)
{
 if (Utilities.getDeepestThrowable(e) instanceof OutOfMemoryError)
 {
   try
   {
    // We have to set the application by a lazy way, because it is created in a runnable. 
    oumErrorHandler.setApplication(application);
    oumErrorHandler.handleOutOfMemoryError();
   }
   catch (Throwable t)
   {
    doLogging(event, t);
   }
 }
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

private boolean hasDifferentValues()
{
 Object firstVal = _indexedColumn.get(_firstIx);
 Object lastVal = _indexedColumn.get(_lastIx);
 return false == Utilities.equalsRespectNull(firstVal, lastVal);
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

public void reInit(int rowCount, boolean areAllPossibleResultsOfSQLRead)
{
 String escapedSql = Utilities.escapeHtmlChars(_sql);
 if (areAllPossibleResultsOfSQLRead)
 {
   // i18n[ResultTab.rowsMessage=Rows {0}]
   String rowsMsg = s_stringMgr.getString("ResultTab.rowsMessage", Integer.valueOf(rowCount));
   _lbl.setText("<html><pre>&nbsp;" + rowsMsg + ";&nbsp;&nbsp;" + escapedSql + "</pre></html>");
 }
 else
 {
   // i18n[ResultTab.limitMessage=Limited to <font color='red'> {0} </font> rows]
   String limitMsg = s_stringMgr.getString("ResultTab.limitMessage", Integer.valueOf(rowCount));
   _lbl.setText("<html><pre>&nbsp;" + limitMsg + ";&nbsp;&nbsp;" + escapedSql + "</pre></html>");
 }
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

SchemaLoadInfo[] getMatchingSchemaLoadInfos(String schemaName, String[] tableTypes)
{
 if(null == schemaName)
 {
   return getAllSchemaLoadInfos();
 }
 SchemaLoadInfo[] schemaLoadInfos = getAllSchemaLoadInfos();
 for (int i = 0; i < schemaLoadInfos.length; i++)
 {
   if(null == schemaLoadInfos[i].schemaName || schemaLoadInfos[i].schemaName.equals(schemaName))
   {
    
    // null == schemaLoadInfos[0].schemaName is the case when there are no _schemas specified
    // schemaLoadInfos.length will then be 1.
    schemaLoadInfos[i].schemaName = schemaName;
    if(null != tableTypes)
    {
      SchemaLoadInfo buf = (SchemaLoadInfo) Utilities.cloneObject(
         schemaLoadInfos[i], getClass().getClassLoader());
      buf.tableTypes = tableTypes;
      return new SchemaLoadInfo[]{buf};
    }
    return new SchemaLoadInfo[]{schemaLoadInfos[i]};
   }
 }
 throw new IllegalArgumentException("Unknown Schema " + schemaName);
}

代码示例来源:origin: realXuJiang/bigtable-sql

private static void doOutOfMemory(AWTEvent event, Throwable e, OutOfMemoryErrorHandler oumErrorHandler)
{
 if (Utilities.getDeepestThrowable(e) instanceof OutOfMemoryError)
 {
   try
   {
    // We have to set the application by a lazy way, because it is created in a runnable. 
    oumErrorHandler.setApplication(application);
    oumErrorHandler.handleOutOfMemoryError();
   }
   catch (Throwable t)
   {
    doLogging(event, t);
   }
 }
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/graph

private boolean linkExists(GraphXmlSerializer serializer)
{
 for (LinkXmlBean existingLink : _existingLinks)
 {
   if(Utilities.equalsRespectNull(existingLink.getFilePathOfLinkedGraph(), serializer.getGraphFile()))
   {
    return true;
   }
 }
 return false;
}

代码示例来源:origin: realXuJiang/bigtable-sql

public void reInit(int rowCount, boolean areAllPossibleResultsOfSQLRead)
{
 String escapedSql = Utilities.escapeHtmlChars(_sql);
 if (areAllPossibleResultsOfSQLRead)
 {
   // i18n[ResultTab.rowsMessage=Rows {0}]
   String rowsMsg = s_stringMgr.getString("ResultTab.rowsMessage", Integer.valueOf(rowCount));
   _lbl.setText("<html><pre>&nbsp;" + rowsMsg + ";&nbsp;&nbsp;" + escapedSql + "</pre></html>");
 }
 else
 {
   // i18n[ResultTab.limitMessage=Limited to <font color='red'> {0} </font> rows]
   String limitMsg = s_stringMgr.getString("ResultTab.limitMessage", Integer.valueOf(rowCount));
   _lbl.setText("<html><pre>&nbsp;" + limitMsg + ";&nbsp;&nbsp;" + escapedSql + "</pre></html>");
 }
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

/**
 * @param applicationFiles the applicationFiles to set
 */
public void setApplicationFiles(ApplicationFileWrappers applicationFiles)
{
  Utilities.checkNull("setApplicationFiles", "applicationFiles", applicationFiles);
  this.applicationFiles = applicationFiles;
}

代码示例来源:origin: realXuJiang/bigtable-sql

SchemaLoadInfo[] getMatchingSchemaLoadInfos(String schemaName, String[] tableTypes)
{
 if(null == schemaName)
 {
   return getAllSchemaLoadInfos();
 }
 SchemaLoadInfo[] schemaLoadInfos = getAllSchemaLoadInfos();
 for (int i = 0; i < schemaLoadInfos.length; i++)
 {
   if(null == schemaLoadInfos[i].schemaName || schemaLoadInfos[i].schemaName.equals(schemaName))
   {
    
    // null == schemaLoadInfos[0].schemaName is the case when there are no _schemas specified
    // schemaLoadInfos.length will then be 1.
    schemaLoadInfos[i].schemaName = schemaName;
    if(null != tableTypes)
    {
      SchemaLoadInfo buf = (SchemaLoadInfo) Utilities.cloneObject(
         schemaLoadInfos[i], getClass().getClassLoader());
      buf.tableTypes = tableTypes;
      return new SchemaLoadInfo[]{buf};
    }
    return new SchemaLoadInfo[]{schemaLoadInfos[i]};
   }
 }
 throw new IllegalArgumentException("Unknown Schema " + schemaName);
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/hibernate

private void onConnectFailed(Throwable t)
{
 _panel.btnConnected.setIcon(_resource.getIcon(HibernatePluginResources.IKeys.DISCONNECTED_IMAGE));
 _panel.btnConnected.setEnabled(true);
 _panel.btnConnected.setSelected(false);
 _session.showErrorMessage(t);
 s_log.error(t);
 _con = null;
 _hqlPanelController.setConnection(null);
 if(Utilities.getDeepestThrowable(t) instanceof StackOverflowError)
 {
   String warnMessage = s_stringMgr.getString("hibernate.stackOverFlowMessage");
   _session.showWarningMessage(warnMessage);
   s_log.warn(warnMessage);
 }
}

代码示例来源:origin: realXuJiang/bigtable-sql

private boolean hasDifferentValues()
{
 Object firstVal = _indexedColumn.get(_firstIx);
 Object lastVal = _indexedColumn.get(_lastIx);
 return false == Utilities.equalsRespectNull(firstVal, lastVal);
}

代码示例来源:origin: realXuJiang/bigtable-sql

private JPanel createNorthPanel(ISession session, ArrayList<String> sqlExecErrorMsgs, String lastExecutedStatement)
{
 JPanel ret = new JPanel(new GridBagLayout());
 String msg = s_stringMgr.getString("ErrorPanel.NoErrorStatement") ;
 if(1 < sqlExecErrorMsgs.size() && false == session.getProperties().getAbortOnError())
 {
   msg = s_stringMgr.getString("ErrorPanel.MultibleStatements") ;
 }
 else if(null != lastExecutedStatement && 0 < lastExecutedStatement.trim().length())
 {
   msg = s_stringMgr.getString("ErrorPanel.occuredIn", StringUtilities.cleanString(lastExecutedStatement.trim())) ;
 }
 String escapedMsg = Utilities.escapeHtmlChars(msg);
 String htmlMsg = "<html><pre>&nbsp;" + escapedMsg + "</pre></html>";
 GridBagConstraints gbc;
 gbc = new GridBagConstraints(0,0,1,1,1,1, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,5),0,0 );
 ret.add(new JLabel(htmlMsg), gbc);
 gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0,0,0,0),0,0 );
 _btnClose = new TabButton(new CloseAction(session));
 ret.add(_btnClose, gbc);
 return ret;
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

public DeleteExecuter(ProgressCallBack cb)
{
  Utilities.checkNull("DeleteExecuter.init", "cb", cb);
  _cb = cb;
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

SchemaLoadInfo buf = (SchemaLoadInfo) Utilities.cloneObject(
   schemaLoadInfos[0], getClass().getClassLoader());
buf.schemaName = allowedSchemas[i];

代码示例来源:origin: net.sf.squirrel-sql.plugins/hibernate

Throwable t = Utilities.getDeepestThrowable(e);
ExceptionFormatter formatter = sess.getExceptionFormatter();
try

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

private JPanel createNorthPanel(ISession session, ArrayList<String> sqlExecErrorMsgs, String lastExecutedStatement)
{
 JPanel ret = new JPanel(new GridBagLayout());
 String msg = s_stringMgr.getString("ErrorPanel.NoErrorStatement") ;
 if(1 < sqlExecErrorMsgs.size() && false == session.getProperties().getAbortOnError())
 {
   msg = s_stringMgr.getString("ErrorPanel.MultibleStatements") ;
 }
 else if(null != lastExecutedStatement && 0 < lastExecutedStatement.trim().length())
 {
   msg = s_stringMgr.getString("ErrorPanel.occuredIn", StringUtilities.cleanString(lastExecutedStatement.trim())) ;
 }
 String escapedMsg = Utilities.escapeHtmlChars(msg);
 String htmlMsg = "<html><pre>&nbsp;" + escapedMsg + "</pre></html>";
 GridBagConstraints gbc;
 gbc = new GridBagConstraints(0,0,1,1,1,1, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,5),0,0 );
 ret.add(new JLabel(htmlMsg), gbc);
 gbc = new GridBagConstraints(1,0,1,1,0,0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0,0,0,0),0,0 );
 _btnClose = new TabButton(new CloseAction(session));
 ret.add(_btnClose, gbc);
 return ret;
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/mssql

/**
 * @param fileWrapperFactory
 *           the fileWrapperFactory to set
 */
public static void setFileWrapperFactory(FileWrapperFactory fileWrapperFactory)
{
  Utilities.checkNull("setFileWrapperFactory", "fileWrapperFactory", fileWrapperFactory);
  PreferencesManager.fileWrapperFactory = fileWrapperFactory;
}

代码示例来源:origin: realXuJiang/bigtable-sql

SchemaLoadInfo buf = (SchemaLoadInfo) Utilities.cloneObject(
   schemaLoadInfos[0], getClass().getClassLoader());
buf.schemaName = allowedSchemas[i];

相关文章