Search in sources :

Example 1 with CSSCleanupStrategyImpl

use of org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategyImpl in project webtools.sourceediting by eclipse.

the class CleanupDialogCSS method updateCleanupOptions.

/**
 */
protected void updateCleanupOptions() {
    CSSCleanupStrategy stgy = CSSCleanupStrategyImpl.getInstance();
    if (fRadioButtonIdentCaseAsis != null) {
        if (fRadioButtonIdentCaseUpper.getSelection())
            stgy.setIdentCase(CSSCleanupStrategy.UPPER);
        else if (fRadioButtonIdentCaseLower.getSelection())
            stgy.setIdentCase(CSSCleanupStrategy.LOWER);
        else
            stgy.setIdentCase(CSSCleanupStrategy.ASIS);
    }
    if (fRadioButtonPropNameCaseAsis != null) {
        if (fRadioButtonPropNameCaseUpper.getSelection())
            stgy.setPropNameCase(CSSCleanupStrategy.UPPER);
        else if (fRadioButtonPropNameCaseLower.getSelection())
            stgy.setPropNameCase(CSSCleanupStrategy.LOWER);
        else
            stgy.setPropNameCase(CSSCleanupStrategy.ASIS);
    }
    if (fRadioButtonPropValueCaseAsis != null) {
        if (fRadioButtonPropValueCaseUpper.getSelection())
            stgy.setPropValueCase(CSSCleanupStrategy.UPPER);
        else if (fRadioButtonPropValueCaseLower.getSelection())
            stgy.setPropValueCase(CSSCleanupStrategy.LOWER);
        else
            stgy.setPropValueCase(CSSCleanupStrategy.ASIS);
    }
    if (fRadioButtonSelectorTagCaseAsis != null) {
        if (fRadioButtonSelectorTagCaseUpper.getSelection())
            stgy.setSelectorTagCase(CSSCleanupStrategy.UPPER);
        else if (fRadioButtonSelectorTagCaseLower.getSelection())
            stgy.setSelectorTagCase(CSSCleanupStrategy.LOWER);
        else
            stgy.setSelectorTagCase(CSSCleanupStrategy.ASIS);
    }
    if (fRadioButtonSelectorIdCaseAsis != null) {
        if (fRadioButtonSelectorIdCaseUpper.getSelection())
            stgy.setIdSelectorCase(CSSCleanupStrategy.UPPER);
        else if (fRadioButtonSelectorIdCaseLower.getSelection())
            stgy.setIdSelectorCase(CSSCleanupStrategy.LOWER);
        else
            stgy.setIdSelectorCase(CSSCleanupStrategy.ASIS);
    }
    if (fRadioButtonSelectorClassCaseAsis != null) {
        if (fRadioButtonSelectorClassCaseUpper.getSelection())
            stgy.setClassSelectorCase(CSSCleanupStrategy.UPPER);
        else if (fRadioButtonSelectorClassCaseLower.getSelection())
            stgy.setClassSelectorCase(CSSCleanupStrategy.LOWER);
        else
            stgy.setClassSelectorCase(CSSCleanupStrategy.ASIS);
    }
    if (fCheckBoxQuoteValues != null)
        stgy.setQuoteValues(fCheckBoxQuoteValues.getSelection());
    if (fCheckBoxFormatSource != null)
        stgy.setFormatSource(fCheckBoxFormatSource.getSelection());
    // save these values to preferences
    ((CSSCleanupStrategyImpl) stgy).saveOptions();
}
Also used : CSSCleanupStrategyImpl(org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategyImpl) CSSCleanupStrategy(org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy)

Aggregations

CSSCleanupStrategy (org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy)1 CSSCleanupStrategyImpl (org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategyImpl)1