getElement().getStyle().setBackgroundColor("white");
}
public void navigate(final String url)
{
RepeatingCommand navigateCommand = new RepeatingCommand() {
@Override
public boolean execute()
{
if (getIFrame() != null && getWindow() != null)
{
// if this is the same page but without an anchor qualification
// then reload (so we preserve the anchor location)
if (isBasePageOfCurrentAnchor(url))
{
getWindow().reload();
}
// if it's the same page then set the anchor and force a reload
else if (isSamePage(url))
{
getWindow().replaceLocationHref(url);
getWindow().reload();
}
// otherwise a new url, merely replacing will force a reload
else
{
getWindow().replaceLocationHref(url);
}
if (autoFocus_)
getWindow().focus();
return false;
}
else
{
return true;
}
}
};
if (navigateCommand.execute())
Scheduler.get().scheduleFixedDelay(navigateCommand, 50);
}