}
}, event.getDelayMs());
}
else
{
Scheduler.get().scheduleDeferred(new ScheduledCommand()
{
@Override
public void execute()
{
refresh(false);
}
});
}
}
}));
registrations.add(eventBus_.addHandler(FileChangeEvent.TYPE, new FileChangeHandler()
{
@Override
public void onFileChange(FileChangeEvent event)
{
if (!session.getSessionInfo().isVcsEnabled())
registrations.removeHandler();
FileChange fileChange = event.getFileChange();
FileSystemItem file = fileChange.getFile();
StatusAndPath status = StatusAndPath.fromInfo(
getStatusFromFile(file));
if (needsFullRefresh(file))
{
refresh(false);
return;
}
if (status_ != null && status != null)
{
for (int i = 0; i < status_.size(); i++)
{
if (status.getRawPath().equals(status_.get(i).getRawPath()))
{
if (StringUtil.notNull(status.getStatus()).trim().length() == 0)
status_.remove(i);
else
status_.set(i, status);
handlers_.fireEvent(new VcsRefreshEvent(Reason.FileChange));
return;
}
}
if (status.getStatus().trim().length() != 0)
{
status_.add(status);
handlers_.fireEvent(new VcsRefreshEvent(Reason.FileChange));
return;
}
}
}
}));
Scheduler.get().scheduleDeferred(new ScheduledCommand()
{
@Override
public void execute()
{
refresh(false);