TabItem currentItem = cmpTaskContainer.getItem( cmpTaskContainer.getSelectionIndex( ) );
if ( cmpTaskContainer.getSelectionIndex( ) < 0 ) { cmpTaskContainer.setSelection( 0 ); } CTabItem currentItem = cmpTaskContainer.getItem( cmpTaskContainer.getSelectionIndex( ) );
	public void switchTo( String sTaskID )	{		// Update the context from the current task...if available		if ( sCurrentActiveTask != null )		{			String[] sErrors = getCurrentTask( ).getErrors( );			if ( sErrors != null && sErrors.length > 0 )			{				ErrorDialog ed = new ErrorDialog( shellParent,						Messages.getString( "WizardBase.error.ErrorsEncountered" ), //$NON-NLS-1$						Messages.getString( "WizardBase.error.FollowingErrorsReportedByTask" ), //$NON-NLS-1$						sErrors,						new String[]{} );				if ( ed.getOption( ) == ErrorDialog.OPTION_ACCEPT )				{					// Pressing OK will retain current task					return;				}			}			this.context = getCurrentTask( ).getContext( );		}		// Clear any existing popup		if ( shellPopup != null && !shellPopup.isDisposed( ) )		{			shellPopup.close( );		}		// Update current active task ID		sCurrentActiveTask = sTaskID;		// Pass the errorHints if any have been reported by previous task		if ( errorHints != null )		{			getCurrentTask( ).setErrorHints( errorHints );		}		// Pass the context to the new task...so it can prepare its UI		getCurrentTask( ).setContext( context );		// Clear errorHints		errorHints = null;		// Update UI		TabItem currentItem = cmpTaskContainer.getItem( cmpTaskContainer.getSelectionIndex( ) );		Composite cmpTask = getCurrentTask( ).getUI( cmpTaskContainer );		if ( currentItem.getControl( ) == null )		{			currentItem.setControl( cmpTask );		}		cmpTask.layout( );		// Pack every task to show as much as possible		packWizard( );	}