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;
}
});
}
}
}
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);
}
}
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());
}
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());
}
}
}
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));
}
}
Aggregations