use of com.liferay.ide.portal.core.debug.fm.FMThread in project liferay-ide by liferay.
the class PortalSourceLookupParticipant method getTemplateName.
private String getTemplateName(IStackFrame frame) throws DebugException {
String retval = null;
IThread thread = frame.getThread();
IBreakpoint[] bps = thread.getBreakpoints();
if (bps.length == 1) {
IBreakpoint bp = thread.getBreakpoints()[0];
retval = bp.getMarker().getAttribute(ILRDebugConstants.FM_TEMPLATE_NAME, null);
} else {
if (thread instanceof FMThread) {
FMThread fmThread = (FMThread) thread;
Breakpoint stepBp = fmThread.getStepBreakpoint();
if (stepBp != null) {
// $NON-NLS-1$
retval = stepBp.getTemplateName().replaceAll(FMDebugTarget.FM_TEMPLATE_SERVLET_CONTEXT, "");
}
}
}
return retval;
}
use of com.liferay.ide.portal.core.debug.fm.FMThread in project liferay-ide by liferay.
the class SuspendFreemarkerThreadHandler method getSelectedFMStackFrame.
private FMStackFrame getSelectedFMStackFrame(Object context) {
Object selectedElement = getSelectedElement(context);
FMThread fmThread = null;
FMStackFrame fmStackFrame = null;
if (selectedElement instanceof FMThread) {
fmThread = (FMThread) selectedElement;
if (fmThread.isSuspended()) {
try {
fmStackFrame = (FMStackFrame) fmThread.getTopStackFrame();
} catch (DebugException e) {
}
}
} else if (selectedElement instanceof FMStackFrame) {
fmStackFrame = (FMStackFrame) selectedElement;
}
return fmStackFrame;
}
Aggregations