java.lang.Object
com.iamsoft.util.ui.swing.EnhancedSwingWorker<T,V>
- Type Parameters:
T- Result type returned by thisEnhancedSwingWorker'sdoInBackgroundandgetmethods.V- Type used for carrying out intermediate results by thisEnhancedSwingWorker'spublishandprocessmethods.
Wrap a real SwingWorker.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.EnhancedSwingWorker(String pName) EnhancedSwingWorker(String pName, Map.Entry<Integer, Integer> pDelay) EnhancedSwingWorker(String pName, Map.Entry<Integer, Integer> pDelay, boolean pMultithread) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(PropertyChangeListener pListener) 'progress' property not yet implemented.voidcancel(boolean pMayInterruptIfRunning) protected abstract Tprotected voiddone()final voidexecute()This method should only be called from the event queue thread.final Tget()getState()Unlike SwingWorker.getState(), this method will never return SwingWorker.StateValue.PENDING after SwingWorker.execute() has been called.booleanbooleanisDone()static booleanvoidstatic voidsetSuppressingThreading(boolean pSuppressingThreading) Can disable multithreading.
-
Field Details
-
NO_DELAY
-
STATE_PROPERTY
- See Also:
-
-
Constructor Details
-
EnhancedSwingWorker
Deprecated. -
EnhancedSwingWorker
-
EnhancedSwingWorker
-
EnhancedSwingWorker
- Parameters:
pName- Friendly name used along with System.identityHashCode(Object) to construct identifier.pDelay- Min/max delay in milliseconds.pMultithread- If true, perform work in separate thread.
-
-
Method Details
-
isSuppressingThreading
public static boolean isSuppressingThreading() -
setSuppressingThreading
public static void setSuppressingThreading(boolean pSuppressingThreading) Can disable multithreading. Provided for unit testing. Standard classes should not call. -
addPropertyChangeListener
'progress' property not yet implemented.- See Also:
-
removePropertyChangeListener
-
doInBackground
- Throws:
Exception- See Also:
-
done
protected void done()- See Also:
-
get
- Throws:
InterruptedExceptionExecutionException- See Also:
-
execute
public final void execute()This method should only be called from the event queue thread.- See Also:
-
cancel
public void cancel(boolean pMayInterruptIfRunning) - See Also:
-
getState
Unlike SwingWorker.getState(), this method will never return SwingWorker.StateValue.PENDING after SwingWorker.execute() has been called. The decorated worker may be 'pending', but we consider it to be in progress for simplicity's sake? May wish to revisit this. -
isCancelled
public boolean isCancelled()- See Also:
-
isDone
public boolean isDone()- See Also:
-