@Override
protected void onInit(JsObject value)
{
if (value != null)
{
BreakpointState state = value.cast();
// restore all of the breakpoints
JsArray<Breakpoint> breakpoints =
state.getPersistedBreakpoints();
for (int idx = 0; idx < breakpoints.length(); idx++)
{
Breakpoint breakpoint = breakpoints.get(idx);
// make sure the next breakpoint we create after a restore
// has a value larger than any existing breakpoint
currentBreakpointId_ = Math.max(
currentBreakpointId_,
breakpoint.getBreakpointId() + 1);
addBreakpoint(breakpoint);
}
// this initialization happens after the source windows are
// up, so fire an event to the editor to show all known
// breakpoints. as new source windows are opened, they will
// call getBreakpointsInFile to populate themselves.
events_.fireEvent(
new BreakpointsSavedEvent(breakpoints_, true));
}
}
@Override
protected JsObject getValue()
{
BreakpointState state =
BreakpointState.create();
for (Breakpoint breakpoint: breakpoints_)
{
state.addPersistedBreakpoint(breakpoint);
}
breakpointStateDirty_ = false;
return state.cast();
}
@Override
protected boolean hasChanged()
{