private FormatSpecifier buildFormatSpecifier() { FormatSpecifier fs = null; if (cmbDataType.getText().equals("Date/Time")) { if (this.btnAdvanced.getSelection()) { fs = JavaDateFormatSpecifierImpl.create(txtDatePattern.getText()); } else if (this.btnStandard.getSelection()) { fs = AttributeFactory.eINSTANCE.createDateFormatSpecifier(); ((DateFormatSpecifier) fs).setType(DateFormatType.get(cmbDateType.getText())); ((DateFormatSpecifier) fs).setDetail(DateFormatDetail.get(cmbDateForm.getText())); } } else { if (this.btnAdvanced.getSelection()) { fs = JavaNumberFormatSpecifierImpl.create(txtNumberPattern.getText()); if (txtAdvMultiplier.getText().length() > 0) { ((JavaNumberFormatSpecifierImpl) fs).setMultiplier(Double.valueOf(txtAdvMultiplier.getText()) .doubleValue()); } } else if (this.btnStandard.getSelection()) { fs = NumberFormatSpecifierImpl.create(); ((NumberFormatSpecifier) fs).setPrefix(txtPrefix.getText()); ((NumberFormatSpecifier) fs).setSuffix(txtSuffix.getText()); ((NumberFormatSpecifier) fs).setFractionDigits(iscFractionDigits.getValue()); if (txtMultiplier.getText().length() > 0) { ((NumberFormatSpecifier) fs).setMultiplier(Double.valueOf(txtMultiplier.getText()).doubleValue()); } } } return fs; }
private FormatSpecifier buildFormatSpecifier( ) { FormatSpecifier fs = null; if ( cmbDataType.getText( ).equals( "Date/Time" ) ) { if ( this.btnAdvanced.getSelection( ) ) { fs = JavaDateFormatSpecifierImpl.create( txtDatePattern.getText( ) ); } else if ( this.btnStandard.getSelection( ) ) { fs = AttributeFactory.eINSTANCE.createDateFormatSpecifier( ); ( (DateFormatSpecifier) fs ).setType( DateFormatType.get( cmbDateType.getText( ) ) ); ( (DateFormatSpecifier) fs ).setDetail( DateFormatDetail.get( cmbDateForm.getText( ) ) ); } } else { if ( this.btnAdvanced.getSelection( ) ) { fs = JavaNumberFormatSpecifierImpl.create( txtNumberPattern.getText( ) ); if ( txtAdvMultiplier.getText( ).length( ) > 0 ) { try { ( (JavaNumberFormatSpecifierImpl) fs ).setMultiplier( Double.valueOf( txtAdvMultiplier.getText( ) ) .doubleValue( ) ); } catch ( NumberFormatException e ) { handleFormatError( txtAdvMultiplier.getText( ) ); } } } else if ( this.btnStandard.getSelection( ) ) { fs = NumberFormatSpecifierImpl.create( ); ( (NumberFormatSpecifier) fs ).setPrefix( txtPrefix.getText( ) ); ( (NumberFormatSpecifier) fs ).setSuffix( txtSuffix.getText( ) ); ( (NumberFormatSpecifier) fs ).setFractionDigits( iscFractionDigits.getValue( ) ); if ( txtMultiplier.getText( ).length( ) > 0 ) { try { ( (NumberFormatSpecifier) fs ).setMultiplier( Double.valueOf( txtMultiplier.getText( ) ) .doubleValue( ) ); } catch ( NumberFormatException e ) { handleFormatError( txtMultiplier.getText( ) ); } } } } return fs; }
    private FormatSpecifier buildFormatSpecifier()    {        FormatSpecifier fs = null;        if (cmbDataType.getText().equals("Date/Time")) //$NON-NLS-1$        {            if (this.btnAdvanced.getSelection())            {                fs = JavaDateFormatSpecifierImpl.create(txtDatePattern.getText());            }            else if (this.btnStandard.getSelection())            {                fs = AttributeFactory.eINSTANCE.createDateFormatSpecifier();                ((DateFormatSpecifier) fs).setType(DateFormatType.get(cmbDateType.getText()));                ((DateFormatSpecifier) fs).setDetail(DateFormatDetail.get(cmbDateForm.getText()));            }        }        else        {            if (this.btnAdvanced.getSelection())            {                fs = JavaNumberFormatSpecifierImpl.create(txtNumberPattern.getText());                if (txtAdvMultiplier.getText().length() > 0)                {                    ((JavaNumberFormatSpecifierImpl) fs).setMultiplier(Double.valueOf(txtAdvMultiplier.getText())                        .doubleValue());                }            }            else if (this.btnStandard.getSelection())            {                fs = NumberFormatSpecifierImpl.create();                ((NumberFormatSpecifier) fs).setPrefix(txtPrefix.getText());                ((NumberFormatSpecifier) fs).setSuffix(txtSuffix.getText());                ((NumberFormatSpecifier) fs).setFractionDigits(iscFractionDigits.getValue());                if (txtMultiplier.getText().length() > 0)                {                    ((NumberFormatSpecifier) fs).setMultiplier(Double.valueOf(txtMultiplier.getText()).doubleValue());                }            }        }        return fs;    }