/** * @param fileWrapperFactory * the fileWrapperFactory to set */ public void setFileWrapperFactory(FileWrapperFactory fileWrapperFactory) { Utilities.checkNull("setFileWrapperFactory", "fileWrapperFactory", fileWrapperFactory); PluginQueryTokenizerPreferencesManager.fileWrapperFactory = fileWrapperFactory; }
public void sessionCreated(ISession session) { CodeCompletionPreferences prefs = (CodeCompletionPreferences) Utilities.cloneObject(_newSessionPrefs, getClass().getClassLoader()); session.putPluginObject(this, PLUGIN_OBJECT_PREFS_KEY, prefs); }
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); } } }
private boolean hasDifferentValues() { Object firstVal = _indexedColumn.get(_firstIx); Object lastVal = _indexedColumn.get(_lastIx); return false == Utilities.equalsRespectNull(firstVal, lastVal); }
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> " + rowsMsg + "; " + 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> " + limitMsg + "; " + escapedSql + "</pre></html>"); } }
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); }
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); } } }
private boolean linkExists(GraphXmlSerializer serializer) { for (LinkXmlBean existingLink : _existingLinks) { if(Utilities.equalsRespectNull(existingLink.getFilePathOfLinkedGraph(), serializer.getGraphFile())) { return true; } } return false; }
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> " + rowsMsg + "; " + 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> " + limitMsg + "; " + escapedSql + "</pre></html>"); } }
/** * @param applicationFiles the applicationFiles to set */ public void setApplicationFiles(ApplicationFileWrappers applicationFiles) { Utilities.checkNull("setApplicationFiles", "applicationFiles", applicationFiles); this.applicationFiles = applicationFiles; }
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); }
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); } }
private boolean hasDifferentValues() { Object firstVal = _indexedColumn.get(_firstIx); Object lastVal = _indexedColumn.get(_lastIx); return false == Utilities.equalsRespectNull(firstVal, lastVal); }
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> " + 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; }
public DeleteExecuter(ProgressCallBack cb) { Utilities.checkNull("DeleteExecuter.init", "cb", cb); _cb = cb; }
SchemaLoadInfo buf = (SchemaLoadInfo) Utilities.cloneObject( schemaLoadInfos[0], getClass().getClassLoader()); buf.schemaName = allowedSchemas[i];
Throwable t = Utilities.getDeepestThrowable(e); ExceptionFormatter formatter = sess.getExceptionFormatter(); try
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> " + 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; }
/** * @param fileWrapperFactory * the fileWrapperFactory to set */ public static void setFileWrapperFactory(FileWrapperFactory fileWrapperFactory) { Utilities.checkNull("setFileWrapperFactory", "fileWrapperFactory", fileWrapperFactory); PreferencesManager.fileWrapperFactory = fileWrapperFactory; }
SchemaLoadInfo buf = (SchemaLoadInfo) Utilities.cloneObject( schemaLoadInfos[0], getClass().getClassLoader()); buf.schemaName = allowedSchemas[i];