mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix enterModality/exitModality
This commit is contained in:
@@ -47,24 +47,30 @@ public class ProgressIndicatorBase implements ProgressIndicator {
|
||||
enterModality();
|
||||
}
|
||||
|
||||
protected final synchronized void enterModality() {
|
||||
if (myModalityProgress == this && !myModalityEntered){
|
||||
myModalityEntered = true;
|
||||
protected final void enterModality() {
|
||||
if (myModalityProgress == this){
|
||||
if (!EventQueue.isDispatchThread()){
|
||||
SwingUtilities.invokeLater(
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
LaterInvocator.enterModal(ProgressIndicatorBase.this);
|
||||
doEnterModality();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else{
|
||||
LaterInvocator.enterModal(this);
|
||||
doEnterModality();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doEnterModality() {
|
||||
if (!myModalityEntered) {
|
||||
LaterInvocator.enterModal(this);
|
||||
myModalityEntered = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void stop(){
|
||||
LOG.assertTrue(myRunning, "stop() should be called only if start() called before");
|
||||
myRunning = false;
|
||||
@@ -72,24 +78,30 @@ public class ProgressIndicatorBase implements ProgressIndicator {
|
||||
exitModality();
|
||||
}
|
||||
|
||||
protected final synchronized void exitModality() {
|
||||
if (myModalityProgress == this && myModalityEntered){
|
||||
myModalityEntered = false;
|
||||
protected final void exitModality() {
|
||||
if (myModalityProgress == this){
|
||||
if (!EventQueue.isDispatchThread()){
|
||||
SwingUtilities.invokeLater(
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
LaterInvocator.leaveModal(ProgressIndicatorBase.this);
|
||||
doExitModality();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else{
|
||||
LaterInvocator.leaveModal(this);
|
||||
doExitModality();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doExitModality() {
|
||||
if (myModalityEntered) {
|
||||
LaterInvocator.leaveModal(this);
|
||||
myModalityEntered = false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isRunning() {
|
||||
return myRunning;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user