mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] get rid of executeWithoutRepaint since we modify graph only in ui thread
This commit is contained in:
@@ -145,7 +145,7 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable {
|
||||
}
|
||||
|
||||
private void performLongAction(@NotNull final GraphAction graphAction, @NotNull String title) {
|
||||
runUnderModalProgress(title, new Runnable() {
|
||||
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final GraphAnswer<Integer> answer = myVisiblePack.getVisibleGraph().getActionController().performAction(graphAction);
|
||||
@@ -159,7 +159,7 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}, title, false, null, getMainFrame().getMainComponent());
|
||||
}
|
||||
|
||||
public void showAll() {
|
||||
@@ -364,14 +364,6 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
public void runUnderModalProgress(@NotNull final String task, @NotNull final Runnable runnable) {
|
||||
getTable().executeWithoutRepaint(new Runnable() {
|
||||
public void run() {
|
||||
ProgressManager.getInstance().runProcessWithProgressSynchronously(runnable, task, false, null, getMainFrame().getMainComponent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBranchesPanelVisible(boolean visible) {
|
||||
myMainFrame.setBranchesPanelVisible(visible);
|
||||
|
||||
@@ -87,7 +87,6 @@ public class VcsLogGraphTable extends JBTable implements TypeSafeDataProvider, C
|
||||
private final GraphCommitCellRender myGraphCommitCellRender;
|
||||
|
||||
private boolean myColumnsSizeInitialized = false;
|
||||
private final AtomicInteger myRepaintFreezedCounter = new AtomicInteger();
|
||||
|
||||
@NotNull private final Collection<VcsLogHighlighter> myHighlighters = ContainerUtil.newArrayList();
|
||||
|
||||
@@ -234,27 +233,6 @@ public class VcsLogGraphTable extends JBTable implements TypeSafeDataProvider, C
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintComponent(@NotNull Graphics g) {
|
||||
if (myRepaintFreezedCounter.get() > 0) {
|
||||
return;
|
||||
}
|
||||
super.paintComponent(g);
|
||||
}
|
||||
|
||||
/**
|
||||
* Freeze repaint to avoid repainting during changing the Graph.
|
||||
*/
|
||||
public void executeWithoutRepaint(@NotNull Runnable action) {
|
||||
myRepaintFreezedCounter.incrementAndGet();
|
||||
try {
|
||||
action.run();
|
||||
}
|
||||
finally {
|
||||
myRepaintFreezedCounter.decrementAndGet();
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public List<Change> getSelectedChanges() {
|
||||
TableModel model = getModel();
|
||||
|
||||
Reference in New Issue
Block a user