Search in sources :

Example 1 with SmartBackspaceMode

use of com.intellij.codeInsight.editorActions.SmartBackspaceMode in project intellij-community by JetBrains.

the class EditorSmartKeysConfigurable method reset.

@Override
public void reset() {
    EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
    CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();
    // Paste
    switch(codeInsightSettings.REFORMAT_ON_PASTE) {
        case CodeInsightSettings.NO_REFORMAT:
            myReformatOnPasteCombo.setSelectedItem(NO_REFORMAT);
            break;
        case CodeInsightSettings.INDENT_BLOCK:
            myReformatOnPasteCombo.setSelectedItem(INDENT_BLOCK);
            break;
        case CodeInsightSettings.INDENT_EACH_LINE:
            myReformatOnPasteCombo.setSelectedItem(INDENT_EACH_LINE);
            break;
        case CodeInsightSettings.REFORMAT_BLOCK:
            myReformatOnPasteCombo.setSelectedItem(REFORMAT_BLOCK);
            break;
    }
    myCbSmartHome.setSelected(editorSettings.isSmartHome());
    myCbSmartEnd.setSelected(codeInsightSettings.SMART_END_ACTION);
    myCbSmartIndentOnEnter.setSelected(codeInsightSettings.SMART_INDENT_ON_ENTER);
    myCbInsertPairCurlyBraceOnEnter.setSelected(codeInsightSettings.INSERT_BRACE_ON_ENTER);
    myCbInsertJavadocStubOnEnter.setSelected(codeInsightSettings.JAVADOC_STUB_ON_ENTER);
    myCbInsertPairBracket.setSelected(codeInsightSettings.AUTOINSERT_PAIR_BRACKET);
    myCbInsertPairQuote.setSelected(codeInsightSettings.AUTOINSERT_PAIR_QUOTE);
    myCbReformatBlockOnTypingRBrace.setSelected(codeInsightSettings.REFORMAT_BLOCK_ON_RBRACE);
    myCbCamelWords.setSelected(editorSettings.isCamelWords());
    myCbSurroundSelectionOnTyping.setSelected(codeInsightSettings.SURROUND_SELECTION_ON_QUOTE_TYPED);
    myCbEnableAddingCaretsOnDoubleCtrlArrows.setSelected(editorSettings.addCaretsOnDoubleCtrl());
    SmartBackspaceMode backspaceMode = codeInsightSettings.getBackspaceMode();
    switch(backspaceMode) {
        case OFF:
            mySmartBackspaceCombo.setSelectedItem(OFF);
            break;
        case INDENT:
            mySmartBackspaceCombo.setSelectedItem(SIMPLE);
            break;
        case AUTOINDENT:
            mySmartBackspaceCombo.setSelectedItem(SMART);
            break;
        default:
            LOG.error("Unexpected smart backspace mode value: " + backspaceMode);
    }
    super.reset();
}
Also used : CodeInsightSettings(com.intellij.codeInsight.CodeInsightSettings) SmartBackspaceMode(com.intellij.codeInsight.editorActions.SmartBackspaceMode) EditorSettingsExternalizable(com.intellij.openapi.editor.ex.EditorSettingsExternalizable)

Aggregations

CodeInsightSettings (com.intellij.codeInsight.CodeInsightSettings)1 SmartBackspaceMode (com.intellij.codeInsight.editorActions.SmartBackspaceMode)1 EditorSettingsExternalizable (com.intellij.openapi.editor.ex.EditorSettingsExternalizable)1