![]() |
|
|
#include <inspectorj.h>
Inheritance diagram for inspectorj::client::InspectorJ:
Definition at line 59 of file inspectorj.h.
Public Member Functions | |
InspectorJ (QWidget *parent=0, Qt::WindowFlags flags=0) | |
InspectorJ constructor. | |
Protected Member Functions | |
void | closeEvent (QCloseEvent *event) |
Override closeEvent so we can save settings and clean up resources. | |
Private Slots | |
QString | browseProfileDirectory () |
Return the absolute path to the directory where SessionProfile's are saved to disk. | |
void | setProfileDirectory () |
Set the profile directory. | |
void | getJvmInfo () |
Request version information from the remote jvm. | |
void | showJvmInfo (JDWPPacket &) |
Display jvm and version information. | |
void | showFontDlg () |
Show the Font Dialog. | |
void | showSessionDlg () |
Show the Manage SessionProfile dialog. | |
void | connected (bool, QString &) |
This slot is called when the connection state is changed. | |
void | updateClassTable () |
Update the classTableView. | |
void | updateClassTree () |
Update the class Tree. | |
void | setCurrentProfile () |
Sets a pointer to the SessionProfile that is currently loaded. | |
void | addClassFilter () |
Add a class filter to the current session profile. | |
void | removeClassFilter () |
Remove a class filter to the current session profile. | |
void | disassembleBytecodes () |
Get the bytecodes for the selected class. | |
void | updateBytecodeBtn () |
Enable or disable the bytecode button based on whether inspectorJ is attached to a jvm and has valid input. | |
void | updateBytecodeTextEdit () |
Update the bytecode text edit with results. | |
void | javaAppErr (QProcess::ProcessError) |
Slot called when an error is emitted from javaAppProcess. | |
void | javaAppFinished (int, QProcess::ExitStatus) |
Slot called when the javaAppProcess emits finshed signal. | |
void | javaAppStdErr () |
Slot called when the javaAppProcess has standard err data available. | |
void | javaAppStdOut () |
Slot called when the javaAppProcess has standard out data available. | |
void | javaAppStarted () |
Slot called when the javaAppProcess emits started signal. | |
Private Member Functions | |
void | setupConnections () |
Setup the Signal/Slot connections. | |
void | loadProfiles () |
QString & | cleanConsoleText (QString &) |
void | initWindow () |
Perform some post setupUI() initialization. | |
void | loadSettings () |
Loads any stored settings, such as geometry and user defined connections, from the previous session. | |
void | saveSettings () |
Saves inspectorJ settings to disk. | |
void | createActions () |
Create QActions for inspectorJ. | |
void | createMenus () |
Create initial menu state. | |
void | updateSessionsMenu () |
Update the connections menu to reflect the addition or removal of user defined connections. | |
void | updateClassToolBox (bool) |
Update the display of the class tool box. | |
Private Attributes | |
QMenu * | attachProfileMenuItem |
QMenu * | launchProfileMenuItem |
QMenu * | editProfileMenuItem |
QProcess | javaAppProcess |
QAction * | disconnectAction |
QAction * | stopJavaAction |
JDWPAction * | jvmInfoResponse |
ConnectionManager * | connectionManager |
The connection manager. | |
QMap< QString, SessionProfile > | profiles |
SessionProfile * | profile |
ClassToolSet * | classToolSet |
QToolButton * | connectedStateBtn |
ToolButton that reflects the current connected state. | |
QString | profileDir |
QHBoxLayout * | bytecodeTableLayout |
QWidget * | bytecodeDockContents |
BytecodeHighlighter * | bytecodeHighlighter |
const int | REFERENCE_TAB |
const int | BYTECODE_TAB |
InspectorJ::InspectorJ | ( | QWidget * | parent = 0 , |
|
Qt::WindowFlags | flags = 0 | |||
) |
InspectorJ constructor.
parent | The QWidget parent | |
flags | Window flags |
Definition at line 40 of file inspectorj.cpp.
References classToolSet, connectionManager, createActions(), createMenus(), initWindow(), javaAppProcess, loadSettings(), profile, profiles, setupConnections(), and Ui_MainWindow::setupUi().
void InspectorJ::closeEvent | ( | QCloseEvent * | event | ) | [protected] |
Override closeEvent so we can save settings and clean up resources.
event | A QCloseEvent |
Definition at line 439 of file inspectorj.cpp.
References inspectorj::client::ConnectionManager::closeConnection(), connectionManager, javaAppProcess, saveSettings(), and inspectorj::client::ConnectionManager::setExiting().
QString InspectorJ::browseProfileDirectory | ( | ) | [private, slot] |
Return the absolute path to the directory where SessionProfile's are saved to disk.
This directory will contain xml files that maintain the state of SessionProfiles.
Definition at line 423 of file inspectorj.cpp.
References profileDir.
Referenced by setProfileDirectory(), and showSessionDlg().
void InspectorJ::setProfileDirectory | ( | ) | [private, slot] |
Set the profile directory.
Definition at line 406 of file inspectorj.cpp.
References browseProfileDirectory(), loadProfiles(), profileDir, profiles, and updateSessionsMenu().
Referenced by setupConnections().
void InspectorJ::getJvmInfo | ( | ) | [private, slot] |
Request version information from the remote jvm.
Definition at line 264 of file inspectorj.cpp.
References connectionManager, inspectorj::client::ConnectionManager::isAttached(), jvmInfoResponse, and inspectorj::client::ConnectionManager::sendRequest().
Referenced by setupConnections().
void InspectorJ::showJvmInfo | ( | JDWPPacket & | reply | ) | [private, slot] |
Display jvm and version information.
reply | The JDWPPacket with the jvm info |
Definition at line 248 of file inspectorj.cpp.
References inspectorj::client::ClientPacketHandler::handleJDWPError().
Referenced by setupConnections().
void InspectorJ::showFontDlg | ( | ) | [private, slot] |
Show the Font Dialog.
Definition at line 226 of file inspectorj.cpp.
References Ui_MainWindow::classTreeView.
Referenced by setupConnections().
void InspectorJ::showSessionDlg | ( | ) | [private, slot] |
Show the Manage SessionProfile dialog.
Definition at line 203 of file inspectorj.cpp.
References browseProfileDirectory(), connectionManager, inspectorj::client::ConnectionManager::isAttached(), profileDir, profiles, updateClassToolBox(), and updateSessionsMenu().
Referenced by setupConnections(), and updateSessionsMenu().
void InspectorJ::connected | ( | bool | attached, | |
QString & | msg | |||
) | [private, slot] |
This slot is called when the connection state is changed.
Connection related menu items are updated to reflect the new connection state.
attached | True if we're attached, false otherwise | |
msg | A message from the connectionManager |
Definition at line 126 of file inspectorj.cpp.
References Ui_MainWindow::allClassesBtn, connectedStateBtn, disconnectAction, editProfileMenuItem, inspectorj::client::SessionProfile::getName(), profile, Ui_MainWindow::statusbar, updateBytecodeBtn(), and updateClassToolBox().
Referenced by setupConnections().
void InspectorJ::updateClassTable | ( | ) | [private, slot] |
Update the classTableView.
This slot is called when the classToolSet's tableModelReady() signal is emitted.
Definition at line 587 of file inspectorj.cpp.
References Ui_MainWindow::classTableView, classToolSet, Ui_MainWindow::filteredClassesLoadedVal, inspectorj::toolset::ClassToolSet::getClassTableModel(), inspectorj::model::ClassTableModel::getFilteredClassesLoaded(), inspectorj::model::ClassTableModel::getTotalClassesLoaded(), and Ui_MainWindow::totalClassesLoadedVal.
Referenced by setupConnections().
void InspectorJ::updateClassTree | ( | ) | [private, slot] |
Update the class Tree.
This slot is called when the classToolSet's treeModelReady() signal is emitted.
Definition at line 568 of file inspectorj.cpp.
References classToolSet, Ui_MainWindow::classTreeView, inspectorj::model::ClassTreeModel::columnCount(), inspectorj::toolset::ClassToolSet::getClassTreeModel(), and inspectorj::model::ClassTreeModel::initModel().
Referenced by setupConnections().
void InspectorJ::setCurrentProfile | ( | ) | [private, slot] |
Sets a pointer to the SessionProfile that is currently loaded.
Definition at line 551 of file inspectorj.cpp.
References profile, and profiles.
Referenced by updateSessionsMenu().
void InspectorJ::addClassFilter | ( | ) | [private, slot] |
Add a class filter to the current session profile.
Definition at line 173 of file inspectorj.cpp.
References inspectorj::client::SessionProfile::addFilter(), connectionManager, Ui_MainWindow::ctbClassFilterList, Ui_MainWindow::ctbFilterEdit, inspectorj::client::ConnectionManager::isAttached(), and profile.
Referenced by setupConnections().
void InspectorJ::removeClassFilter | ( | ) | [private, slot] |
Remove a class filter to the current session profile.
Definition at line 187 of file inspectorj.cpp.
References connectionManager, Ui_MainWindow::ctbClassFilterList, inspectorj::client::ConnectionManager::isAttached(), profile, and inspectorj::client::SessionProfile::removeFilter().
Referenced by setupConnections().
void InspectorJ::disassembleBytecodes | ( | ) | [private, slot] |
Get the bytecodes for the selected class.
Definition at line 275 of file inspectorj.cpp.
References Ui_MainWindow::bytecode_cb_disassemble, Ui_MainWindow::bytecode_cb_internal, Ui_MainWindow::bytecode_cb_lineNumber, Ui_MainWindow::bytecode_cb_private, Ui_MainWindow::bytecode_cb_verbose, Ui_MainWindow::bytecodeBtn, Ui_MainWindow::bytecodeTextEdit, Ui_MainWindow::classTableView, classToolSet, and inspectorj::toolset::ClassToolSet::disassembleBytecodes().
Referenced by setupConnections().
void InspectorJ::updateBytecodeBtn | ( | ) | [private, slot] |
Enable or disable the bytecode button based on whether inspectorJ is attached to a jvm and has valid input.
Definition at line 304 of file inspectorj.cpp.
References Ui_MainWindow::bytecodeBtn, Ui_MainWindow::classTableView, connectionManager, and inspectorj::client::ConnectionManager::isAttached().
Referenced by connected(), setupConnections(), and updateBytecodeTextEdit().
void InspectorJ::updateBytecodeTextEdit | ( | ) | [private, slot] |
Update the bytecode text edit with results.
This slot is called when classToolSet->bytecodesReady() signal is emitted.
Definition at line 294 of file inspectorj.cpp.
References Ui_MainWindow::bytecodeTextEdit, classToolSet, inspectorj::toolset::ClassToolSet::prepareBytecodeOutput(), and updateBytecodeBtn().
Referenced by setupConnections().
void InspectorJ::javaAppErr | ( | QProcess::ProcessError | ) | [private, slot] |
Slot called when an error is emitted from javaAppProcess.
Definition at line 605 of file inspectorj.cpp.
References Ui_MainWindow::consoleTextEdit.
Referenced by setupConnections().
void InspectorJ::javaAppFinished | ( | int | , | |
QProcess::ExitStatus | ||||
) | [private, slot] |
Slot called when the javaAppProcess emits finshed signal.
Definition at line 621 of file inspectorj.cpp.
References Ui_MainWindow::consoleTextEdit, javaAppProcess, and stopJavaAction.
Referenced by setupConnections().
void InspectorJ::javaAppStdErr | ( | ) | [private, slot] |
Slot called when the javaAppProcess has standard err data available.
Definition at line 640 of file inspectorj.cpp.
References cleanConsoleText(), Ui_MainWindow::consoleTextEdit, javaAppProcess, Ui_MainWindow::statusbar, and stopJavaAction.
Referenced by setupConnections().
void InspectorJ::javaAppStdOut | ( | ) | [private, slot] |
Slot called when the javaAppProcess has standard out data available.
Definition at line 657 of file inspectorj.cpp.
References cleanConsoleText(), Ui_MainWindow::consoleTextEdit, and javaAppProcess.
Referenced by setupConnections().
void InspectorJ::javaAppStarted | ( | ) | [private, slot] |
Slot called when the javaAppProcess emits started signal.
Definition at line 669 of file inspectorj.cpp.
References connectionManager, inspectorj::client::SessionProfile::getConnection(), inspectorj::client::SessionProfile::getName(), profile, inspectorj::client::ConnectionManager::startAttachTimer(), Ui_MainWindow::statusbar, and stopJavaAction.
Referenced by setupConnections().
void InspectorJ::setupConnections | ( | ) | [private] |
Setup the Signal/Slot connections.
Definition at line 93 of file inspectorj.cpp.
References addClassFilter(), Ui_MainWindow::allClassesBtn, Ui_MainWindow::bytecodeBtn, Ui_MainWindow::classTableView, classToolSet, connected(), connectedStateBtn, connectionManager, Ui_MainWindow::ctbAddFilterBtn, Ui_MainWindow::ctbRemoveFilterBtn, disassembleBytecodes(), disconnectAction, Ui_MainWindow::exitAction, Ui_MainWindow::fontAction, getJvmInfo(), javaAppErr(), javaAppFinished(), javaAppProcess, javaAppStarted(), javaAppStdErr(), javaAppStdOut(), jvmInfoResponse, Ui_MainWindow::newProfileAction, Ui_MainWindow::profileDirAction, removeClassFilter(), setProfileDirectory(), showFontDlg(), showJvmInfo(), showSessionDlg(), stopJavaAction, updateBytecodeBtn(), updateBytecodeTextEdit(), updateClassTable(), and updateClassTree().
Referenced by InspectorJ().
void InspectorJ::initWindow | ( | ) | [private] |
Perform some post setupUI() initialization.
Sets the title, sets icons, etc.
Definition at line 65 of file inspectorj.cpp.
References Ui_MainWindow::allClassesBtn, Ui_MainWindow::bytecodeBtn, Ui_MainWindow::bytecodeGroupBox, bytecodeHighlighter, Ui_MainWindow::bytecodeTextEdit, Ui_MainWindow::classTreeDockWidget, Ui_MainWindow::classTreeView, connectedStateBtn, Ui_MainWindow::ctbFilterGroupBox, and Ui_MainWindow::statusbar.
Referenced by InspectorJ().
void InspectorJ::loadSettings | ( | ) | [private] |
Loads any stored settings, such as geometry and user defined connections, from the previous session.
Definition at line 324 of file inspectorj.cpp.
References Ui_MainWindow::consoleTabSplitter, loadProfiles(), profileDir, Ui_MainWindow::splitter1, Ui_MainWindow::splitter2, Ui_MainWindow::splitter3, Ui_MainWindow::splitter4, and Ui_MainWindow::splitter5.
Referenced by InspectorJ().
void InspectorJ::saveSettings | ( | ) | [private] |
Saves inspectorJ settings to disk.
This function is called on closeEvent(QCloseEvent *event). The settings are stored in a platform specific way (registry on win32, config file on linux, etc).
Definition at line 354 of file inspectorj.cpp.
References Ui_MainWindow::consoleTabSplitter, profileDir, Ui_MainWindow::splitter1, Ui_MainWindow::splitter2, Ui_MainWindow::splitter3, Ui_MainWindow::splitter4, and Ui_MainWindow::splitter5.
Referenced by closeEvent().
void InspectorJ::createActions | ( | ) | [private] |
Create QActions for inspectorJ.
Definition at line 471 of file inspectorj.cpp.
References disconnectAction, jvmInfoResponse, and stopJavaAction.
Referenced by InspectorJ().
void InspectorJ::createMenus | ( | ) | [private] |
Create initial menu state.
Definition at line 483 of file inspectorj.cpp.
References attachProfileMenuItem, disconnectAction, editProfileMenuItem, launchProfileMenuItem, Ui_MainWindow::menuSessions, stopJavaAction, and updateSessionsMenu().
Referenced by InspectorJ().
void InspectorJ::updateSessionsMenu | ( | ) | [private] |
Update the connections menu to reflect the addition or removal of user defined connections.
Definition at line 502 of file inspectorj.cpp.
References attachProfileMenuItem, connectionManager, editProfileMenuItem, inspectorj::client::SessionProfile::getConnection(), inspectorj::client::SessionProfile::getName(), inspectorj::client::ijConnection::host, inspectorj::client::SessionProfile::isExternalLaunch(), launchProfileMenuItem, inspectorj::client::ijConnection::port, profileDir, profiles, setCurrentProfile(), and showSessionDlg().
Referenced by createMenus(), setProfileDirectory(), and showSessionDlg().
void InspectorJ::updateClassToolBox | ( | bool | ) | [private] |
Update the display of the class tool box.
Definition at line 157 of file inspectorj.cpp.
References Ui_MainWindow::ctbClassFilterList, Ui_MainWindow::ctbFilterGroupBox, inspectorj::client::SessionProfile::getClassFilters(), and profile.
Referenced by connected(), and showSessionDlg().
The connection manager.
Definition at line 112 of file inspectorj.h.
Referenced by addClassFilter(), closeEvent(), getJvmInfo(), InspectorJ(), javaAppStarted(), removeClassFilter(), setupConnections(), showSessionDlg(), updateBytecodeBtn(), and updateSessionsMenu().
QToolButton* inspectorj::client::InspectorJ::connectedStateBtn [private] |
ToolButton that reflects the current connected state.
Definition at line 121 of file inspectorj.h.
Referenced by connected(), initWindow(), and setupConnections().