Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 127974 Details for
Bug 267561
[evaluation] LocalEvaluationEngine does not accept primitive types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Same as DisplayAction but uses LocalEE
LEDisplayAction.java (text/plain), 4.96 KB, created by
Nikola Mihajloviæ
on 2009-03-08 19:51:06 EDT
(
hide
)
Description:
Same as DisplayAction but uses LocalEE
Filename:
MIME Type:
Creator:
Nikola Mihajloviæ
Created:
2009-03-08 19:51:06 EDT
Size:
4.96 KB
patch
obsolete
>package jvd.ui.actions; > >import java.lang.reflect.InvocationTargetException; > >import org.eclipse.core.resources.ResourcesPlugin; >import org.eclipse.core.runtime.CoreException; >import org.eclipse.core.runtime.IPath; >import org.eclipse.core.runtime.IProgressMonitor; >import org.eclipse.debug.core.DebugEvent; >import org.eclipse.jdt.core.IJavaElement; >import org.eclipse.jdt.core.IJavaProject; >import org.eclipse.jdt.debug.core.IJavaDebugTarget; >import org.eclipse.jdt.debug.core.IJavaObject; >import org.eclipse.jdt.debug.core.IJavaStackFrame; >import org.eclipse.jdt.debug.core.IJavaThread; >import org.eclipse.jdt.debug.core.JDIDebugModel; >import org.eclipse.jdt.debug.eval.EvaluationManager; >import org.eclipse.jdt.debug.eval.IEvaluationEngine; >import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin; >import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; >import org.eclipse.jdt.internal.debug.ui.actions.ActionMessages; >import org.eclipse.jdt.internal.debug.ui.actions.DisplayAction; >import org.eclipse.jdt.internal.debug.ui.actions.EvaluateAction; >import org.eclipse.jface.operation.IRunnableWithProgress; >import org.eclipse.ui.IWorkbench; > >public class LEDisplayAction extends DisplayAction { > > protected void run() { > // eval in context of object or stack frame > final IJavaObject object = getObjectContext(); > final IJavaStackFrame stackFrame= getStackFrameContext(); > if (stackFrame == null) { > reportError(ActionMessages.Evaluate_error_message_stack_frame_context); > return; > } > > // check for nested evaluation > IJavaThread thread = (IJavaThread)stackFrame.getThread(); > if (thread.isPerformingEvaluation()) { > reportError(ActionMessages.EvaluateAction_Cannot_perform_nested_evaluations__1); > return; > } > > setNewTargetPart(getTargetPart()); > > IRunnableWithProgress runnable = new IRunnableWithProgress() { > public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { > if (stackFrame.isSuspended()) { > IJavaElement javaElement= getJavaElement(stackFrame); > if (javaElement != null) { > IJavaProject project = javaElement.getJavaProject(); > IEvaluationEngine engine = null; > try { > Object selection= getSelectedObject(); > if (!(selection instanceof String)) { > return; > } > String expression= (String)selection; > IPath outputLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(project.getOutputLocation()); >// IPath outputLocation = project.getProject().getWorkingLocation(JDIDebugUIPlugin.getUniqueIdentifier()); > java.io.File f = new java.io.File(outputLocation.toOSString()); > engine = EvaluationManager.newClassFileEvaluationEngine(project, (IJavaDebugTarget)stackFrame.getDebugTarget(), f); >// engine = JDIDebugPlugin.getDefault().getEvaluationEngine(project, (IJavaDebugTarget)stackFrame.getDebugTarget()); > setEvaluating(true); > boolean hitBreakpoints= JDIDebugModel.getPreferences().getBoolean(JDIDebugModel.PREF_SUSPEND_FOR_BREAKPOINTS_DURING_EVALUATION); > if (object == null) { > engine.evaluate(expression, stackFrame, LEDisplayAction.this, DebugEvent.EVALUATION, hitBreakpoints); > } else { > engine.evaluate(expression, object, (IJavaThread)stackFrame.getThread(), LEDisplayAction.this, DebugEvent.EVALUATION, hitBreakpoints); > } > return; > } catch (CoreException e) { > throw new InvocationTargetException(e, getExceptionMessage(e)); > } > } > throw new InvocationTargetException(null, ActionMessages.Evaluate_error_message_src_context); > } > // thread not suspended > throw new InvocationTargetException(null, ActionMessages.EvaluateAction_Thread_not_suspended___unable_to_perform_evaluation__1); > } > }; > > IWorkbench workbench = JDIDebugUIPlugin.getDefault().getWorkbench(); > try { > workbench.getProgressService().busyCursorWhile(runnable); > } catch (InvocationTargetException e) { > evaluationCleanup(); > String message = e.getMessage(); > if (message == null) { > message = e.getClass().getName(); > if (e.getCause() != null) { > message = e.getCause().getClass().getName(); > if (e.getCause().getMessage() != null) { > message = e.getCause().getMessage(); > } > } > } > reportError(message); > } catch (InterruptedException e) { > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 267561
: 127974 |
147587
|
147588
|
147794