Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bugfix #124 (double click on tree node) and #118 (special characters in connection name)#129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,7 +43,9 @@ public static String getConnectionName(final URL url) {
final Pattern p = Pattern.compile("(sqldev.nav:)([^/]+)(//)?");
final Matcher m = p.matcher(url.toString());
if (m.find()) {
return replaceHexChars(m.group(2).replace("IdeConnections%2523", "IdeConnections%23"));
return replaceHexChars(m.group(2)
.replace("IdeConnections%2523", "IdeConnections%23")) // remove connection prefix
.replace("+", " "); // spaces are encoded als plus signs, fix that, see #118
} else {
return "";
}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -405,6 +405,19 @@ public boolean include(final RowFilter.Entry<? extends TestOverviewTableModel, ?
}
}

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();
Expand All@@ -414,11 +427,21 @@ private void openTest(final Test test) {
}

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);
}
}
}

Expand All@@ -427,14 +450,27 @@ private void openSelectedFailure() {
if (rowIndex != -1) {
final int row = failuresTable.convertRowIndexToModel(rowIndex);
final Expectation expectation = failuresTableModel.getExpectation(row);
final Test test = testOverviewTableModel
.getTest(testOverviewTable.convertRowIndexToModel(testOverviewTable.getSelectedRow()));
final Integer callerLine = expectation.getCallerLine();
if (callerLine != null) {
openEditor(test.getOwnerName(), "PACKAGE BODY", test.getObjectName().toUpperCase(),
expectation.getCallerLine(), 1);
Test test = null;
if (!showSuitesCheckBoxMenuItem.isSelected()) {
// table
test = testOverviewTableModel
.getTest(testOverviewTable.convertRowIndexToModel(testOverviewTable.getSelectedRow()));
} else {
openTest(test);
// tree-table
TreePath path = testOverviewTreeTable.getTree().getSelectionPath();
if (path != null) {
ItemNode itemNode = (ItemNode) path.getLastPathComponent();
test = ((Test)itemNode.getUserObject());
}
}
if (test != null) {
final Integer callerLine = expectation.getCallerLine();
if (callerLine != null) {
openEditor(test.getOwnerName(), "PACKAGE BODY", test.getObjectName().toUpperCase(),
expectation.getCallerLine(), 1);
} else {
openTest(test);
}
}
}
}
Expand DownExpand Up@@ -1412,7 +1448,19 @@ public Component getTableCellRendererComponent(final JTable table, final Object
testOverviewCodeCoverageMenuItem.setEnabled(true);
}
});

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;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp