String pattern = ""; String fmtStr = "";
	private void updatePreview( )	{		markDirty( hasLoaded );		String pattern = ""; //$NON-NLS-1$		String fmtStr = ""; //$NON-NLS-1$		String category = getCategory4UIDisplayName( typeChoicer.getText( ) );		setCategory( category );		Date sampleDateTime = new Date( );		if ( getPreviewText( ) != null )		{			try			{				sampleDateTime = new Date( getPreviewText( ) );			}			catch ( Exception e )			{				//			}		}		if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE				.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE				.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE				.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE				.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_TIME				.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME				.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_TIME				.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM				.equals( category ) )		{			pattern = formatCode.getText( );			if ( StringUtil.isBlank( previewTextBox.getText( ) ) )			{				fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			}			else			{				String text = previewTextBox.getText( );				try				{					fmtStr = new DateFormatter( pattern ).format( new Date(							text ) );				}				catch ( Exception e )				{					fmtStr = PREVIEW_TEXT_INVALID_DATETIME_TO_PREVIEW;				}			}			cusPreviewLabel.setText( validatedFmtStr( fmtStr ) );			setPattern( pattern );			return;		}	}