diff options
Diffstat (limited to 'plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettings.java')
-rw-r--r-- | plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettings.java | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettings.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettings.java index 273fd4cb8531..c2538426a871 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettings.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyDebuggerSettings.java @@ -19,23 +19,31 @@ import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.components.StoragePathMacros; import com.intellij.openapi.options.Configurable; +import com.intellij.openapi.options.SimpleConfigurable; +import com.intellij.openapi.util.Getter; import com.intellij.openapi.util.registry.Registry; import com.intellij.util.xmlb.XmlSerializerUtil; +import com.intellij.xdebugger.settings.DebuggerSettingsCategory; import com.intellij.xdebugger.settings.XDebuggerSettings; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import org.jetbrains.plugins.groovy.GroovyBundle; + +import java.util.Collection; +import java.util.Collections; + +import static java.util.Collections.singletonList; /** * @author ilyas */ @State( - name = "GroovyDebuggerSettings", - storages = { + name = "GroovyDebuggerSettings", + storages = { @Storage( - file = StoragePathMacros.APP_CONFIG + "/groovy_debug.xml" + file = StoragePathMacros.APP_CONFIG + "/groovy_debug.xml" )} ) -public class GroovyDebuggerSettings extends XDebuggerSettings<GroovyDebuggerSettings> { +public class GroovyDebuggerSettings extends XDebuggerSettings<GroovyDebuggerSettings> implements Getter<GroovyDebuggerSettings> { public Boolean DEBUG_DISABLE_SPECIFIC_GROOVY_METHODS = true; public boolean ENABLE_GROOVY_HOTSWAP = Registry.is("enable.groovy.hotswap"); @@ -43,19 +51,19 @@ public class GroovyDebuggerSettings extends XDebuggerSettings<GroovyDebuggerSett super("groovy_debugger"); } - @Override @NotNull - public Configurable createConfigurable() { - return new GroovyDebuggerSettingsConfigurable(this); - } - - @Nullable + @SuppressWarnings("EnumSwitchStatementWhichMissesCases") @Override - public Configurable createConfigurable(@NotNull Category category) { - if (category == Category.STEPPING) { - return new GroovySteppingConfigurable(); + public Collection<? extends Configurable> createConfigurables(@NotNull DebuggerSettingsCategory category) { + switch (category) { + case STEPPING: + return singletonList(SimpleConfigurable.create("reference.idesettings.debugger.groovy", GroovyBundle.message("groovy.debug.caption"), + "reference.idesettings.debugger.groovy", GroovySteppingConfigurableUi.class, this)); + case HOTSWAP: + return singletonList(SimpleConfigurable.create("reference.idesettings.debugger.groovy", GroovyBundle.message("groovy.debug.caption"), + "reference.idesettings.debugger.groovy", GroovyHotSwapConfigurableUi.class, this)); } - return null; + return Collections.emptyList(); } @Override @@ -71,4 +79,9 @@ public class GroovyDebuggerSettings extends XDebuggerSettings<GroovyDebuggerSett public static GroovyDebuggerSettings getInstance() { return getInstance(GroovyDebuggerSettings.class); } + + @Override + public GroovyDebuggerSettings get() { + return this; + } }
\ No newline at end of file |