Skip to content

Commit

Permalink
Script selector panel UI
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider committed Feb 10, 2020
1 parent 54b3423 commit 7977190
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ private void closeExporter() {

if (processor != null) {
// Dispose exporter
processor.dispose();
try {
processor.dispose();
} catch (Exception e) {
log.debug(e);
}
processor = null;
}
closeOutputStreams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public void keyPressed(KeyEvent e) {
columns[1].pack();
columns[2].setWidth(200 * 8);

scriptTree.setFocus();
UIUtils.asyncExec(scriptTree::setFocus);

return composite;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ private static SQLNavigatorContext getCurrentContext(ExecutionEvent event) throw
context.setDataSourceContainer(dataSourceRegistry.getDataSources().get(0));
} else if (!dataSourceRegistry.getDataSources().isEmpty()) {
SelectDataSourceDialog dialog = new SelectDataSourceDialog(HandlerUtil.getActiveShell(event), project, null);
dialog.setModeless(true);
if (dialog.open() == IDialogConstants.CANCEL_ID) {
throw new InterruptedException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,7 @@ protected void closeOnFocusLost(Control ... controls) {
@Override
public void focusLost(FocusEvent e) {
UIUtils.asyncExec(() -> {
Shell shell = getShell();
if (shell != null) {
Control focusControl = shell.getDisplay().getFocusControl();
if (focusControl != null && !UIUtils.isParent(shell, focusControl)) {
cancelPressed();
}
}
handleFocusLost();
});
}
};
Expand All @@ -104,4 +98,16 @@ public void focusLost(FocusEvent e) {

}

private void handleFocusLost() {
Shell shell = getShell();
if (shell != null) {
Control focusControl = shell.getDisplay().getFocusControl();
if (focusControl != null && !UIUtils.isParent(shell, focusControl)) {
cancelPressed();
}
} else {
cancelPressed();
}
}

}

0 comments on commit 7977190

Please sign in to comment.