June 2009 - Posts

I had a lot of things to blog during the past 3 months but I just couldn't get myself to write any of them online.

Well, since I've been using the Visual Studio.Net immediate window a lot lately so I thought it would be useful for fellow eclipse users to know that an equivalent tool exist in Eclipse.


I don't have to write what's already written, right? Just follow the link below, it's pretty much self-explanatory.

Update:

Alright! So I figured out I should try and write more information about this. So let's consider the following code:

Normal 0 false false false MicrosoftInternetExplorer4

import java.util.ArrayList;

import java.util.List;

 

 

public class TestClass {

 

      public TestClass(){

 

      }

 

      public static void main(String[] args){

            new TestClass().go();

      }

 

      public void go(){

            List<String> myFriendsNameList = new ArrayList<String>();

 

            myFriendsNameList.add("Ray");

            myFriendsNameList.add("Paul");

            myFriendsNameList.add("Kevin");

      }

 

}

 

1. First, make sure that you are in the Debug perspective

 

2. I would set a breakpoint to the line that says... Let's say,   Normal 0 false false false MicrosoftInternetExplorer4 myFriendsNameList.add("Kevin"); .

 

3. Next, I would go to window->Show View->Other

 

4. Under the debug folder, choose Display

 

5. If you are in the Java perspective, choose Debug As Java Application

 

6. Once you stop on the breakpoint, type myFriendsNameList.get(0)  in the Display view tab (commonly placed below your IDE), highlight the text you just typed and press CTRL + SHIFT + D and something like below should appear right below the code you typed.

     (java.lang.String) Ray

You could also do other things like check the size() of the list. This is an alternative way of looking at the Variables window and is very, very useful throughout developement.

 

Reference:

http://askville.amazon.com/debugging-Eclipse-Visual-Studio-equivalent-Window-interactive-top-level/AnswerViewer.do?requestId=9072383

Posted by lamia | with no comments
Filed under: ,