Configurables

I would like to add a child node to my configurable but am having trouble doing so. Is there an example or tutorial somewhere that explains how to add a child node in the Preferences to your configurable?

6 comments
Comment actions Permalink

Just make your main configurable implement Configurable.Composite and provide your children from the getConfigurables() method.

0
Comment actions Permalink

Can you give me an example of what the 2 files should look like?

I keep getting this error.

[  27744]  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=com.apple.eawt._AppEventHandler$_AppEventDispatcher$1@118cc659,notifier=null,catchExceptions=false,when=1304525362342] on apple.awt.CToolkit@76d697d9
org.picocontainer.defaults.UnsatisfiableDependenciesException: com.thesba.GeminiPlugin.tasks.ui.GeminiSettingsConfigurable has unsatisfied dependency: interface com.intellij.openapi.options.Configurable among unsatisfiable dependencies: [[interface com.intellij.openapi.options.Configurable, interface java.util.List]] where AreaPicoContainer[null] was the leaf container being asked for dependencies.
 at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getGreediestSatisfiableConstructor(ConstructorInjectionComponentAdapter.java:191)
 at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:210)
 at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
 at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
 at com.intellij.openapi.extensions.AbstractExtensionPointBean.instantiate(AbstractExtensionPointBean.java:69)
 at com.intellij.openapi.options.ConfigurableEP$NewInstanceFactory.create(ConfigurableEP.java:98)
 at com.intellij.openapi.options.ConfigurableEP$NewInstanceFactory.create(ConfigurableEP.java:96)
 at com.intellij.openapi.options.ConfigurableEP.createConfigurable(ConfigurableEP.java:76)
 at com.intellij.openapi.options.ex.ConfigurableExtensionPointUtil.buildConfigurablesList(ConfigurableExtensionPointUtil.java:46)
 at com.intellij.openapi.options.ex.ConfigurablesGroupBase.getConfigurables(ConfigurablesGroupBase.java:49)
 at com.intellij.ide.actions.ShowSettingsUtilImpl.filterEmptyGroups(ShowSettingsUtilImpl.java:104)
 at com.intellij.ide.actions.ShowSettingsUtilImpl._showSettingsDialog(ShowSettingsUtilImpl.java:49)
 at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:45)
 at com.intellij.ide.MacOSApplicationProvider$Worker$1.handlePreferences(MacOSApplicationProvider.java:83)
 at com.apple.eawt._AppEventLegacyHandler$2.dispatchEvent(_AppEventLegacyHandler.java:90)
 at com.apple.eawt._AppEventLegacyHandler.sendEventToEachListenerUntilHandled(_AppEventLegacyHandler.java:168)
 at com.apple.eawt._AppEventLegacyHandler.handlePreferences(_AppEventLegacyHandler.java:88)
 at com.apple.eawt._AppEventHandler$_PreferencesDispatcher.performUsing(_AppEventHandler.java:238)
 at com.apple.eawt._AppEventHandler$_PreferencesDispatcher.performUsing(_AppEventHandler.java:229)
 at com.apple.eawt._AppEventHandler$_AppEventDispatcher$1.run(_AppEventHandler.java:474)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:678)
 at java.awt.EventQueue.access$000(EventQueue.java:86)
 at java.awt.EventQueue$1.run(EventQueue.java:639)
 at java.awt.EventQueue$1.run(EventQueue.java:637)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:648)
 at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:652)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:505)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:404)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
[  27747]  ERROR - com.intellij.ide.IdeEventQueue - IntelliJ IDEA 10.0.3  Build #IC-103.255
[  27747]  ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.6.0_24
[  27747]  ERROR - com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) 64-Bit Server VM
[  27747]  ERROR - com.intellij.ide.IdeEventQueue - Vendor: Apple Inc.
[  27747]  ERROR - com.intellij.ide.IdeEventQueue - OS: Mac OS X
[  27747]  ERROR - com.intellij.ide.IdeEventQueue - Last Action:  

0
Comment actions Permalink

Did you mean Configurable is ProjectConfigurable or ApplicationConfigurable and nodes like in 'Code Style' in IDE Settings window?

0
Comment actions Permalink

If so, one possible way is extends your Configurable from com.intellij.openapi.options.SearchableConfigurable.Parent.Abstract and in method buildConfigurables() create your nested nodes(which also can be parents). As example see com.intellij.application.options.CodeStyleSchemesConfigurable.

0
Comment actions Permalink

Thanks I will take a look

0
Comment actions Permalink

Awesome. I see I was getting the project error because I had it set up as an application configurable but was passing it a project.

I removed the project part and it worked!

0

Please sign in to leave a comment.