use of org.jkiss.dbeaver.debug.core.model.DatabaseStackFrame in project dbeaver by serge-rider.
the class DebugUtils method getSourceName.
public static String getSourceName(Object object) throws CoreException {
if (object instanceof DatabaseStackFrame) {
DatabaseStackFrame frame = (DatabaseStackFrame) object;
Object sourceIdentifier = frame.getSourceIdentifier();
DBSObject dbsObject;
try {
dbsObject = findDatabaseObject(frame.getController(), sourceIdentifier, new VoidProgressMonitor());
} catch (DBException e) {
Status error = DebugUtils.newErrorStatus(e.getMessage(), e);
throw new CoreException(error);
}
if (dbsObject == null) {
return null;
}
final DBNModel navigatorModel = DBWorkbench.getPlatform().getNavigatorModel();
DBNDatabaseNode node = navigatorModel.getNodeByObject(new VoidProgressMonitor(), dbsObject, false);
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.DatabaseStackFrame in project dbeaver by dbeaver.
the class DebugUtils method getSourceName.
public static String getSourceName(Object object) throws CoreException {
if (object instanceof DatabaseStackFrame) {
DatabaseStackFrame frame = (DatabaseStackFrame) object;
Object sourceIdentifier = frame.getSourceIdentifier();
DBSObject dbsObject;
try {
dbsObject = findDatabaseObject(frame.getController(), sourceIdentifier, new VoidProgressMonitor());
} catch (DBException e) {
Status error = DebugUtils.newErrorStatus(e.getMessage(), e);
throw new CoreException(error);
}
if (dbsObject == null) {
return null;
}
final DBNModel navigatorModel = DBWorkbench.getPlatform().getNavigatorModel();
DBNDatabaseNode node = navigatorModel.getNodeByObject(new VoidProgressMonitor(), dbsObject, false);
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.DatabaseStackFrame 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;
}
Aggregations