| javax.swing.JPanel workbench.gui.sql.SqlPanel
SqlPanel | public class SqlPanel extends JPanel implements FontChangedListener,TextChangeListener,PropertyChangeListener,ChangeListener,MainPanel,Exporter,DbUpdater,Interruptable,FormattableSql,Commitable,JobErrorHandler,ExecutionController,ResultLogger,ParameterPrompter,DbExecutionNotifier,FilenameChangeListener,ResultReceiver(Code) | | A panel with an SQL editor (EditorPanel), a log panel and
a panel for displaying SQL results (DwPanel)
author: support@sql-workbench.net |
Constructor Summary | |
public | SqlPanel(int anId) |
Method Summary | |
protected void | _selectEditor() | public boolean | abortExecution() | public void | addDbExecutionListener(DbExecutionListener l) | public void | addFilenameChangeListener(FilenameChangeListener aListener) | public int | addResult(StatementRunnerResult result) Display the data contained in the StatementRunnerResult. | public void | addResultTabChangeListener(ChangeListener l) | public void | addToToolbar(WbAction anAction, boolean withSeperator) | public void | appendStatementText(String text) | public void | appendToLog(String logMessage) | public boolean | canCloseTab() | public void | cancelExecution() Implementation of the Interruptable Interface. | protected void | cancelRetrieve() | public void | cancelUpdate() | public boolean | checkAndSaveFile() | protected void | checkCommitAction() | protected void | checkResultSetActions() | public void | clearLog() Clear the message log, but do not switch the panel display to it. | public void | clearSqlHistory(boolean removeEditorText) | public void | clearStatusMessage() | public void | closeCurrentResult() | public boolean | closeFile(boolean emptyEditor) | public boolean | closeFile(boolean emptyEditor, boolean checkUnsaved) | public void | commit() | public boolean | confirmCancel() | public boolean | confirmExecution(String command) | public void | disconnect() | public void | dispose() | public void | executeMacro(String macroName, boolean replaceText) | public void | exportData() | public void | fatalError(String msg) | public void | fileNameChanged(Object sender, String newFilename) | protected void | fireDbExecEnd() | protected void | fireDbExecStart() | public void | fontChanged(String aFontId, Font newFont) | public void | forceAbort() | public int | getActionOnError(int errorRow, String errorColumn, String dataLine, String errorMessage) | public List | getActions() | public boolean | getAppendResults() | public WbConnection | getConnection() | public String | getCurrentFileName() | public EditorPanel | getEditor() | public String | getId() | public int | getImportErrorAction(int errorRow, String errorColumn, String dataLine, String errorMessage) | public String | getLogMessage() | public Window | getParentWindow() | public String | getTabName() | public String | getTabTitle() | public String | getTitle() | public WbToolbar | getToolbar() | public int | getUpdateErrorAction(int errorRow, String errorColumn, String dataLine, String errorMessage) We are implementing our own getUpdateErrorAction() (and not using the one from
DwPanel) because it's necessary to turn off the loading indicator before displaying a message box. | public boolean | hasFileLoaded() | protected void | highlightError(ScriptParser scriptParser, int commandWithError, int startOffset) | public void | importFile() | public void | importString(String content, boolean showOptions) | public void | initDivider() | public void | initDivider(int height) | public void | initStatementHistory() | public boolean | isBusy() | public boolean | isConnected() | public boolean | isRequestFocusEnabled() | public void | makeReadOnly() | public void | panelSelected() | public boolean | processParameterPrompts(String sql) | public void | propertyChange(PropertyChangeEvent evt) | public boolean | readFile(String aFilename, String encoding) | public void | readFromWorkspace(WbWorkspace w, int index) | public void | reformatSql() | public void | removeDbExecutionListener(DbExecutionListener l) | public void | removeFilenameChangeListener(FilenameChangeListener aListener) | public void | reset() | public void | rollback() | public void | runAll() | public void | runCurrentStatement() | public synchronized void | runImporter(DataStoreImporter importer) | public void | runSelectedStatement() | public void | runStatement(String sql, int selectionOffset, int commandAtIndex, boolean highlightOnError, boolean appendResult) Execute the given SQL string. | public void | saveChangesToDatabase() | public void | saveHistory(WbWorkspace w) | public void | saveToWorkspace(WbWorkspace w, int index) | public void | selectEditor() | public void | selectEditorLater() | public void | selectResult() | public void | setActionState(Action anAction, boolean aFlag) Modify the enabled state of the given action. | public void | setActionState(Action[] anActionList, boolean aFlag) | public void | setAppendResults(boolean flag) | protected void | setBusy(boolean busy) | public void | setCancelState(boolean aFlag) | public void | setConnection(WbConnection aConnection) | public void | setConnectionClient(Connectable client) | public void | setId(int anId) | protected void | setLogText(String msg) | public void | setStatementText(String aStatement) | public void | setTabName(String aName) | public void | setTabTitle(JTabbedPane tab, int index) | public void | setVisible(boolean flag) | public void | showLogMessage(String aMsg) Show a message in the log panel. | public void | showLogPanel() Show the panel with the log messages. | public void | showResult(String sql, String comment, ResultReceiver.ShowType how) Implementation of the ResultReceiver interface. | public void | showResultPanel() | public void | showResultPanel(int index) | public void | showStatusMessage(String aMsg) Display a message in the status bar of the DwPanel. | public void | stateChanged(ChangeEvent evt) | public void | storeStatementInHistory() | public void | textStatusChanged(boolean modified) | public void | updateDb() |
cancelExecution | protected boolean cancelExecution(Code) | | |
importRunning | protected boolean importRunning(Code) | | |
textModified | protected boolean textModified(Code) | | |
threadBusy | protected boolean threadBusy(Code) | | |
updateRunning | protected boolean updateRunning(Code) | | |
SqlPanel | public SqlPanel(int anId)(Code) | | |
_selectEditor | protected void _selectEditor()(Code) | | |
abortExecution | public boolean abortExecution()(Code) | | |
addToToolbar | public void addToToolbar(WbAction anAction, boolean withSeperator)(Code) | | |
appendStatementText | public void appendStatementText(String text)(Code) | | |
canCloseTab | public boolean canCloseTab()(Code) | | Do any work which should be done during the process of saving the
current workspace, but before the workspace file is actually opened!
This is to prevent a corrupted workspace due to interrupting the saving
because of the check for unsaved changes in the current editor file
|
cancelExecution | public void cancelExecution()(Code) | | Implementation of the Interruptable Interface.
|
cancelRetrieve | protected void cancelRetrieve()(Code) | | |
cancelUpdate | public void cancelUpdate()(Code) | | |
checkAndSaveFile | public boolean checkAndSaveFile()(Code) | | |
checkCommitAction | protected void checkCommitAction()(Code) | | Check the autoCommit property of the current connection
and enable/disable the rollback and commit actions
accordingly
|
checkResultSetActions | protected void checkResultSetActions()(Code) | | |
clearLog | public void clearLog()(Code) | | Clear the message log, but do not switch the panel display to it.
|
clearSqlHistory | public void clearSqlHistory(boolean removeEditorText)(Code) | | |
clearStatusMessage | public void clearStatusMessage()(Code) | | Clear the message in the status bar of the DwPanel
|
closeCurrentResult | public void closeCurrentResult()(Code) | | |
closeFile | public boolean closeFile(boolean emptyEditor)(Code) | | |
closeFile | public boolean closeFile(boolean emptyEditor, boolean checkUnsaved)(Code) | | |
commit | public void commit()(Code) | | |
confirmCancel | public boolean confirmCancel()(Code) | | |
confirmExecution | public boolean confirmExecution(String command)(Code) | | |
disconnect | public void disconnect()(Code) | | |
dispose | public void dispose()(Code) | | |
executeMacro | public void executeMacro(String macroName, boolean replaceText)(Code) | | |
exportData | public void exportData()(Code) | | |
fireDbExecEnd | protected void fireDbExecEnd()(Code) | | |
fireDbExecStart | protected void fireDbExecStart()(Code) | | |
forceAbort | public void forceAbort()(Code) | | |
getActionOnError | public int getActionOnError(int errorRow, String errorColumn, String dataLine, String errorMessage)(Code) | | |
getAppendResults | public boolean getAppendResults()(Code) | | |
getImportErrorAction | public int getImportErrorAction(int errorRow, String errorColumn, String dataLine, String errorMessage)(Code) | | |
getTitle | public String getTitle()(Code) | | Implementation of the ResultReceiver interface
|
getUpdateErrorAction | public int getUpdateErrorAction(int errorRow, String errorColumn, String dataLine, String errorMessage)(Code) | | We are implementing our own getUpdateErrorAction() (and not using the one from
DwPanel) because it's necessary to turn off the loading indicator before displaying a message box.
DwPanel's getUpdateErrorAction is called from here after turning off the loading indicator.
|
hasFileLoaded | public boolean hasFileLoaded()(Code) | | |
highlightError | protected void highlightError(ScriptParser scriptParser, int commandWithError, int startOffset)(Code) | | |
importFile | public void importFile()(Code) | | |
importString | public void importString(String content, boolean showOptions)(Code) | | |
initDivider | public void initDivider()(Code) | | |
initDivider | public void initDivider(int height)(Code) | | |
initStatementHistory | public void initStatementHistory()(Code) | | |
isBusy | public boolean isBusy()(Code) | | |
isConnected | public boolean isConnected()(Code) | | |
isRequestFocusEnabled | public boolean isRequestFocusEnabled()(Code) | | |
makeReadOnly | public void makeReadOnly()(Code) | | |
panelSelected | public void panelSelected()(Code) | | |
processParameterPrompts | public boolean processParameterPrompts(String sql)(Code) | | |
reformatSql | public void reformatSql()(Code) | | |
reset | public void reset()(Code) | | |
rollback | public void rollback()(Code) | | |
runAll | public void runAll()(Code) | | |
runCurrentStatement | public void runCurrentStatement()(Code) | | |
runSelectedStatement | public void runSelectedStatement()(Code) | | |
runStatement | public void runStatement(String sql, int selectionOffset, int commandAtIndex, boolean highlightOnError, boolean appendResult)(Code) | | Execute the given SQL string. This is invoked from the the run() and other
methods in order to execute the SQL command. It takes care of updating the
actions and the menu.
The actual execution and display of the result is handled by displayResult()
This is only public to allow a direct call during
GUI testing (to avoid multi-threading)
|
saveChangesToDatabase | public void saveChangesToDatabase()(Code) | | |
selectEditor | public void selectEditor()(Code) | | |
selectEditorLater | public void selectEditorLater()(Code) | | |
selectResult | public void selectResult()(Code) | | |
setActionState | public void setActionState(Action anAction, boolean aFlag)(Code) | | Modify the enabled state of the given action.
|
setActionState | public void setActionState(Action[] anActionList, boolean aFlag)(Code) | | |
setAppendResults | public void setAppendResults(boolean flag)(Code) | | |
setBusy | protected void setBusy(boolean busy)(Code) | | |
setCancelState | public void setCancelState(boolean aFlag)(Code) | | |
setId | public void setId(int anId)(Code) | | |
setStatementText | public void setStatementText(String aStatement)(Code) | | |
setVisible | public void setVisible(boolean flag)(Code) | | |
showLogMessage | public void showLogMessage(String aMsg)(Code) | | Show a message in the log panel. This will also switch
the display to the log panel (away from the result panel)
|
showLogPanel | public void showLogPanel()(Code) | | Show the panel with the log messages.
|
showResult | public void showResult(String sql, String comment, ResultReceiver.ShowType how)(Code) | | Implementation of the ResultReceiver interface.
The given sql will be executed and the result will always
be displayed in a new result tab
|
showResultPanel | public void showResultPanel()(Code) | | |
showResultPanel | public void showResultPanel(int index)(Code) | | Show the panel with the result set
|
showStatusMessage | public void showStatusMessage(String aMsg)(Code) | | Display a message in the status bar of the DwPanel.
|
storeStatementInHistory | public void storeStatementInHistory()(Code) | | |
textStatusChanged | public void textStatusChanged(boolean modified)(Code) | | |
updateDb | public void updateDb()(Code) | | |
|
|