use of org.jkiss.dbeaver.debug.core.model.DatabaseDebugTarget 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.DatabaseDebugTarget in project dbeaver by dbeaver.
the class DebugCore method getSourceName.
public static String getSourceName(Object object) throws CoreException {
if (object instanceof DatabaseStackFrame) {
DatabaseStackFrame frame = (DatabaseStackFrame) object;
Object sourceIdentifier = frame.getSourceIdentifier();
DatabaseDebugTarget debugTarget = frame.getDatabaseDebugTarget();
DBSObject dbsObject = null;
try {
dbsObject = debugTarget.findDatabaseObject(sourceIdentifier, new VoidProgressMonitor());
} catch (DBException e) {
Status error = DebugCore.newErrorStatus(e.getMessage(), e);
throw new CoreException(error);
}
if (dbsObject == null) {
return null;
}
final DBNModel navigatorModel = DBeaverCore.getInstance().getNavigatorModel();
DBNDatabaseNode node = navigatorModel.getNodeByObject(dbsObject);
if (node != null) {
return node.getNodeItemPath();
}
}
if (object instanceof String) {
// well, let's be positive and assume it's a node path already
return (String) object;
}
return null;
}
use of org.jkiss.dbeaver.debug.core.model.DatabaseDebugTarget in project dbeaver by dbeaver.
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);
}
Aggregations