java.lang.Object
com.iamsoft.util.ui.swing.EnhancedSwingWorker<T,V>
- Type Parameters:
T
- Result type returned by thisEnhancedSwingWorker's
doInBackground
andget
methods.V
- Type used for carrying out intermediate results by thisEnhancedSwingWorker's
publish
andprocess
methods.
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 TypeMethodDescriptionvoid
addPropertyChangeListener
(PropertyChangeListener pListener) 'progress' property not yet implemented.void
cancel
(boolean pMayInterruptIfRunning) protected abstract T
protected void
done()
final void
execute()
This method should only be called from the event queue thread.final T
get()
getState()
Unlike SwingWorker.getState(), this method will never return SwingWorker.StateValue.PENDING after SwingWorker.execute() has been called.boolean
boolean
isDone()
static boolean
void
static void
setSuppressingThreading
(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:
InterruptedException
ExecutionException
- 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:
-