Did You have problem with copying text from grepcode? Did You have problem with a lot spaces and wrong formatting?
Well it is possible to reformat that text with two commands using regex in notepad.

Let’s say we have this:
[java]175

176

public void [More …] setButtonDrawable(int resid) {

177

if (resid != 0 && resid == mButtonResource) {

178

return;

179

}[/java]

It is possible to convert original source to better format like this:
[java]
public void setButtonDrawable(int resid) {
if (resid != 0 && resid == mButtonResource) {
return;
}
mButtonResource = resid;
Drawable d = null;
if (mButtonResource != 0) {
d = getResources().getDrawable(mButtonResource);
}
setButtonDrawable(d);
}[/java]

How?

You have to paste Your selected code to Notepad++, then click CTRL+H (for replacing function). Select at the bottom option for regex. And finally make two replacing steps:
1. replace from [java]\d+\s+\r\n[/java] to [java](empty text here)[/java]
1. replace from [java]^[\s+][\r\n$][/java] to [java](empty text here)[/java]

And that’s it!

sorsare

By sorsare

Leave a Reply

Your email address will not be published. Required fields are marked *




Enter Captcha Here :