提交 7977190d 编写于 作者: S Serge Rider

Script selector panel UI

上级 54b34232
......@@ -261,7 +261,11 @@ public class StreamTransferConsumer implements IDataTransferConsumer<StreamConsu
if (processor != null) {
// Dispose exporter
processor.dispose();
try {
processor.dispose();
} catch (Exception e) {
log.debug(e);
}
processor = null;
}
closeOutputStreams();
......
......@@ -328,7 +328,7 @@ public class ScriptSelectorPanel extends AbstractPopupPanel {
columns[1].pack();
columns[2].setWidth(200 * 8);
scriptTree.setFocus();
UIUtils.asyncExec(scriptTree::setFocus);
return composite;
}
......
......@@ -181,6 +181,7 @@ public class SQLEditorHandlerOpenEditor extends AbstractDataSourceHandler {
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();
}
......
......@@ -85,13 +85,7 @@ public abstract class AbstractPopupPanel extends Dialog {
@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();
});
}
};
......@@ -104,4 +98,16 @@ public abstract class AbstractPopupPanel extends Dialog {
}
private void handleFocusLost() {
Shell shell = getShell();
if (shell != null) {
Control focusControl = shell.getDisplay().getFocusControl();
if (focusControl != null && !UIUtils.isParent(shell, focusControl)) {
cancelPressed();
}
} else {
cancelPressed();
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册