use of org.jkiss.dbeaver.debug.core.model.DatabaseProcess in project dbeaver by serge-rider.
the class DatabaseLaunchDelegate method launch.
@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
DBPDataSourceContainer datasourceDescriptor = DebugUtils.getDataSourceContainer(configuration);
DBGController controller = createController(datasourceDescriptor, configuration.getAttributes());
if (controller == null) {
String message = NLS.bind("Unable to find debug controller for datasource {0}", datasourceDescriptor);
throw new CoreException(DebugUtils.newErrorStatus(message));
}
DatabaseProcess process = createProcess(launch, configuration.getName());
DatabaseDebugTarget target = createDebugTarget(launch, controller, process);
target.connect(monitor);
launch.addDebugTarget(target);
}
use of org.jkiss.dbeaver.debug.core.model.DatabaseProcess in project dbeaver by dbeaver.
the class DatabaseLaunchDelegate method launch.
@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
String datasourceId = DebugCore.extractDatasourceId(configuration);
DataSourceDescriptor datasourceDescriptor = DataSourceRegistry.findDataSource(datasourceId);
if (datasourceDescriptor == null) {
String message = NLS.bind("Unable to find data source with id {0}", datasourceId);
throw new CoreException(DebugCore.newErrorStatus(message));
}
Map<String, Object> attributes = extractAttributes(configuration);
DBGController controller = createController(datasourceDescriptor);
if (controller == null) {
String message = NLS.bind("Unable to find debug controller for datasource {0}", datasourceDescriptor);
throw new CoreException(DebugCore.newErrorStatus(message));
}
controller.init(attributes);
DatabaseProcess process = createProcess(launch, configuration.getName());
DatabaseDebugTarget target = createDebugTarget(launch, controller, process);
target.connect(monitor);
launch.addDebugTarget(target);
}
use of org.jkiss.dbeaver.debug.core.model.DatabaseProcess in project dbeaver by dbeaver.
the class DatabaseDebugModelPresentation method getText.
@Override
public String getText(Object element) {
// FIXME:AF: register adapters
try {
if (element instanceof IDatabaseDebugTarget) {
IDatabaseDebugTarget databaseDebugTarget = (IDatabaseDebugTarget) element;
return databaseDebugTarget.getName();
}
if (element instanceof DatabaseProcess) {
DatabaseProcess process = (DatabaseProcess) element;
return process.getLabel();
}
if (element instanceof DatabaseThread) {
DatabaseThread thread = (DatabaseThread) element;
return thread.getName();
}
if (element instanceof DatabaseStackFrame) {
DatabaseStackFrame stackFrame = (DatabaseStackFrame) element;
return stackFrame.getName();
}
if (element instanceof DatabaseVariable) {
DatabaseVariable variable = (DatabaseVariable) element;
return variable.getName();
}
if (element instanceof DatabaseLineBreakpoint) {
DatabaseLineBreakpoint breakpoint = (DatabaseLineBreakpoint) element;
String database = breakpoint.getDatabaseName();
String schema = breakpoint.getSchemaName();
String procedure = breakpoint.getProcedureName();
int lineNumber = breakpoint.getLineNumber();
String pattern = "{0}.{1}.{2} - [line:{3}]";
Object[] bindings = new Object[] { database, schema, procedure, lineNumber };
return NLS.bind(pattern, bindings);
}
} catch (CoreException e) {
return "<not responding>";
}
return labelProvider.getText(element);
}
Aggregations