- 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.
public abstract class EnhancedSwingWorker<T,V> extends Object
Wrap a real SwingWorker.
-
-
Constructor Summary
Constructors Constructor Description EnhancedSwingWorker()
Deprecated.EnhancedSwingWorker(String pName)
EnhancedSwingWorker(String pName, Map.Entry<Integer,Integer> pDelay)
EnhancedSwingWorker(String pName, Map.Entry<Integer,Integer> pDelay, boolean pMultithread)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener pListener)
'progress' property not yet implemented.void
cancel(boolean pMayInterruptIfRunning)
protected abstract T
doInBackground()
protected void
done()
void
execute()
This method should only be called from the event queue thread.T
get()
SwingWorker.StateValue
getState()
Unlike SwingWorker.getState(), this method will never return SwingWorker.StateValue.PENDING after SwingWorker.execute() has been called.boolean
isCancelled()
boolean
isDone()
static boolean
isSuppressingThreading()
void
removePropertyChangeListener(PropertyChangeListener pListener)
static void
setSuppressingThreading(boolean pSuppressingThreading)
Can disable multithreading.
-
-
-
Field Detail
-
STATE_PROPERTY
public static final String STATE_PROPERTY
- See Also:
getState()
, Constant Field Values
-
-
Constructor Detail
-
EnhancedSwingWorker
@Deprecated public EnhancedSwingWorker()
Deprecated.
-
EnhancedSwingWorker
public EnhancedSwingWorker(String pName)
-
EnhancedSwingWorker
public EnhancedSwingWorker(String pName, Map.Entry<Integer,Integer> pDelay, boolean pMultithread)
- 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 Detail
-
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
public void addPropertyChangeListener(PropertyChangeListener pListener)
'progress' property not yet implemented.- See Also:
STATE_PROPERTY
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener pListener)
-
doInBackground
protected abstract T doInBackground() throws Exception
- Throws:
Exception
- See Also:
SwingWorker.doInBackground()
-
done
protected void done()
- See Also:
SwingWorker.done()
-
get
public final T get() throws InterruptedException, ExecutionException
- Throws:
InterruptedException
ExecutionException
- See Also:
SwingWorker.get()
-
execute
public final void execute()
This method should only be called from the event queue thread.- See Also:
SwingWorker.execute()
-
cancel
public void cancel(boolean pMayInterruptIfRunning)
- See Also:
SwingWorker.cancel(boolean)
-
getState
public SwingWorker.StateValue 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:
SwingWorker.isCancelled()
-
isDone
public boolean isDone()
- See Also:
SwingWorker.isDone()
-
-