Bugfix #124 (double click on tree node) and #118 (special characters in connection name) by PhilippSalvisberg · Pull Request #129 · utPLSQL/utPLSQL-SQLDeveloper
private void openItemNode(final ItemNode node) { if (!node.getPackageName().equals("***")) { final UtplsqlDao dao = new UtplsqlDao(DatabaseTools.getConnection(currentRun.getConnectionName())); final String source = dao.getSource(node.getOwnerName(), "PACKAGE", node.getPackageName().toUpperCase()).trim(); final UtplsqlParser parser = new UtplsqlParser(source); int line = 1; if (node.getUserObject() instanceof Test) { line = parser.getLineOf(node.getProcedureName()); } openEditor(node.getOwnerName(), "PACKAGE", node.getPackageName().toUpperCase(), line, 1); } }
private void openTest(final Test test) { final UtplsqlDao dao = new UtplsqlDao(DatabaseTools.getConnection(currentRun.getConnectionName())); final String source = dao.getSource(test.getOwnerName(), "PACKAGE", test.getObjectName().toUpperCase()).trim();
private void openSelectedTest() { final int rowIndex = testOverviewTable.getSelectedRow(); if (rowIndex != -1) { final int row = testOverviewTable.convertRowIndexToModel(rowIndex); final Test test = testOverviewTableModel.getTest(row); openTest(test); if (!showSuitesCheckBoxMenuItem.isSelected()) { // table final int rowIndex = testOverviewTable.getSelectedRow(); if (rowIndex != -1) { final int row = testOverviewTable.convertRowIndexToModel(rowIndex); final Test test = testOverviewTableModel.getTest(row); openTest(test); } } else { // tree-table TreePath path = testOverviewTreeTable.getTree().getSelectionPath(); if (path != null) { ItemNode itemNode = (ItemNode) path.getLastPathComponent(); openItemNode(itemNode); } } }
testOverviewTreeTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(final MouseEvent e) { if (e.getClickCount() == 2) { if (failuresTable.getSelectedRowCount() == 1) { // open failure only if a Test node is selected openSelectedFailure(); } else { openSelectedTest(); } } } }); final JTree overviewTreeTableName = testOverviewTreeTable.getTree(); overviewTreeTableName.setCellRenderer(new DefaultTreeCellRenderer() { private static final long serialVersionUID = 580783625740405285L;