Merge branch 'dragonmacher-task-launcher-backgrounding-update'

This commit is contained in:
dragonmacher 2019-05-23 18:26:53 -04:00
commit 8cdfe79def
28 changed files with 605 additions and 318 deletions

View file

@ -33,7 +33,7 @@ public class Swing {
private static final String SWING_TIMEOUT_SECONDS_PROPERTY =
Swing.class.getName().toLowerCase() + ".timeout.seconds";
private static final int SWING_TIMEOUT_SECONDS_DEFAULT_VALUE = 10;
private static final int SWING_TIMEOUT_SECONDS_DEFAULT_VALUE = 20;
private static int loadTimeout() {
String timeoutString = System.getProperty(SWING_TIMEOUT_SECONDS_PROPERTY,
@ -61,7 +61,7 @@ public class Swing {
*
* @return true if this is the event dispatch thread -OR- is in headless mode.
*/
public static boolean isEventDispatchThread() {
public static boolean isSwingThread() {
if (isInHeadlessMode()) {
return true;
}
@ -94,7 +94,7 @@ public class Swing {
return; // squash during production mode
}
if (!isEventDispatchThread()) {
if (!isSwingThread()) {
Throwable t =
ReflectionUtilities.filterJavaThrowable(new AssertException(errorMessage));
Msg.error(SystemUtilities.class, errorMessage, t);

View file

@ -422,7 +422,7 @@ public class SystemUtilities {
* @return true if this is the event dispatch thread -OR- is in headless mode.
*/
public static boolean isEventDispatchThread() {
return Swing.isEventDispatchThread();
return Swing.isSwingThread();
}
/**

View file

@ -33,7 +33,11 @@ class StubTaskMonitor implements TaskMonitor {
@Override
public void setMessage(String message) {
// stub
}
@Override
public String getMessage() {
return null;
}
@Override
@ -64,6 +68,11 @@ class StubTaskMonitor implements TaskMonitor {
// stub
}
@Override
public boolean isIndeterminate() {
return false;
}
@Override
public void checkCanceled() throws CancelledException {
// stub

View file

@ -56,6 +56,12 @@ public interface TaskMonitor {
*/
public void setMessage(String message);
/**
* Gets the last set message of this monitor
* @return the message
*/
public String getMessage();
/**
* Sets the current progress value
* @param value progress value
@ -91,6 +97,12 @@ public interface TaskMonitor {
*/
public void setIndeterminate(boolean indeterminate);
/**
* Returns true if this monitor shows no progress
* @return true if this monitor shows no progress
*/
public boolean isIndeterminate();
/**
* Check to see if this monitor has been canceled
* @throws CancelledException if monitor has been cancelled