use of com.intellij.application.options.emmet.XmlEmmetConfigurable 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;
}
});
}
}
}
Aggregations