FormatNumberPattern fmtPattern = getFmtPattern( );
String category = getCategory4DisplayName( typeChoicer.getText( ) ); FormatNumberPattern fmtPattern = getFmtPattern4Category( category );
	private void updatePreview( )	{		String pattern = ""; //$NON-NLS-1$		String fmtStr = ""; //$NON-NLS-1$		if ( hasLoaded )		{// avoid setting pattern from controls when the typechoicer is selected			// before loading.			setPatternFromControls( );		}		FormatNumberPattern fmtPattern = getFmtPattern( );		setCategory( fmtPattern.getCategory( ) );		setPatternStr( fmtPattern.getPattern( ) );		pattern = fmtPattern.getPattern( );		double num = Double.parseDouble( getPreviewText( ) == null ? DEFAULT_PREVIEW_TEXT				: getPreviewText( ) );		String displayName = typeChoicer.getText( );		String category = getCategoryForDisplayName( displayName );		if ( category.equals( DesignChoiceConstants.NUMBER_FORMAT_TYPE_GENERAL_NUMBER ) )		{			fmtStr = new NumberFormatter( pattern ).format( num );			gPreviewLabel.setText( validateFmtStr( fmtStr ) );			return;		}		else if ( category.equals( DesignChoiceConstants.NUMBER_FORMAT_TYPE_CURRENCY ) )		{			fmtStr = new NumberFormatter( pattern ).format( num );			cPreviewLabel.setText( validateFmtStr( fmtStr ) );			return;		}		else if ( category.equals( DesignChoiceConstants.NUMBER_FORMAT_TYPE_FIXED ) )		{			fmtStr = new NumberFormatter( pattern ).format( num );			fPreviewLabel.setText( validateFmtStr( fmtStr ) );			return;		}		else if ( category.equals( DesignChoiceConstants.NUMBER_FORMAT_TYPE_PERCENT ) )		{			fmtStr = new NumberFormatter( pattern ).format( num );			pPreviewLabel.setText( validateFmtStr( fmtStr ) );			return;		}		else if ( category.equals( DesignChoiceConstants.NUMBER_FORMAT_TYPE_SCIENTIFIC ) )		{			fmtStr = new NumberFormatter( pattern ).format( num );			sPreviewLabel.setText( validateFmtStr( fmtStr ) );			return;		}		else if ( category.equals( DesignChoiceConstants.NUMBER_FORMAT_TYPE_CUSTOM ) )		{			if ( StringUtil.isBlank( previewTextBox.getText( ) ) )			{				fmtStr = new NumberFormatter( pattern ).format( num );			}			else if ( DEUtil.isValidNumber( previewTextBox.getText( ) ) )			{				fmtStr = new NumberFormatter( pattern ).format( Double.parseDouble( previewTextBox.getText( ) ) );			}			else			{				fmtStr = Messages.getString( "FormatNumberPreferencePage.previewLabel.invalidNumberToPreview" ); //$NON-NLS-1$			}			cusPreviewLabel.setText( validateFmtStr( fmtStr ) );			return;		}	}