Bug 32198 Status line delays 'Cancel' button too much
When application window is used as a runnable context, 'cancel' button does not appear right away. Instead, it is shown when the first progress is drawn. Since it make take a while to call 'internalWorked', this button may not appear for too long an interval. Update UI has the following problem: before connecting to the remote site, we spawn a thread to obtain the connection input stream. In case of a frozen connection, we want to allow users to return and let the stream thread die the natural death after a timeout. However, on our first connection attempt we don't move 'worked' method for enough ticks to make the 'cancel' button show, so users cannot cancel until we retry with another URL variant. Cancel button should be shown right away, or users should be able to tell if they want it right away (but IProgressMonitor does not have any provisions for this type of configuration).
bundles/org.eclipse.jface/src/org/eclipse/jface/action/StatusLine.java
import org.eclipse.jface.dialogs.ProgressIndicator;
import org.eclipse.jface.resource.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;
/**
 * A StatusLine control is a SWT Composite with a horizontal layout which hosts
 * a number of status indication controls.
 * Typically it is situated below the content area of the window.
 * <p>
 * By default a StatusLine has two predefined status controls: a MessageLine and a
 * ProgressIndicator and it provides API for easy access.
 * </p>
 * <p>
 * This is an internal class, not intended to be used outside the JFace framework.
 * </p>
 */
 class StatusLine extends Composite implements IProgressMonitor {
	
	
	public static final int GAP= 3;
	
	public static final int DELAY_PROGRESS= 500;	
	
	protected boolean fProgressIsVisible= false;
	protected boolean fCancelButtonIsVisible= false;
	protected boolean fCancelEnabled= false;
	protected String fTaskName;