Search in sources :

Example 1 with DatabaseThread

use of org.jkiss.dbeaver.debug.core.model.DatabaseThread 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);
}
Also used : IDatabaseDebugTarget(org.jkiss.dbeaver.debug.core.model.IDatabaseDebugTarget) DatabaseStackFrame(org.jkiss.dbeaver.debug.core.model.DatabaseStackFrame) DatabaseLineBreakpoint(org.jkiss.dbeaver.debug.core.breakpoints.DatabaseLineBreakpoint) CoreException(org.eclipse.core.runtime.CoreException) DatabaseThread(org.jkiss.dbeaver.debug.core.model.DatabaseThread) DBPScriptObject(org.jkiss.dbeaver.model.DBPScriptObject) DatabaseVariable(org.jkiss.dbeaver.debug.core.model.DatabaseVariable) DatabaseProcess(org.jkiss.dbeaver.debug.core.model.DatabaseProcess) DatabaseLineBreakpoint(org.jkiss.dbeaver.debug.core.breakpoints.DatabaseLineBreakpoint)

Aggregations

CoreException (org.eclipse.core.runtime.CoreException)1 DatabaseLineBreakpoint (org.jkiss.dbeaver.debug.core.breakpoints.DatabaseLineBreakpoint)1 DatabaseProcess (org.jkiss.dbeaver.debug.core.model.DatabaseProcess)1 DatabaseStackFrame (org.jkiss.dbeaver.debug.core.model.DatabaseStackFrame)1 DatabaseThread (org.jkiss.dbeaver.debug.core.model.DatabaseThread)1 DatabaseVariable (org.jkiss.dbeaver.debug.core.model.DatabaseVariable)1 IDatabaseDebugTarget (org.jkiss.dbeaver.debug.core.model.IDatabaseDebugTarget)1 DBPScriptObject (org.jkiss.dbeaver.model.DBPScriptObject)1