String displayName = typeChoicer.getText( ); String category = getCategory4DisplayName( displayName );
String category = getCategory4UIDisplayName( typeChoicer.getText( ) );
	private void updatePreview( )	{		String pattern = ""; //$NON-NLS-1$		String fmtStr = ""; //$NON-NLS-1$		String displayName = typeChoicer.getText( );		String category = getCategory4DisplayName( displayName );		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( fmtStr );			setPatternStr( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( fmtStr );			setPatternStr( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( fmtStr );			setPatternStr( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( fmtStr );			setPatternStr( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_TIME.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( fmtStr );			setPatternStr( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( fmtStr );			setPatternStr( pattern );			return;		}		else if ( DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_TIME.equals( category ) )		{			pattern = getPatternForCategory( category );			fmtStr = new DateFormatter( pattern ).format( sampleDateTime );			generalPreviewLabel.setText( fmtStr );			setPatternStr( 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 = Messages.getString( "FormatDateTimePreferencePage.preview.invalidDateTimeToPreview" ); //$NON-NLS-1$				}			}			if ( fmtStr == null || fmtStr == "" ) //$NON-NLS-1$			{				fmtStr = Messages.getString( "FormatDateTimePreferencePage.preview.invalidFormatCode" ); //$NON-NLS-1$			}			cusPreviewLabel.setText( fmtStr );			setPatternStr( pattern );			return;		}	}