Search in sources :

Example 1 with Configurable

use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.

the class EmmetLookupActionProvider method fillActions.

@Override
public void fillActions(LookupElement element, final Lookup lookup, Consumer<LookupElementAction> consumer) {
    if (element instanceof CustomLiveTemplateLookupElement && ((CustomLiveTemplateLookupElement) element).getCustomLiveTemplate() instanceof ZenCodingTemplate) {
        final PsiElement context = lookup.getPsiElement();
        final ZenCodingGenerator generator = context != null ? ZenCodingTemplate.findApplicableDefaultGenerator(context, false) : null;
        if (generator != null) {
            consumer.consume(new LookupElementAction(PlatformIcons.EDIT, "Edit Emmet settings") {

                @Override
                public Result performLookupAction() {
                    final Project project = lookup.getProject();
                    ApplicationManager.getApplication().invokeLater(() -> {
                        if (project.isDisposed())
                            return;
                        final Configurable generatorSpecificConfigurable = generator.createConfigurable();
                        Configurable configurable = generatorSpecificConfigurable != null ? generatorSpecificConfigurable : new XmlEmmetConfigurable();
                        ShowSettingsUtil.getInstance().editConfigurable(project, new EmmetCompositeConfigurable(configurable));
                    });
                    return Result.HIDE_LOOKUP;
                }
            });
            consumer.consume(new LookupElementAction(AllIcons.Actions.Delete, "Disable Emmet") {

                @Override
                public Result performLookupAction() {
                    ApplicationManager.getApplication().invokeLater(generator::disableEmmet);
                    return Result.HIDE_LOOKUP;
                }
            });
        }
    }
}
Also used : ZenCodingTemplate(com.intellij.codeInsight.template.emmet.ZenCodingTemplate) Project(com.intellij.openapi.project.Project) CustomLiveTemplateLookupElement(com.intellij.codeInsight.template.impl.CustomLiveTemplateLookupElement) LookupElementAction(com.intellij.codeInsight.lookup.LookupElementAction) EmmetCompositeConfigurable(com.intellij.application.options.emmet.EmmetCompositeConfigurable) ZenCodingGenerator(com.intellij.codeInsight.template.emmet.generators.ZenCodingGenerator) Configurable(com.intellij.openapi.options.Configurable) XmlEmmetConfigurable(com.intellij.application.options.emmet.XmlEmmetConfigurable) EmmetCompositeConfigurable(com.intellij.application.options.emmet.EmmetCompositeConfigurable) XmlEmmetConfigurable(com.intellij.application.options.emmet.XmlEmmetConfigurable) PsiElement(com.intellij.psi.PsiElement)

Example 2 with Configurable

use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.

the class JavaCompilersTab method apply.

public void apply() throws ConfigurationException {
    try {
        for (Configurable configurable : myConfigurables) {
            if (configurable.isModified()) {
                configurable.apply();
            }
        }
        myCompilerConfiguration.setDefaultCompiler(mySelectedCompiler);
        myCompilerConfiguration.setProjectBytecodeTarget(myTargetLevelComponent.getProjectBytecodeTarget());
        myCompilerConfiguration.setModulesBytecodeTargetMap(myTargetLevelComponent.getModulesBytecodeTargetMap());
        myTargetLevelComponent.setProjectBytecodeTargetLevel(myCompilerConfiguration.getProjectBytecodeTarget());
        myTargetLevelComponent.setModuleTargetLevels(myCompilerConfiguration.getModulesBytecodeTargetMap());
    } finally {
        BuildManager.getInstance().clearState(myProject);
    }
}
Also used : Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Example 3 with Configurable

use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.

the class JavaCompilersTab method reset.

public void reset() {
    for (Configurable configurable : myConfigurables) {
        configurable.reset();
    }
    selectCompiler(myCompilerConfiguration.getDefaultCompiler());
    myTargetLevelComponent.setProjectBytecodeTargetLevel(myCompilerConfiguration.getProjectBytecodeTarget());
    myTargetLevelComponent.setModuleTargetLevels(myCompilerConfiguration.getModulesBytecodeTargetMap());
}
Also used : Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable)

Example 4 with Configurable

use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.

the class ShowSettingsUtilImpl method collect.

private static void collect(List<Configurable> list, Configurable... configurables) {
    for (Configurable configurable : configurables) {
        list.add(configurable);
        if (configurable instanceof Configurable.Composite) {
            Configurable.Composite composite = (Configurable.Composite) configurable;
            collect(list, composite.getConfigurables());
        }
    }
}
Also used : Configurable(com.intellij.openapi.options.Configurable) TabbedConfigurable(com.intellij.openapi.options.TabbedConfigurable)

Example 5 with Configurable

use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.

the class OpenExternalSystemSettingsCallback method hyperlinkActivated.

@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
    ExternalSystemManager<?, ?, ?, ?, ?> manager;
    if (myLinkedProjectPath == null || !((manager = ExternalSystemApiUtil.getManager(mySystemId)) instanceof ExternalSystemConfigurableAware)) {
        ShowSettingsUtil.getInstance().showSettingsDialog(myProject, mySystemId.getReadableName());
        return;
    }
    final Configurable configurable = ((ExternalSystemConfigurableAware) manager).getConfigurable(myProject);
    if (configurable instanceof AbstractExternalSystemConfigurable) {
        ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable, () -> ((AbstractExternalSystemConfigurable) configurable).selectProject(myLinkedProjectPath));
    }
}
Also used : AbstractExternalSystemConfigurable(com.intellij.openapi.externalSystem.service.settings.AbstractExternalSystemConfigurable) ExternalSystemConfigurableAware(com.intellij.openapi.externalSystem.ExternalSystemConfigurableAware) Configurable(com.intellij.openapi.options.Configurable) AbstractExternalSystemConfigurable(com.intellij.openapi.externalSystem.service.settings.AbstractExternalSystemConfigurable)

Aggregations

Configurable (com.intellij.openapi.options.Configurable)66 SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)32 BaseConfigurable (com.intellij.openapi.options.BaseConfigurable)8 NotNull (org.jetbrains.annotations.NotNull)8 ConfigurableGroup (com.intellij.openapi.options.ConfigurableGroup)7 UnnamedConfigurable (com.intellij.openapi.options.UnnamedConfigurable)7 Nullable (org.jetbrains.annotations.Nullable)6 Project (com.intellij.openapi.project.Project)5 ArrayList (java.util.ArrayList)5 ConfigurationException (com.intellij.openapi.options.ConfigurationException)4 ArtifactsStructureConfigurable (com.intellij.openapi.roots.ui.configuration.artifacts.ArtifactsStructureConfigurable)4 ApplicationConfigurable (com.intellij.execution.application.ApplicationConfigurable)3 JUnitConfigurable (com.intellij.execution.junit2.configuration.JUnitConfigurable)3 DataContext (com.intellij.openapi.actionSystem.DataContext)3 Module (com.intellij.openapi.module.Module)3 TabbedConfigurable (com.intellij.openapi.options.TabbedConfigurable)3 Settings (com.intellij.openapi.options.ex.Settings)3 ActionCallback (com.intellij.openapi.util.ActionCallback)3 ExtensionsArea (com.intellij.openapi.extensions.ExtensionsArea)2 CompositeConfigurable (com.intellij.openapi.options.CompositeConfigurable)2