Search in sources :

Example 1 with DatabaseScriptDialog

use of org.jkiss.dbeaver.debug.ui.DatabaseScriptDialog in project dbeaver by dbeaver.

the class PgSqlLocalLaunchShortcut method createConfiguration.

@Override
protected ILaunchConfiguration createConfiguration(DBSObject launchable) throws CoreException {
    ILaunchConfigurationWorkingCopy workingCopy = PostgreSqlDebugCore.createConfiguration(launchable);
    workingCopy.setAttribute(DebugCore.ATTR_ATTACH_KIND, DBGController.ATTACH_KIND_LOCAL);
    IWorkbenchPartSite site = getWorkbenchPartSite();
    String script = workingCopy.getAttribute(DebugCore.ATTR_SCRIPT_TEXT, DebugCore.ATTR_SCRIPT_TEXT_DEFAULT);
    String inputName = "Script";
    DatabaseScriptDialog dialog = new DatabaseScriptDialog(getShell(), site, inputName, script, launchable);
    dialog.create();
    dialog.setTitle("Specify script to be executed");
    dialog.setMessage("Specify script to be executed to start debug.");
    int open = dialog.open();
    if (IDialogConstants.CANCEL_ID == open) {
        return null;
    }
    String modified = dialog.getScriptTextValue();
    workingCopy.setAttribute(DebugCore.ATTR_SCRIPT_TEXT, modified);
    return workingCopy.doSave();
}
Also used : IWorkbenchPartSite(org.eclipse.ui.IWorkbenchPartSite) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) DatabaseScriptDialog(org.jkiss.dbeaver.debug.ui.DatabaseScriptDialog)

Aggregations

ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)1 IWorkbenchPartSite (org.eclipse.ui.IWorkbenchPartSite)1 DatabaseScriptDialog (org.jkiss.dbeaver.debug.ui.DatabaseScriptDialog)1