Q:

Is it possible to redirect user to a code block within a java file using vis?

I am using the vis library to visualize data and I want to redirect the user to a certain code block within java after pressing a button. I am using the following code from the library to process a button click:
s = "test";
b = box(text(str () { return s; }),
    fillColor("red"),
    onMouseDown(bool (int butnr, map[KeyModifier,bool] modifiers) {
        s = "<butnr>";
        return true;
    }));
render(b)

After the user clicks the button I want him to be redirected to a certain java code block in eclipse (just like what happens when you get a parse error of some sorts within the terminal). Any help would be greatly appreciated.

A:

I have the feeling there is a bug in onMouseDown, but if that works than the public void edit(loc file) function in util::Editors is your friend.
The editor will open and the selection will be set around the offset and length targeted by the location. If you use a logical location like java+method://... you must register the m3 model first for this to work. This is a standard side effect of createM3FromEclipseProject but otherwise check out analysis::m3::Registry to make those locations resolve to a hard file plus offset. 

