Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<html lang="en">
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<title> Evaluating expressions </title>
<h1> Evaluating expressions </h1>
<p> In this section, you will evaluate expressions in the context of your
running Java program. </p>
  <li> Debug <em></em> to the breakpoint in the
    <code>setUp()</code> method and select <b>Step Over</b> twice to populate <code>fFull</code>.&nbsp; (See the <a href="qs-13.htm">Debugging your Programs</a> section for full
  <li>Open the Display view by selecting <b>Window &gt; Show View &gt; Display</b> 
    and type the following line in the view:
    <p> <code>fFull.size()</code></p>
  <li> Select the text you just typed, and from its context menu, select <strong>Display</strong>.&nbsp;
    (You can also choose <strong>Display Result of Evaluating Selected Text </strong> (<img src="../images/org.eclipse.jdt.debug.ui/etool16/disp_sbook.png" alt="Display" >) from
    the Display view toolbar.) 
    <p> <img src="images/view_display_display.png"  alt="Display view with fFull.size selected and showing context menu"> 
  <li> The expression is evaluated and the result is displayed in the Display
    <p> <img src="images/view_display_display_done.png"  alt="Display view showing evaluation result: (int) 2"> 
  <li> On a new line in the Display view, type the following line: 
    <p> <code>fFull.toArray()</code> </p>
  <li> Select this line, and select <strong>Inspect</strong> from the context
    menu.&nbsp; (You can also choose <strong>Inspect Result of Evaluating
    Selected Text </strong> (<img src="../images/org.eclipse.jdt.debug.ui/etool16/insp_sbook.png" alt="Inspect" >) from the Display view toolbar.) </li>
  <li>A lightweight window opens with the value of the evaluated expression. 
    <p> <img src="images/view_display_inspect.png"  alt="Pop-up containing fFull.toArray() expression"> 
<P class="nav_footer" id="nav_footer">Next Section: <A href="qs-15.htm">Evaluating snippets</A>
<p><img src="../images/ngrelc.png" alt="Related concepts" ><br>
<a href="../concepts/cdebugger.htm">Debugger</a></p>
<p><img src="../images/ngrelt.png" alt="Related tasks" ><br>
     <a href="../tasks/task-evaluating_expressions.htm">Evaluating expressions</a><br>
<a href="../tasks/task-display_evaluation_result.htm">Displaying the result of evaluating an
<a href="../tasks/task-inspect_evaluation_result.htm">Inspecting the result of evaluating an
<p><img src="../images/ngrelr.png" alt="Related reference" ><br>
<a href="../reference/views/expressions/ref-expressions_view.htm">Expressions view</a></p>


New to GrepCode? Check out our FAQ X