Package com.dci.intellij.dbn.code.common.style.options

Examples of com.dci.intellij.dbn.code.common.style.options.CodeStyleFormattingOption


import com.dci.intellij.dbn.code.common.style.presets.statement.StatementOneLineSpacingAtLeastPreset;
import com.dci.intellij.dbn.code.common.style.presets.statement.StatementOneLineSpacingPreset;

public class SQLCodeStyleFormattingSettings extends CodeStyleFormattingSettings {
    public SQLCodeStyleFormattingSettings() {
        CodeStyleFormattingOption statementSpacing =
                new CodeStyleFormattingOption("STATEMENT_SPACING", "Statement spacing");
        statementSpacing.addPreset(new StatementLineBreakPreset());
        statementSpacing.addPreset(new StatementLineBreakAtLeastPreset());
        statementSpacing.addPreset(new StatementOneLineSpacingPreset(), true);
        statementSpacing.addPreset(new StatementOneLineSpacingAtLeastPreset());
        statementSpacing.addPreset(new StatementIgnoreSpacingPreset());
        addOption(statementSpacing);

        CodeStyleFormattingOption clauseChopDown =
                new CodeStyleFormattingOption("CLAUSE_CHOP_DOWN", "Clause chop down");
        clauseChopDown.addPreset(new ClauseChopDownAlwaysPreset());
        clauseChopDown.addPreset(new ClauseChopDownIfLongPreset());
        clauseChopDown.addPreset(new ClauseChopDownIfLongStatementPreset(), true);
        clauseChopDown.addPreset(new ClauseChopDownNeverPreset());
        clauseChopDown.addPreset(new ClauseIgnoreWrappingPreset());
        addOption(clauseChopDown);

        CodeStyleFormattingOption iterationsWrapOption =
                new CodeStyleFormattingOption("ITERATION_ELEMENTS_WRAPPING", "Iteration elements wrapping");
        iterationsWrapOption.addPreset(new IterationChopDownAlwaysPreset());
        iterationsWrapOption.addPreset(new IterationChopDownIfLongPreset());
        iterationsWrapOption.addPreset(new IterationChopDownIfLongStatementPreset());
        iterationsWrapOption.addPreset(new IterationChopDownIfNotSinglePreset(), true);
        iterationsWrapOption.addPreset(new IterationNoWrappingPreset());
        iterationsWrapOption.addPreset(new IterationIgnoreWrappingPreset());
        addOption(iterationsWrapOption);
    }
View Full Code Here


        super(settings);
        List<CodeStyleFormattingOption> options = settings.getOptions();
        settingsPanel.setLayout(new GridLayoutManager(options.size() + 1, 2, new Insets(4, 4, 4, 4), -1, -1));
        updateBorderTitleForeground(mainPanel);
        for (int i=0; i< options.size(); i++) {
            CodeStyleFormattingOption option = options.get(i);
            JLabel label = new JLabel(option.getDisplayName());
            settingsPanel.add(label,
                    new GridConstraints(i, 0, 1, 1,
                            GridConstraints.ANCHOR_WEST,
                            GridConstraints.FILL_NONE,
                            GridConstraints.SIZEPOLICY_FIXED,
                            GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));

            JComboBox comboBox = new ComboBox(option.getPresets().toArray(), -1);

            settingsPanel.add(comboBox,
                    new GridConstraints(i, 1, 1, 1,
                            GridConstraints.ANCHOR_WEST,
                            GridConstraints.FILL_HORIZONTAL,
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.code.common.style.options.CodeStyleFormattingOption

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.