Search in sources :

Example 1 with VisiblePackRefresher

use of com.intellij.vcs.log.visible.VisiblePackRefresher in project intellij-community by JetBrains.

the class RefreshLogAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    VcsLogUtil.triggerUsage(e);
    VcsLogManager logManager = e.getRequiredData(VcsLogInternalDataKeys.LOG_MANAGER);
    // diagnostic for possible refresh problems
    VcsLogUi ui = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
    if (ui instanceof AbstractVcsLogUi) {
        VisiblePackRefresher refresher = ((AbstractVcsLogUi) ui).getRefresher();
        if (!refresher.isValid()) {
            String message = "Trying to refresh invalid log tab.";
            if (!logManager.getDataManager().getProgress().isRunning()) {
                LOG.error(message);
            } else {
                LOG.warn(message);
            }
            refresher.setValid(true);
        }
    }
    logManager.getDataManager().refreshSoftly(VcsLogUtil.getVisibleRoots(ui));
}
Also used : VisiblePackRefresher(com.intellij.vcs.log.visible.VisiblePackRefresher) AbstractVcsLogUi(com.intellij.vcs.log.ui.AbstractVcsLogUi) VcsLogManager(com.intellij.vcs.log.impl.VcsLogManager) AbstractVcsLogUi(com.intellij.vcs.log.ui.AbstractVcsLogUi) VcsLogUi(com.intellij.vcs.log.VcsLogUi)

Aggregations

VcsLogUi (com.intellij.vcs.log.VcsLogUi)1 VcsLogManager (com.intellij.vcs.log.impl.VcsLogManager)1 AbstractVcsLogUi (com.intellij.vcs.log.ui.AbstractVcsLogUi)1 VisiblePackRefresher (com.intellij.vcs.log.visible.VisiblePackRefresher)1