Alexmelyon
Alexmelyon

Reputation: 1239

Eclipse: change description of variable in debug mode

Can I change description of variable?
eclipse debug variables

I want to see my own string at this place. I want generate this string by myself. For example

"RTKAccount number=111 and FGSFDS"

insead of

"RTKAccount (id=830039244504)".  

I tried to change toString() method in my class, but it did not work.

public String toString() {
    return "RTKAccount id=" + this.id + " number=" + this.number;
}

Upvotes: 3

Views: 229

Answers (2)

rlegendi
rlegendi

Reputation: 10606

What you're searching for are the detail formatters.

Right-click on the variable in the Variable view and select "New Detail Formatter...". In the wizard type this into the big text area:

"RTKAccount id=" + id + " number=" + number

And there you have it ;-)

Upvotes: 4

user1817574
user1817574

Reputation:

You can change the value of a variable by right clicking it -> Change value

Upvotes: 0

Related Questions