Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'issue/optional-surround-braces-1001034'

  • Loading branch information...
commit f46a95145564ee830be82deef0bf10ab78b88af4 2 parents e0a8877 + 6abeb25
@dragos dragos authored
View
41 org.scala-ide.sdt.core/src/scala/tools/eclipse/properties/EditorPreferencePage.scala
@@ -0,0 +1,41 @@
+package scala.tools.eclipse
+package properties
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer
+import org.eclipse.jface.preference.{ FieldEditorPreferencePage, BooleanFieldEditor }
+import org.eclipse.ui.{ IWorkbenchPreferencePage, IWorkbench }
+import EditorPreferencePage._
+
+class EditorPreferencePage extends FieldEditorPreferencePage with IWorkbenchPreferencePage {
+
+ setPreferenceStore(ScalaPlugin.plugin.getPreferenceStore)
+
+ override def createFieldEditors() {
+ addField(new BooleanFieldEditor(P_ENABLE_SMART_BRACKETS, "Automatically surround selection with [brackets]", getFieldEditorParent))
+ addField(new BooleanFieldEditor(P_ENABLE_SMART_BRACES, "Automatically surround selection with {braces}", getFieldEditorParent))
+ addField(new BooleanFieldEditor(P_ENABLE_SMART_PARENS, "Automatically surround selection with (parenthesis)", getFieldEditorParent))
+ addField(new BooleanFieldEditor(P_ENABLE_SMART_QUOTES, "Automatically surround selection with \"quotes\"", getFieldEditorParent))
+ }
+
+ def init(workbench: IWorkbench) {}
+
+}
+
+object EditorPreferencePage {
+ final val BASE = "scala.tools.eclipse.editor."
+ final val P_ENABLE_SMART_BRACKETS = BASE + "smartBrackets"
+ final val P_ENABLE_SMART_BRACES = BASE + "smartBraces"
+ final val P_ENABLE_SMART_PARENS = BASE + "smartParens"
+ final val P_ENABLE_SMART_QUOTES = BASE + "smartQuotes"
+}
+
+class DebugPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ override def initializeDefaultPreferences() {
+ val store = ScalaPlugin.plugin.getPreferenceStore
+ store.setDefault(P_ENABLE_SMART_BRACKETS, false)
+ store.setDefault(P_ENABLE_SMART_BRACES, false)
+ store.setDefault(P_ENABLE_SMART_PARENS, false)
+ store.setDefault(P_ENABLE_SMART_QUOTES, false)
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.